javascript - Return duration from a function - Stack Overflow

One of the functions for the vimeo API (with froogaloop) is getDuration(). I am trying to make a functi

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:

/

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/SeBwt/

Share Improve this question edited Oct 15, 2013 at 21:47 Jarrod Dixon 15.8k9 gold badges61 silver badges72 bronze badges asked May 28, 2013 at 16:18 scroll_lockscroll_lock 1432 silver badges11 bronze badges 0
Add a ment  | 

1 Answer 1

Reset to default 9

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

For example:

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

Demo

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745640658a4637671.html

相关推荐

  • javascript - Return duration from a function - Stack Overflow

    One of the functions for the vimeo API (with froogaloop) is getDuration(). I am trying to make a functi

    9小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信