我最初在视频标签中加载了一个介绍视频,然后使用vidSwap功能将其替换为其他视频。出于某种原因,下面的代码只是重新加载介绍视频。谁能看到我在这里做错了什么?
<div style="width:944px; height:402px; margin-left:8px; margin-top:8px">
<div style="width:223px; height:402px; float:left;">
<div id="menu" style="height:400px;">
<a href="#" onClick="javascript:vidSwap('video/video-1.mp4'); return false;">
<div class="button">Button 1</div>
</a>
<a href="#" onClick="javascript:vidSwap('video/video-2.mp4'); return false;">
<div class="button">Button 2</div>
</a>
<a href="#" onClick="javascript:vidSwap('video/video-3.mp4'); return false;">
<div class="button">Button 3</div>
</a>
</div>
</div>
<div id="video-panel" style="width:711px; height:400px; float:left; margin-left:10px; position:relative; background-color:#000">
<section>
<video id="video" class="video-js vjs-default-skin" controls autoplay preload="auto" width="711" height="400">
<source src="video/intro.mp4" type='video/mp4'>
</video>
<script>
var myPlayer = _V_("video");
function vidSwap(vidURL) {
myPlayer.src = vidURL;
myPlayer.load();
myPlayer.play();
}
</script>
</section>
</div>
</div>