I am working through the example given with the OSMF download and it says :
For visual content, determining how it is sized and scaled is often integral to a successful viewing experience. Because this functionality can be so important, OSMF provides access to scale modes within MediaPlayerSprite.
To control the content scale mode, set MediaPlayerSprite.scaleMode with one of the following constants:LETTERBOX, NONE,STRETCH, ZOOM
[SWF(width = "640",height = "352")]
public class HelloWorld extends Sprite
public function HelloWorld()
// Create the container class that displays the media.
var sprite:MediaPlayerSprite = new MediaPlayerSprite();
// Assign the resource to play. This generates the appropriate
// MediaElement and passes it to the MediaPlayer. Because the MediaPlayer
// autoPlay property defaults to true, playback begins immediately.
sprite.resource = new URLResource("video/myVideo.f4v");
This does not resize the MediaPlayerSprite on stage. Can someone shed some light on this for me?
SacleMode takes effect only when you set the size of the MediaPlayerSprite. You haven't set the size so the media will play in its native size. (By the way letterbox is the default so you don't need to set it explicitly.)
Do you think you could show me how that would look? I thought I was setting the size of the MediaPlayerSprite. Good tip on the LETTERBOX thanks but I was only testing those values.
Thanks for your interest in this.
Well to set the size you'd do:
sprite.width = n; sprite.height = n;
If you set the shape of the MediaPlayerSprite to for example square and set the scaleMode to stretch you can see what these settings do.
Ahhh! I'm with you now. That works fine but I was hoping I could ZOOM, STRETCH or LETTERBOX the sprite to fit the SWF. As I said I am only messing around with OSMF but it is shaping up to do a nice job for what I want.
Thanks for your help.
Europe, Middle East and Africa