您现在的位置: 首页 > 视频中心

中国公共关系讲坛:从历史到未来的中国公共关系

更新时间:2023-02-15

// if (window.jQuery) { // $('#video_play_20200520_136').bind('contextmenu',function() { return false; }); // } if ('video' == document.getElementById('video_play_20200520_136').tagName.toLowerCase()) { if (!document.getElementById('video_play_20200520_136').controls) { document.getElementById('video_play_20200520_136').controls = 'controls'; } document.getElementById('video_play_20200520_136').setAttribute('controlslist', 'nodownload'); document.getElementById('video_play_20200520_136').setAttribute('oncontextmenu', 'return false'); } /**记录播放时长**/ var video = document.getElementById('video_play_20200520_136'); var timeDisplay; var times = 0; video.addEventListener('pause', function () { //暂停开始执行的函数 submitPlayRecord(); }); video.addEventListener('waiting', function() { if(times == 1){ timeDisplay = this.duration; submitPlayRecord(); } times ++; }, false); // video.addEventListener('canplaythrough', function() { // if(times == 1){ // timeDisplay = this.duration; // submitPlayRecord(); // } // times ++; // }, false); video.addEventListener('ended', function () { //结束 submitPlayRecord(); }, false); //监听播放时间 //使用事件监听方式捕捉事件 video.addEventListener("timeupdate",function(){ //用秒数来显示当前播放进度 timeDisplay = Math.floor(this.currentTime); },false); window.addEventListener('unload', function() { //窗口关闭后 submitPlayRecord(); }); function submitPlayRecord() { if (document.getElementById('fid1616057948')) { var fid = document.getElementById('fid1616057948').value; if (fid > 0) { var ajax = new XMLHttpRequest(); ajax.open("post", "/index.php?m=home&c=Media&a=record_process", true); ajax.setRequestHeader("X-Requested-With","XMLHttpRequest"); ajax.setRequestHeader("Content-type","application/x-www-form-urlencoded"); ajax.send("aid=136&file_id="+fid+"&timeDisplay="+timeDisplay); ajax.onreadystatechange = function () { }; } } } /**记录播放时长**/ // 视频购买 function MediaOrderBuy_1592878548() { var ajax = new XMLHttpRequest(); ajax.open("post", '/index.php?m=user&c=Media&a=media_order_buy', true); ajax.setRequestHeader("X-Requested-With","XMLHttpRequest"); ajax.setRequestHeader("Content-type","application/x-www-form-urlencoded"); ajax.send('aid=136'); ajax.onreadystatechange = function () { if (ajax.readyState==4 && ajax.status==200) { var json = ajax.responseText; var res = JSON.parse(json); if (1 == res.code && res.url) { window.location.href = res.url; } else if (0 == res.code && res.url) { window.location.href = res.url; } else { if (!window.layer) { alert(res.msg); } else { layer.alert(res.msg, {icon: 5, title: false, closeBtn: false}); } }  } }; }

来源:网络

关键词: