我可以播放获取警报以进行工作myTemplateLoaded
并让第一个视频开始工作,但之后它不会进入下一个视频......请有更多经验的人加入吗?我将不胜感激!
<!-- Start of Brightcove Player -->
<div style="display:none"> </div>
<script language="JavaScript" type="text/javascript" src="http://admin.brightcove.com/js/BrightcoveExperiences.js"></script>
<object id="myExperience1116920512001" class="BrightcoveExperience" >
<param name="bgcolor" value="#FFFFFF" />
<param name="width" value="480" />
<param name="height" value="270" />
<param name="playerID" value="1186083953001" />
<param name="playerKey" value="AQ~~,AAAAwFCyREk~,R6fcmQA_ySLOTNBFvZ0mjvLcTW-_NNbL" />
<param name="isVid" value="true" />
<param name="isUI" value="true" />
<param name="dynamicStreaming" value="true" />
<param name="@videoPlayer" value="ref:spring" />
<param name="includeAPI" value="true" />
<param name="templateLoadHandler" value="myTemplateLoaded" />
</object>
<!-- End of Brightcove Player -->
<script type="text/javascript">
var player;
var modVP;
var modExp;
var modCon;
var previousVideoID=0;
var nextVideo=0;
var videos=new Array(1772963843001,1765076426001,17490792490011);
function myTemplateLoaded(experienceID) {
// alert(experienceID);
player = brightcove.api.getExperience(experienceID);
modVP = player.getModule(brightcove.api.modules.APIModules.VIDEO_PLAYER);
modExp = player.getModule(brightcove.api.modules.APIModules.EXPERIENCE);
modCon = player.getModule(brightcove.api.modules.APIModules.CONTENT);
modVP.loadVideoByID(videos[nextVideo]);
modExp.addEventListener(brightcove.api.events.ExperienceEvent.TEMPLATE_READY, onTemplateReady);
}
function onTemplateReady(evt) {
modVP.addEventListener(brightcove.api.events.MediaEvent.COMPLETE, onMediaComplete);
modVP.addEventListener(brightcove.api.events.MediaEvent.CHANGE, onMediaChange);
}
function onMediaComplete() {
nextVideo++;
if (nextVideo==videos.length) {
nextVideo=0;
}
modVP.loadVideoByID(videos[nextVideo]);
}
function getCurrentVideoCallback(currentVideo) {
document.getElementById("currentVideoInfo").innerHTML = "Video named '" + currentVideo.displayName + "' loaded. Video ID: " + currentVideo.id;
}
function onMediaChange(evt) {
document.getElementById("mediaInfo").innerHTML = "NOW PLAYING: " + evt.media.displayName;
}
</script>