brightcove - 通过 id 将新视频加载到通过 Brightcove Player Loader 加载的 Brightcove 播放器中
问题描述
我已经使用 Brightcove Player Loader 在我的页面上加载了 Brightcove 视频播放器:
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);
});
推荐阅读
- matlab - 为什么我在 Matlab 中第二次调用 *.mexw64 时会得到不同的结果?
- laravel - 如何为 Twilio 视频会议创建访问令牌
- python - 无法将数据框插入雪花数据库表
- apostrophe-cms - 撇号 cms 数据检索块的连接与另一块的连接
- php - 我遇到了这个问题(htmlspecialchars)
- python - 使用 Python 在 Selenium WebDriver 中按 Escape 不起作用
- python - 融化熊猫中的多索引数据框
- r - 用 gt 中的条件信息为单元格着色
- php - 如何使用 phpunit 对 if 语句执行断言
- node.js - 我需要在Angular的每个pdf页面中添加一些设计的页脚