Forums / API
how to use getVideoWidth
Forums
Forum Rules
-
Be nice
Even if you disagree with someone, keep it civil.
-
Stay on topic
If it’s not relevant, leave it out or start a new thread.
-
Don’t Spam
Re-re-re-re-posts drive us crazy.
-
Respect the Staff
We were members once, just like you.
Our Support Team
-
Mark
-
Ian
-
Tommy
-
Darnell
-
Zena
-
Rebecca
We’re here to help 10am–6pm Eastern, Monday–Friday.
Diego
Hello, I'm trying to get the with (and height) of a dynamically loaded video, to set the size of the jquery dialog correctrly, but I don't seem to be able to get the video info...
I use
var v_width = player1.api('getVideoWidth').toString();
var v_height = player1.api('getVideoHeight').toString();
But I get an object that I cant get a value of.... what is the correct usage?
Thanks!
Link: developer.vimeo.com/player/js-api
Diego
in the end, I think I will stay with
var screen_w = $(window).width();
var screen_h = $(window).height();
var mult_w = 80 * screen_w;
var mult_h = 80 * screen_h;
if (screen_w > 700) {
mult_w = 60 * screen_w;
mult_h = 60 * screen_h
}
var v_width = Math.floor(mult_w / 100); //player1.api('getVideoWidth').toString();
var v_height = Math.floor(mult_h / 100); // player1.api('getVideoHeight').toString();
$("#dialogVideo").dialog("option", "width", v_width);
$("#dialogVideo").dialog("option", "height", v_height);