2016-07-08 113 views
1

我使用videojsdailymotion.js打位DailyMotion的视频。我也用videojs.thumbnails.js来显示缩略图。但是,这样的简单代码video.js产生一个奇怪的错误:视频JS错误:最大调用堆栈大小超出

Uncaught RangeError: Maximum call stack size exceeded

<!doctype html> 
<html> 
<head> 
    <title>Video.js Thumbnails Example</title> 
    <link href="http://vjs.zencdn.net/4.3/video-js.css" rel="stylesheet"> 
    <link href="videojs.thumbnails.css" rel="stylesheet"> 
    <script src="http://vjs.zencdn.net/4.3/video.js"></script> 
    <script src='videojs.thumbnails.js'></script> 
    <script src='dailymotion.js'></script> 
</head> 
<body> 

<video id='video' 
     class='video-js vjs-default-skin' 
     width='640' 
     height='264' 
     controls> 
</video> 
<script> 
// initialize video.js 
var video = videojs('video',{ "techOrder": ["dailymotion","html5"], "src": "https://www.dailymotion.com/embed/video/x378j01"}); 

// here's an example of generating thumbnails from a sprited image: 
video.thumbnails({ 
    0: { 
    src: 'example-thumbnail.png' 
    } 
}); 

</script> 
</body> 
</html> 

在控制台中的错误是:

Uncaught RangeError: Maximum call stack size exceeded

t.sc @ video.js:47

t.duration @ video.js:49

t.sc @ video.js:47

t.duration @ video.js:49

...

这似乎是一个循环,但我不知道它在那里来自任何想法?谢谢。

回答

-1

你需要把videojs代码页load.Try在此之后

$(function(){ 
var video = videojs('video',{ "techOrder": ["dailymotion","html5"], "src": "https://www.dailymotion.com/embed/video/x378j01"}); 

// here's an example of generating thumbnails from a sprited image: 
video.thumbnails({ 
    0: { 
    src: 'example-thumbnail.png' 
    } 
}); 
}); 
+0

我试过,但它是同样的错误 –

+0

您需要将jquey文件页面上后,它会奏效。 –

+0

如果它仍然给错误共享控制台登录评论。 –

相关问题