1.问题描述

let modalStr = `
<div class="nextSectionClose">
  <img class="pointer" id="modalSectionClose" title="关闭" src="/static/img/icon_close.png">
</div>
<div class="row1" id="sectionDone">当前小节已学完</div>
<div class="row1 hide" id="courseDone">恭喜你已学完本课程</div>
<div class="row2">
  <span id="buttonPractice">做练习</span>
  <span id="buttonNextChapter">继续学习下一节</span>
  <span class="hide" id="buttonBackToLibrary">返回课程库</span>
</div>
`
let contentEl = document.createElement('div')
contentEl.classList.add('customModal')
contentEl.classList.add('nextChapter')
contentEl.innerHTML = modalStr

var modal = player.createModal(contentEl)

let commentClose = document.getElementById('commentClose')
commentClose.addEventListener('click', function () {
  modal.close()
})
modal.on('modalclose', function () {
  player.play()
})

相关链接:
https://docs.videojs.com/tutorial-modal-dialog.html
https://docs.videojs.com/modaldialog#close

https://github.com/videojs/video.js/issues/4781

作者 铁血 汉子 2019年1月8日
2024/11/23/10:07:02am 2019/1/8/2:50:50
0 4311