3 Replies Latest reply on Dec 8, 2011 6:31 AM by SteveRicketts

    Confused over video sizing and positioning


      I'm using FB 4.5.1 to create a mobile app and having a bit of trouble figuring out what's happening with sizing.  My stage is 480x800 so that's what I set my container to but no change in video size.  So I size the video but I have to use 320x240 to get the full width and aspect ratio... why?


      mps = new MediaPlayerSprite();

      var container:UIComponent = new UIComponent();

      container.width = stage.stageWidth;

      container.height = stage.stageHeight;

      addElement( container );


      mps.width = 320;

      mps.height = 240;


      I tried using mps.ScaleMode = "letterbox"; but that didn't do anything and x,y is still 0,0. 


      I'm using an .flv file to test.  I've also tried a .mp4 but I only get audio with that and no video.  Suggestions greatly appreciated.


        • 1. Re: Confused over video sizing and positioning
          Silviu Vergoti Adobe Employee

          Hi Steve,


          Please take a look in the OSMF samples, Helloworld8.as. It will give you a good starting point on layout metadata.



          • 2. Re: Confused over video sizing and positioning
            SteveRicketts Level 1

            Took a look and tried a number of approaches but still the same thing.  However, the example uses MediaContainers and LayoutMetadata and I was using the MediaPlayerSprite.  So, I took the entire project and put it into my program.  Different results, but not necessarily good.  The video is about 4x the size of the original (160x120) and its top is halfway down the screen.  I messed with StageScaleMode.NO_SCALE a little and got varying results, none of which are close.


            I'm wondering should I be using the sprite or do I need the full controls?  Is the fact that my project is for a mobile device a problem?  As such, I wasn't able to add the child to the stage, I had to create a UIComponent add that to the stage and then the MediaContainer to that.

            • 3. Re: Confused over video sizing and positioning
              SteveRicketts Level 1

              Found the problem... I was using stage.stageWidth and stage.stageHeight to size the container.  Turns out that if you use just width and height with mps.scaleMode = ScaleMode.LETTERBOX, it positions just fine.  Apparently, I don't know what stageWidth and height is.  ;-)