Diego

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

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);

This conversation is missing your voice. Please join Vimeo or log in.

Forums

Forum Rules

  1. Be nice

    Even if you disagree with someone, keep it civil.

  2. Stay on topic

    If it’s not relevant, leave it out or start a new thread.

  3. Don’t Spam

    Re-re-re-re-posts drive us crazy.

  4. Respect the Staff

    We were members once, just like you.

+ Learn more

Our Support Team

  • Mark Mark
  • Ian Ian
  • Tommy Tommy
  • Darnell Darnell
  • Zena Zena
  • Rebecca Rebecca

We’re here to help 10am–6pm Eastern, Monday–Friday.