12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- // setTimeout(() => {
- // console.log('-----unity实例', unityExamples);
- // }, 2000);
- const videoBox = document.querySelector('.videoBox')
- const videoDom = document.querySelector('.videoBox video')
- const videoBtnDom = document.querySelector('.skipTxt')
- // 自动播放视频
- videoDom.play()
- // 点击按钮,或者视频播放完毕的回调
- const videoPalyEnd = () => {
- console.log('-------视频播放完毕,或者点击跳过--------');
- document.querySelector('body').removeChild(videoBox)
- }
- videoDom.addEventListener('ended', function () {
- videoPalyEnd()
- }, false)
- videoBtnDom.onclick = () => {
- videoPalyEnd()
- }
- // 分享页面
- const shareDom = document.querySelector('.shareBox')
- window.onClickShare = () => {
- // console.log(123456);
- shareDom.style.opacity = '1'
- shareDom.style.pointerEvents = 'auto'
- // var a = document.createElement('a')
- // a.download = 'image'
- // a.href = '../StreamingAssets/share.png'
- // a.click()
- }
- document.querySelector('.shareBtn').onclick = () => {
- shareDom.style.opacity = '0'
- shareDom.style.pointerEvents = 'none'
- }
|