0 Replies Latest reply on Mar 26, 2012 4:09 AM by A. Grahn

    [SMP] no replay possible after once playing media if FlashVar autoRewind==false, PATCH included

    A. Grahn

      If SMP is configured not to autoRewind after the media has ended, it is impossible to restart the media using the overlay play button or the controlbar play button. Instead, SMP goes into infinite buffering state. The proposed Patch fixes the problem by inserting the necessary seek(0) operations.

       

      --- player/StrobeMediaPlayback/src/org/osmf/player/chrome/widgets/PlayButtonOverlay.as  2012-03-20 15:07:22.000000000 +0100
      +++ player/StrobeMediaPlayback/src/org/osmf/player/chrome/widgets/PlayButtonOverlay.as.new  2012-03-20 14:36:25.000000000 +0100
      @@ -98,6 +98,11 @@
              override protected function onMouseClick(event:MouseEvent):void
              {
                  var playable:PlayTrait = media.getTrait(MediaTraitType.PLAY) as PlayTrait;
      +           var seekable:SeekTrait = media.getTrait(MediaTraitType.SEEK) as SeekTrait;
      +           if(playable.playState == PlayState.STOPPED)
      +           {
      +               try{seekable.seek(0);}catch(e:Object){}
      +           }
                  playable.play();
              }
      --- player/StrobeMediaPlayback/src/org/osmf/player/chrome/widgets/PlayButton.as 2012-03-20 15:07:00.000000000 +0100
      +++ player/StrobeMediaPlayback/src/org/osmf/player/chrome/widgets/PlayButton.as.new 2012-03-20 14:40:36.000000000 +0100
      @@ -26,6 +26,7 @@
          import org.osmf.traits.MediaTraitType;                                                                       
          import org.osmf.traits.PlayState;
          import org.osmf.traits.PlayTrait;                                                                            
      +   import org.osmf.traits.SeekTrait;                                                                            
      
          public class PlayButton extends PlayableButton                                                               
          {
      @@ -44,6 +45,11 @@
              override protected function onMouseClick(event:MouseEvent):void                                          
              {
                  var playable:PlayTrait = media.getTrait(MediaTraitType.PLAY) as PlayTrait;                           
      +           var seekable:SeekTrait = media.getTrait(MediaTraitType.SEEK) as SeekTrait;                           
      +           if(playable.playState == PlayState.STOPPED)
      +           {                                                                                                    
      +               try{seekable.seek(0);}catch(e:Object){}
      +           }
                  playable.play();
                  event.stopImmediatePropagation();                                                                    
              }