1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193
| vpn_eval((function(){
$(".video_lists").animate({scrollTop: $(".video_red1").offset().top - 162}, 1000);
var loop_flag = ""; var timer = ""; var flag = false; var video = document.getElementById("video");
function current_time() { timer = setInterval(function () { $.ajax({ type: "POST", cache: false, dataType: "json", url: "/ybdy/lesson/current_time", data: { rid: "18612", time: video.currentTime, _xsrf: $(":input[name='_xsrf']").val() }, success: function (data) { if (Number(data.code) == 0) { player.pause(); var msg = "系统监测到您有异常学习行为,本视频观看无效,请您重新进行该视频内容学习。" public_alert(1, ["我知道了"], '<i class="iconfont"></i><p>' + msg + '</p><p></p>', 'public_cont1', function () { window.location.reload() }); } } }); }, 30000); }
var hlsSupported = Hls.isSupported(); if (hlsSupported) { try { var isP2PSupported = p2pml.core.HybridLoader.isSupported(); } catch (err) { window.location.href = "/static/browser_error.html?v=b57810c40053fbcd20af772b6b6c48b62499dd0ba8bf87bf775a937ad28d427fd99b65bec35bef2368fd1d5dcdbc7c8ed4478c72bbb8d4e35d58eab0fd40fab7"; }
var engine = isP2PSupported ? new p2pml.hlsjs.Engine() : undefined;
var player = new Plyr(video, { captions: { active: true, update: true }, controls: ['play-large', 'play', 'current-time', 'mute', 'volume', 'fullscreen'], seekTime: 0 });
var hls = new Hls({ liveSyncDurationCount: 7, loader: isP2PSupported ? engine.createLoaderClass() : Hls.DefaultConfig.loader });
if (isP2PSupported) { p2pml.hlsjs.initHlsJsPlayer(hls); }
var videoSrc = '/m3u8/b451260fbb0f72b2e643308e6a6ac95c/b451260fbb0f72b2e643308e6a6ac95c.m3u8'; hls.loadSource(videoSrc); hls.attachMedia(video);
layui.use("layer", function () { var layer = layui.layer;
layer.load(2, {shade: [0.5, 'grey']});
player.on('loadedmetadata', function (event) { layer.closeAll('loading');
if ("" != "") { var r_time = parseInt();
hour = 0, minute = 0, second = 0; hour = Math.floor(r_time / 60 / 60) < 10 ? '0' + Math.floor(r_time / 60 / 60) : Math.floor(r_time / 60 / 60); minute = Math.floor(r_time / 60 % 60) < 10 ? '0' + Math.floor(r_time / 60 % 60) : Math.floor(r_time / 60 % 60); second = Math.floor(r_time % 60) < 10 ? '0' + Math.floor(r_time % 60) : Math.floor(r_time % 60); last_time = hour + ":" + minute + ":" + second;
public_alert(2, ["从头开始", "继续观看"], '<p class="i_player">同学你好!该课程视频你上次观看到:' + last_time + '<br/><br/></p><p></p><p></p>', 'public_cont1', function () { $(".public_close").click(); player.play(); }, function () { $(".public_close").click();
player.forward(parseInt()); player.play(); }); } else { public_alert(1, ["我知道了"], '<i class="iconfont"></i><p>您需要完整观看一遍课程视频,才能获取本课学时,看到视频播放完毕提示框即为完成,然后视频可以拖动播放。</p><p></p>', 'public_cont1', function () { $(".public_close").click(); player.play(); }); } }); }); } else { window.location.href = "/static/browser_error.html?v=b57810c40053fbcd20af772b6b6c48b62499dd0ba8bf87bf775a937ad28d427fd99b65bec35bef2368fd1d5dcdbc7c8ed4478c72bbb8d4e35d58eab0fd40fab7"; }
player.on('ended', function (event) { clearInterval(timer);
$.ajax({ type: "POST", cache: false, dataType: "json", url: "/ybdy/lesson/resource_record", data: { rid: "815724", resource_id: "18612", video_id: "6782", lesson_id: "587", _xsrf: $(":input[name='_xsrf']").val() }, success: function (data) { window.clearInterval(loop_flag); window.clearInterval(flag);
if (Number(data.code) == 1) { public_alert(1, ["我知道了"], '<i class="iconfont"></i><p>当前视频播放完毕!</p><p></p>', 'public_cont1', function () { window.location.reload() }); $(".public_cont").css("left", "40%"); $('.plyr__controls').show(); } else if (Number(data.code) == -1) { var msg = "系统监测到您有异常学习行为,本视频观看无效,请您重新进行该视频内容学习。" public_alert(1, ["我知道了"], '<i class="iconfont"></i><p>' + msg + '</p><p></p>', 'public_cont1', function () { window.location.reload() }); } } }); });
player.on('play', function (event) { current_time(); loop_flag = setTimeout("loop_pause()", 300000); });
player.on('pause', function (event) { window.clearTimeout(flag); clearInterval(timer); });
player.on('ratechange', function (event) { if (player.media.playbackRate != 1) { player.media.playbackRate = 1; } });
document.oncontextmenu = new Function("return false;"); document.onkeydown = document.onkeyup = document.onkeypress = function (event) { var e = event || window.event || arguments.callee.caller.arguments[0]; if (e && e.keyCode == 123) { e.returnValue = false; return (false); } }
function loop_pause() { player.pause();
public_alert(1, ["继续"], '<i class="iconfont"></i><p>视频已暂停,点击按钮后继续学习!</p><p></p>', 'public_cont1', function () { $(".public_close").click(); player.play(); }); };
document.addEventListener('visibilitychange', function () { if (document.visibilityState == 'hidden') { player.pause() } else { player.on('loadedmetadata', function (event) { player.play() }) } });
} ).toString().slice(12, -2),"");
|