2016-07-08 106 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

如果它仍然給錯誤共享控制檯登錄評論。 –

相關問題