Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

Get video area as a rectangle


I'm writing two plugins, one specific for Flash and one for HTML5 and I want to position my overlays according to the video. My question is if it is somehow possible to get the the video area, in the same way as the getSafeRegion() API, where the returned rectangle matches the area of the video (x, y, width and height).

3 Community Answers

Cooper Reid

JW Player Support Agent  
0 rated :

You can use jwplayer().getHeight / getWidth.
Cooper

laurent.desmet

User  
0 rated :

jwplayer().getHeight()/getWidth() returns the height and width of the complete videoplayer. The video-rectangle doesn't always match the the size of the videoplayer (e.g. when the aspect-ratio of the viewport doesn't match the aspect-ratio of the video in which case the video will be smaller by applying letterboxing). I particularly need the bounding box of the video which contains both it's size (width and height) and the position of the left top corner (x and y).

Cooper Reid

JW Player Support Agent  
0 rated :

Can you try measuring the size of the container? jwplayer().getContainer(); //returns either the <video> tag or <object> for Flash.
Cooper

This question has received the maximum number of answers.