【问题标题】:Load a new video by id into a Brightcove Player loaded via Brightcove Player Loader通过 id 将新视频加载到通过 Brightcove Player Loader 加载的 Brightcove Player
【发布时间】:2021-07-19 15:15:14
【问题描述】:

我已经使用 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
});

【问题讨论】:

    标签: brightcove


    【解决方案1】:

    使用常规的player catalog methodssuccess 中返回的播放器。

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-03-24
      • 1970-01-01
      • 1970-01-01
      • 2014-08-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多