0 Replies Latest reply on Aug 1, 2013 10:37 AM by ankurdahiya

    OSMF ScaleMode.ZOOM is distorting aspect ratio

    ankurdahiya Level 1

      So, I have a video of dimensions 216x360.

      My display area (and hence the dimensions of my swf) is 562x395.


      Now, I want this video to be zoomed such that 1.) aspect ratio is maintained, 2.) there are no black bars on any side. and 3.) the video is cropped from top and bottom.


      To achieve this, my code looks like this:


            var sprite = new MediaPlayerSprite();
            var vid:VideoElement = new VideoElement(new URLResource(videoResource));
            var layout:LayoutMetadata = new LayoutMetadata();
            layout.width = 526;
            layout.height = 395;
            layout.scaleMode = ScaleMode.ZOOM;
            vid.addMetadata(LayoutMetadata.LAYOUT_NAMESPACE, layout);
            _playerSprite.width = 526;
            _playerSprite.height = 395;
            _playerSprite.media = vid;


      Now, when I play the video, the aspect ratio is destroyed, there are no black bars and the whole video is fit in the display area without any cropping!!!

      What am I doing wrong here?