如何在 angular 视频完成时集成 video.js 和打开模型 4

How to integrate video.js and open model when video completes in angular 4

我正在使用 video.js 播放视频 我想在 angular 4

视频完成时打开模型

您可以收听 on ended 事件,请参见下面的示例:

videojs(el, {}, function() {
    this.on('ended', function() {
        // Call to open model here
    });
});
   this.player.on('ended', function() {
  const options = {
    content:'<button>Hello World</button>',
    label:'the label',
    uncloseable:true
  };
  const ModalDialog = videojs.getComponent('ModalDialog');
  const modal = new ModalDialog(this, options);
  this.addChild(modal);
  modal.open();
  modal.on('modalclose', function() {
    console.log('model closed');
  });
});

我想在模型中显示按钮