Javascript video.js插件不工作

Javascript video.js插件不工作,javascript,video.js,Javascript,Video.js,我试图让video.js中的任何插件都能正常工作,但我不断收到与videojs('video\u example\u 1)相关的错误,说videojs没有定义。我从最近的一个插件中复制了代码,只是想看看我是否做错了什么。我得到的确切错误是: TypeError: vjs is undefined var video = videojs('video_example_1'); (line 41) ReferenceError: videojs is not defined 有人能帮忙吗?下面粘贴

我试图让video.js中的任何插件都能正常工作,但我不断收到与
videojs('video\u example\u 1)
相关的错误,说
videojs
没有定义。我从最近的一个插件中复制了代码,只是想看看我是否做错了什么。我得到的确切错误是:

TypeError: vjs is undefined
var video = videojs('video_example_1'); (line 41)
ReferenceError: videojs is not defined
有人能帮忙吗?下面粘贴了一些代码:

<link href="//vjs.zencdn.net/4.4/video-js.css" rel="stylesheet">
<link href="http://theonion.github.io/videojs-endcard/stylesheets/videojs.endcard.css"       
rel="stylesheet">
<script src="//vjs.zencdn.net/4.4/video.js"></script>
<script src="http://theonion.github.io/videojs-endcard/javascripts/videojs.endcard.js">    
</script>

<video
id="example_video_1" class="video-js vjs-default-skin" controls preload="auto"    
width="640" height="264"
data-setup='{"example_option":true}'>

<source src="http://video-js.zencoder.com/oceans-clip.mp4" type='video/mp4' />  
<source src="http://video-js.zencoder.com/oceans-clip.webm" type='video/webm' />
<source src="http://video-js.zencoder.com/oceans-clip.ogv" type='video/ogg' />  

</video>
<script>
// Sync or Async, you decide.
function getRelatedContent(callback) {
var div = document.createElement('div');
var p = document.createElement('p');
p.innerHTML = "So Cool You'll HAVE to Click This!";
div.appendChild(p);
setTimeout(function(){
    // Needs an array
    callback([div]);
}, 0);
}

function getNextVid(callback) {
var div = document.createElement('div');
var anchor = document.createElement('a');
anchor.innerHTML = "Users will be taken to the VideoJS website after 10 seconds!"
anchor.href = "http://www.videojs.com/"
div.appendChild(anchor)
setTimeout(function(){
    callback(div);
}, 0);
}

var video = videojs('video_example_1');
video.endcard({
getRelatedContent: getRelatedContent,
//  getNextVid: getNextVid    //uncomment this for auto-playing video
})
</script>

//同步还是异步,由你决定。
函数getRelatedContent(回调){
var div=document.createElement('div');
var p=document.createElement('p');
p、 innerHTML=“太酷了,你必须点击这个!”;
儿童组(p);
setTimeout(函数(){
//需要一个数组
回调([div]);
}, 0);
}
函数getNextVid(回调){
var div=document.createElement('div');
var anchor=document.createElement('a');
anchor.innerHTML=“用户将在10秒后被带到VideoJS网站!”
anchor.href=”http://www.videojs.com/"
子类(锚定)
setTimeout(函数(){
回调(div);
}, 0);
}
var video=videojs('video_示例_1');
视频终端卡({
getRelatedContent:getRelatedContent,
//getNextVid:getNextVid//取消注释此项以自动播放视频
})

在DOM成功加载后,尝试在主体上使用
onload
处理程序执行整个代码:

[...]
<body onload="myOnLoadHandlerHere">...</body>
[...]
您的视频标签似乎也有id=“example\u video\u 1”,但在您的js代码中,您试图在下面的行中引用id:video\u example\u 1

var video = videojs('video_example_1');
video.endcard({
getRelatedContent: getRelatedContent,
//  getNextVid: getNextVid    //uncomment this for auto-playing video
})
替换为:

var video = videojs('video_example_1');
video.endcard({
getRelatedContent: getRelatedContent
})
var video = videojs('video_example_1');
video.endcard({
getRelatedContent: getRelatedContent
})