我正在使用videojs
和dailymotion.js
来播放dailymotion的视频。我还使用videojs.thumbnails.js
来显示缩略图。但是这样一个简单的代码在video.js
:
未捕获RangeError:超出最大调用堆栈大小
<!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>
控制台中的错误是:
未捕获RangeError:超出最大调用堆栈大小
t.sc @ video.js:47
t.duration @ video.js:49
t.sc @ video.js:47
t.duration @ video.js:49
...
这似乎是一个循环,但我不知道它来自哪里,任何想法?感谢。
答案 0 :(得分:-1)
你需要在页面加载后放置videojs代码。试试这个
$(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'
}
});
});