通过id将新视频加载到通过Brightcove Player Loader加载的Brightcov Player中



我已经在我的页面上用Brightcove player Loader:加载了Brightcov视频播放器

brightcovePlayerLoader({
refNode: document.querySelector('#mainvid'),
accountId: myaccountId, //this is a variable with global scope
playerId: '947WeZ6d',
videoId: mainvidID
})
.then(function(success) {
myPlayer = success.ref;
console.log('success', success);
myPlayer.on('loadedmetadata',function(){
//myPlayer.muted(true);
//myPlayer.play();
});
})
.catch(function(error) {
console.log('error', error);
}); 

当用户单击图像时,我想读取图像的ID,并将其用作myPlayer的新VideoID。但我该怎么做呢?

$('.vid-thumbnail').on('click', function() {
myPlayer.videoId = maidvidID; //doesn't work
});

success中返回的播放器使用常规播放器目录方法。

myPlayer.catalog.getVideo('12345', function(error, video){
myPlayer.catalog.load(video);
});

相关内容

  • 没有找到相关文章