2 Replies Latest reply on Sep 9, 2009 7:38 AM by Edwin van Rijkom

    MediaPlayerSprite on daily build question

    darqwan Level 1

      First of all, hi(my first post around here)..

       

      I'm doing a bad thing and started using OSMF in production code. This is after I tested the features I planned to use (prototyped back in r0.4). All seemed fine for a while, until I realised that there is a bug (http://bugs.adobe.com/jira/browse/FM-43). The streamed video part was fixed before releasing 0.5 I guess but the progressive part got fixed in the last 24 hours.

       

      I went ahead and checked out the latest sources and altough 43 seems fixed I've notice another thing namely for a VideoElement, the MediaPlayerSprite, on play() after it finishes playing(autoRewind=false), gets resized to the original size.

       

      I've updated a sample from the sdk to showcase this

       

      public class osmf extends Sprite

      {

      public function osmf()

      {

      var pb:TextField = new TextField();

      pb.text = "button";

      pb.selectable = false;

      pb.addEventListener(MouseEvent.CLICK, evthndlClick);

      addChild(pb);

      pb.x =  200;

      pb.y = 20;

       

      stage.scaleMode = StageScaleMode.NO_SCALE;

                  stage.align = StageAlign.TOP_LEFT;

       

      _player = new MediaPlayer(new VideoElement

      ( new NetLoader

      , new URLResource(new URL(REMOTE_PROGRESSIVE))

      ));

      _player.autoRewind =false;

       

      _sprite = new MediaPlayerSprite(_player);

      _sprite.scaleMode = ScaleMode.NONE;

      _sprite.width = 100;

      _sprite.height = 100;

      _sprite.scaleMode = ScaleMode.LETTERBOX;

      addChild(_sprite);

       

      }

       

      var _player:MediaPlayer;

      var _sprite:MediaPlayerSprite;

       

      private function evthndlClick(e:MouseEvent){

      _player.play();

      }

       

      private static const REMOTE_PROGRESSIVE:String

      = "http://85.204.187.204/resx/flv/CLOUD1.flv";

      }

       

       

      Is there a way workaround for this for now ? I understand that this is a daily build however I'm on a really tight deadline here and cant afford atm to dig into osmf too deep to figure out what's going on..

       

      thanks,

      best regards,

      Bogdan.

        • 1. Re: MediaPlayerSprite on daily build question
          darqwan Level 1

          I managed to get some time to dig into this a bit, onMetaData(VideoElement) overwrites the settings from SpatialTrait with the ones from the NetClient so each time netclient calls this, the size of the video will revert to the original size..

           

          Bogdan.

          • 2. Re: MediaPlayerSprite on daily build question
            Edwin van Rijkom Level 2

            Hi Bogdan,

             

            Thank you for your post.

             

            The code that changes video's dimenions got added yesterday, the rationale being that if we don't set the Video's width and height according to the reported size, than VideoElement is not develivering the video at the size that ISpatial promises it to be. Would one be using VideoElement's view directly, then its view would otherwise remain to be the default 320x240.

             

            As you report though, the dimensions get set always, regardless of there truly being a delta. This resulted in solely the dimensions on the view being updated, without a ISpatial dimension change event being triggered right afterwards (which MediaElementSprite would have picked up on to re-size). I'll make sure to add a patch for that.

             

            Thanks,

            Edwin