我已经在我的页面上用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);
});