문제

One of the functions for the vimeo API (with froogaloop) is getDuration().

I am trying to make a function that will return the duration, but somehow I am getting Object as result. The Vimeo API documentation doesn't specify how are you supposed to do this.

I believe this is incorrect:

function getDuration() {
    return player.api('getDuration');
}

Here is an example:

http://jsfiddle.net/SeBwt/

도움이 되었습니까?

해결책

getDuration() accepts a callback function that gives you the duration of the media.

For example:

player.api('getDuration', function(dur) {
    alert(dur);
});

Demo

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top