index.js 790 B

1234567891011121314151617181920212223242526272829303132333435
  1. // setTimeout(() => {
  2. // console.log('-----unity实例', unityExamples);
  3. // }, 2000);
  4. const videoBox = document.querySelector('.videoBox')
  5. const videoDom = document.querySelector('.videoBox video')
  6. const videoBtnDom = document.querySelector('.skipTxt')
  7. // 自动播放视频
  8. videoDom.play()
  9. // 点击按钮,或者视频播放完毕的回调
  10. const videoPalyEnd = () => {
  11. console.log('-------视频播放完毕,或者点击跳过--------');
  12. document.querySelector('body').removeChild(videoBox)
  13. }
  14. videoDom.addEventListener('ended', function () {
  15. videoPalyEnd()
  16. }, false)
  17. videoBtnDom.onclick = () => {
  18. videoPalyEnd()
  19. }
  20. window.onClickShare = () => {
  21. var a = document.createElement('a')
  22. a.download = 'image'
  23. a.href = '../StreamingAssets/share.png'
  24. a.click()
  25. }