Resizing a Player to Match the Video Aspect Ratio

Here's what's new in Brightcove Knowledge:

The Training Videos page on the Brightcove Support site has been rewritten use the Media and Player APIs to make it easier to navigate. Let me know know what you think.

Tip of the week: Do you have video of mixed sizes and aspect ratios? Using the Brightcove Player API, you can dynamically resize your video player to match the size of the rendition when a new video is loaded into the player. You just need to get the frameHeight and frameWidth properties of the current rendition, which you can obtain using the getCurrentRendition() method of the video player module. Then you can either reset the height and width of the player to match exactly, or adjust one or the other to match the aspect ratio and avoid letterboxing. Remember that if the player uses the VideoPlayer component rather than ChromelessVideoPlayer, the height will include 45 pixels for the media controls. You can see a sample page where I hold the width of the player constant and adjust the height to match the aspect ratio of the current video (view source to see the code).