Question

Is it possible in Flex 4's VideoPlayer control (spark.components.VideoPlayer) to detect some attributes of the source video?

In my case, it's a local file. I would need to detect the original width and height of the input source video (an h264 f4v).

Thanks

Was it helpful?

Solution

You can get that info from the videoWidth and videoHeight properties of the video object that is contained within the video player, for example:

//Assuming you have your VideoPlayer object with an id of "videoPlayer"
videoPlayer.videoObject.videoWidht;
videoPlayer.videoObject.videoHeight;

Hope that helped.

OTHER TIPS

You need to listen for a MediaPlayerStateChangeEvent.MEDIA_PLAYER_STATE_CHANGE event on the VideoPlayer before accessing this property. For some strange reason you need to wait until event.state == MediaPlayerState.BUFFERING as its not yet available on MediaPlayerStateChangeEvent.READY as you'd probably expect.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top