3556 posts Ruben Bristian
  • Sells items exclusively on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $500,000+ on Envato Market
  • Has been part of the Envato Community for over 6 years
+10 more
KrownThemes says

I have a template that use vimeo videos, and i made a custom oauth_key for the template. I pass it along with the template, so there’s no problem i guess..

1677 posts Envato Elite Author
  • Has referred 10+ members
  • Has sold $125,000+ on Envato Market
  • Has collected 1+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+6 more
Tean says


So if I want to use the video with “fit outside” aspect ratio, as I scale (enlarge) the player, controls scale with it, and then I end up with half of the controls sticking out of the player and not visible.

Well, to size it you should use the api_setSize method… you can’t give it a width and height like you do with any other object…

Then the fit outside is useless, because the video is already scaled within the player, so it’s enough to make it big like your max area size… as well for youtube players…

I am using setSize, and then apply aspect ratio inside my masked area.

So lets say I have a video 640×480 (original size), this would be 800×600 proportionally enlarged.

And lets say my area which I want to fill is 900×600.

If I used “fit inside” then I would just place it inside my area (and center).

Since I want “fit outside”, I would then sizeSize video to 900×675 (which is proportional) and then I have 75 pixels of spare on height side.

So if I center this inside my area which is masked, I am going to loose 37px on top and bottom of the video, thats fine since its “fit outside”, however controls are still at the bottom of the video and are going to get cut of by my mask.

Thats what I was talking about.

Now I know I can set video size directly to 900×600 but then video will get scaled inside the player (like you said) and I will theoretically get “fit inside” and blank space around video which I dont want.

3256 posts
  • Has referred 100+ members
  • Has sold $250,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+9 more
ParkerAndKent says



So if I want to use the video with “fit outside” aspect ratio, as I scale (enlarge) the player, controls scale with it, and then I end up with half of the controls sticking out of the player and not visible.

Well, to size it you should use the api_setSize method… you can’t give it a width and height like you do with any other object…

Then the fit outside is useless, because the video is already scaled within the player, so it’s enough to make it big like your max area size… as well for youtube players…

I am using setSize, and then apply aspect ratio inside my masked area.

So lets say I have a video 640×480 (original size), this would be 800×600 proportionally enlarged.

And lets say my area which I want to fill is 900×600.

If I used “fit inside” then I would just place it inside my area (and center).

Since I want “fit outside”, I would then sizeSize video to 900×675 (which is proportional) and then I have 75 pixels of spare on height side.

So if I center this inside my area which is masked, I am going to loose 37px on top and bottom of the video, thats fine since its “fit outside”, however controls are still at the bottom of the video and are going to get cut of by my mask.

Thats what I was talking about.

Now I know I can set video size directly to 900×600 but then video will get scaled inside the player (like you said) and I will theoretically get “fit inside” and blank space around video which I dont want.

You can do what u want only if you know the original video size to size the player proportionally and fit an area… unfortunately, both youtube and vimeo, don’t have an api call to know the original video size or to access its metadata.

by
by
by
by
by
by