Search code examples
apache-flexvideosizeflex4flex-spark

Flex4: Detect source Video size VideoPlayer?


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


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.