【问题标题】:Brightcove video player events for ReactReact 的 Brightcove 视频播放器事件
【发布时间】:2020-12-24 00:53:03
【问题描述】:

需要:我想获得 onComplete 事件(就像这里的答案:How to detect the end of a BrightCove Video?)但无法将它连接到反应版本 - 答案中的文档链接也返回一个404

MVCE

【问题讨论】:

    标签: javascript reactjs video brightcove


    【解决方案1】:

    这是我如何工作的;

    • 建议在 stackoverflow 上不再有 onComplete(甚至是 onEndedonFinsihed)事件,例如 this answer
    • 我们必须在onSuccess函数内工作
    • 这些链接有帮助:

     - https://player.support.brightcove.com/publish/brightcove-player-loader.html#Available_parameters

     - 完整的事件列表:https://docs.brightcove.com/brightcove-player/1.x/Player.html

    相关JS

    onSuccess: function(success) {
          var myPlayer = success.ref;
          myPlayer.on('ended',function(){
             console.log('video ended...');
          });
        },
    

    完成working codepen here

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-12-14
      • 1970-01-01
      • 2012-09-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多