2 Replies Latest reply on Dec 22, 2011 2:13 AM by Silviu Vergoti

    Programmatically playing the "next" video in a playlist results in the old video playing as well

    jethroq

      (Using OSMF v1.6)

       

      When a video has finished playing, my player will automatically play the next video in a playlist, after doing the following:

       

      var loadTrait:LoadTrait = myMediaElement.getTrait(MediaTraitType.LOAD) as LoadTrait;

      loadTrait.unload();

      myMediaContainer.removeMediaElement(myMediaElement);

      myMediaPlayer.media = null;

       

       

      --- proceeds to create the new mediaElement (ex: myNewMediaElement) with appropriate metadata, etc

       

      myMediaContainer.addMediaElement(myNewMediaElement);

      myMediaPlayer.media = myNewMediaElement;

       

      Invariably this has resulted in the new video playing normally, but the *old* video also playing, I assume as an element/player/container behind the new one. So you get two simultaneous audio streams.

       

      Executing the same sequence of commands with a user interaction (i.e. clicking a "next" button to play the next video) does not display this behavior.

       

      I have done some searching and I cannot find anything else to try; does anyone have any ideas?

       

      Thanks!