-1

我可以播放获取警报以进行工作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>
4

3 回答 3

0

您还可以在 Brightcove 内部的播放器界面中调整设置。您可以在播放器设置中选择在第一个视频加载完成后开始下一个视频,然后只需输入嵌入代码。

http://support.brightcove.com/en/video-cloud/training-videos/setting-playlists-auto-advance

于 2013-08-08T21:45:58.070 回答
0

您还可以在 Mac 上使用 MAMP 在本地测试您的页面。只需确保将 HTML 文件保存到 MAMP Preferences 的“Apache”选项卡中指定为 Document Root 的文件夹中。您还应该在“端口”选项卡中“设置为默认的 Apache 和 MySQL 端口”。

http://www.mamp.info/en/index.html

于 2013-05-01T14:49:06.993 回答
0

如果从文件系统本地运行,Brightcove API 将无法工作。从 Web 服务器运行代码,就像您在使用 jsfiddle 时所做的那样。

于 2012-08-09T11:43:27.763 回答