Return duration from a function

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/

Answers:

Answer

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

For example:

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

Demo

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.