import '../style/style'; import '../style/index'; import $ from 'jquery'; import { setTimeout } from 'timers'; $(document).ready(function() { const dataList = window.sessionStorage.getItem('dataList'); if(!dataList) { window.location.href="./login.html"; return false; } const boardUrl = JSON.parse(dataList).shareTask.boardUrl; const desktopUrl = JSON.parse(dataList).shareTask.desktopUrl; const title = JSON.parse(dataList).shareTask.title; const shareJoinUserId = JSON.parse(dataList).shareJoinUser.id; $('.title p').html('主会场:' + title) console.log(boardUrl) console.log(desktopUrl) let bigVideo = new FlvJsPlayer({ "id": "bigVideo", "url": boardUrl, "playsinline": false, "volume": 1, "autoplay": true, "width": "100%", "height": "714", "ignores": ['definition', 'i18n', 'play', 'replay', 'progress', 'start', 'time'], "closeVideoClick": true, "closeVideoTouch": true, "keyShortcut": "off", "cssFullscreen": true }); let smallVideo = new FlvJsPlayer({ "id": "smallVideo", "url": desktopUrl, "playsinline": false, "volume": 0, "autoplay": true, "width": "100%", "height": "714", "ignores": ['definition', 'i18n', 'play', 'replay', 'progress', 'start', 'time'], "closeVideoClick": true, "closeVideoTouch": true, "keyShortcut": "off", "cssFullscreen": true }); bigVideo.on('requestFullscreen',function(){ console.log('1全屏') bigVideo.volume = 1; smallVideo.volume = 0; console.log(bigVideo.volume); }) smallVideo.on('requestFullscreen',function(){ console.log('2全屏') bigVideo.volume = 0; smallVideo.volume = 1; console.log(smallVideo.volume); }) let time = null; // 判断用户是否存在回调 time = setInterval(function () { $.get(`${process.env.BASE_API}sharedWhiteBoard/shareJoin/update`, { shareJoinUserId }, function (res) { if(res.code == 200) { if(res.data.status == 'DEL') { // alert('暂无观看权限'); bigVideo.destroy(); smallVideo.destroy(); $('.title p').hide(); $('.video').css('background', '#ccc'); $('.err').show(); clearTimeout(time); // window.location.href="./login.html"; } } }); },5000) })