我正在为一个项目实现一个自定义播放器。我首先认为这可能是我所做的一些更改(这些更改很小),但所有播放器在呈现 HTML 版本时似乎都失败了。有没有人有任何启动和运行的经验,这是我第一次与 BrightCove 合作。这是我的代码。播放器位于页面底部的模式中,并且在打开模式后动态抓取参考 ID 以加载视频。
HTML
<script language="JavaScript" type="text/javascript" src="http://admin.brightcove.com/js/BrightcoveExperiences.js"></script>
<object id="myExperience" class="BrightcoveExperience">
<param name="bgcolor" value="0x01000000" />
<param name="width" value="602" />
<param name="height" value="451" />
<param name="playerID" value="2346987014001" />
<param name="playerKey" value="AQ~~,AAAACNNhjOE~,7GG4lXihTUWE4HZdWRznisBnhfUh1o33" />
<param name="isVid" value="true" />
<param name="isUI" value="true" />
<param name="dynamicStreaming" value="true" />
<param name="includeAPI" value="true" />
<param name="forceHTML" value="true" />
<param name="templateLoadHandler" value="onTemplateLoad" />
</object>
<script type="text/javascript">brightcove.createExperiences();
</script>
<script language="JavaScript" type="text/javascript">
var player, modVP, expMod;
function onTemplateLoad(experienceID) {
player = brightcove.api.getExperience(experienceID);
modVP = player.getModule(brightcove.api.modules.APIModules.VIDEO_PLAYER);
}
</script>
JS
var waitForModVp = function () {
if( typeof modVP == 'object' ) {
modVP.loadVideoByReferenceID(newSrc);
$(window).on('resize.size-video', function(){
expMod = player.getModule(brightcove.api.modules.APIModules.EXPERIENCE);
var width = window.innerWidth*0.8,
height = (window.innerWidth*0.8)*0.7491694352;
if (width < 610) {
expMod.setSize(width, height);
$('.fullscreen-interior-video').css({
'width' : width+'px',
'height' : height+'px'
});
}
})
} else {
window.setTimeout( waitForModVp, 250 );
}
}
if ( thisData.templateReference == "brightcovePlayer") {
waitForModVp();
}
任何帮助将不胜感激,谢谢。