views:

225

answers:

1

Hi,

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

A: 

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.

falomir
Thanks for the tip, I tried that.. The width and height is 0.. until I pause the movie, then it takes the right values.. weird. any idea why? is it because it's a local media (file://...) ?
Ben