Order Now AdSolution Sign Up | Login » Bits on the Run Sign Up | Login »

Forums

/

player.sendEvent('STOP'); IE and version 4.4.170

3 replies [Last post]

Jeroen,
Just updated to the latest version 4.4.170 because of the improved youtube.
(smaller logo and better quality)

However player.sendEvent('STOP'); doesn't work anymore in IE7
In all other browsers I don't see any problem

If you click on the picture and close the innerhtml it won't stop the video

This part is the code

  function closeagain() {
        if(player)
        {
         player.sendEvent('STOP');
         gid('title').innerHTML = '';
         gid('beschrijving').innerHTML = '';
         gid('link').innerHTML = '';
         gid('embed').innerHTML = '';
        }
      }

An alert after player.sendEvent('STOP'); works perfectly

I also noticed that the send event NEXT doesn't work anymore. I put in this function the STOP event then that function works well.
Again. this problem only occurs in the IE browsers

        if(obj.newstate == 'COMPLETED')
        {
          player.sendEvent('NEXT');
        }

In the source off the test page you will find all the code.
Hope you have some answer because this version is far more improved for playback youtube

Here a test page
http://www.cfcms.nl/testing-youtube-keywords-jwplayer4-with-highslide.html

Thanks for looking in

Two suggestions:

1) add the flashvar id to your flashvars. Jeroen added it for Linux, but I have seen several cases where it was useful on Windows also, so I now routinely include it in all player code.

2) use this method of adding Listeners. Even though the player has called playerReady(), it's not always 100% ready. Retrieving the playlist object and checking for null or undefined is a more robust method of checking to see if the player is really ready. You will occasionally see the "Try Again! alert.

    <script type="text/javascript">
      // <![CDATA[
      var player = null;

      function playerReady(obj)
      {
        player = gid(obj.id);
        addListeners();
      };

      function addListeners()
      {
        if((player.getPlaylist() !== 'null') &amp;&amp; (player.getPlaylist() !== 'undefined'))
        {
          player.addControllerListener('ITEM', 'itemMonitor');
          player.addModelListener('STATE',     'stateMonitor');
        }
        else
        {
alert('Try Again!);
          setTimeout("addListeners()", 100);
        }
      };
      

      function itemMonitor(obj)
      {
        currentItem = obj['index'];
      };

//...other functions

      function gid(name)
      {
        return document.getElementById(name);
      };
      // ]]>
    </script>

For now I solved the problem by not using the STOP event but with the PLAY event so I force the player to pause.

function closeagain() {
        if(player)
        {
        if(currentState != 'PAUSED')
        {
         player.sendEvent('PLAY');
         }
}

pfffff :(

It was a bug in the chromeless player

http://code.google.com/p/gdata-issues/issues/detail?id=1076

Should be fixed now

Jeroen you can delete this thread I think