公需课怎么跳过
function Click(){
window.event.returnValue=false;
}
document.oncontextmenu=Click;
$(function(){
// $("#video").blur(function(){
// video.pause();
// });
//
var on=1;
$(".sm-t video").css('height',$(window).height()*0.43)
$(window).resize(function (argument) {
if (on==1) {
$('.sm-b').css('top',$('.sm-t').innerHeight()+70+"px")
}else{
$('.sm-b').css('top',$('.bg-r').innerHeight()+70+"px")
}
})
if (on==1) {
setTimeout(function (argument) {
$('.sm-b').css('top',$('.sm-t').innerHeight()+70+"px")
//console.log($('.sm-t').innerHeight())
},1000)
}else{
setTimeout(function (argument) {
$('.sm-b').css('top',$('.bg-r').innerHeight()+70+"px")
},1000)
}
var picTimer=null;
$("#wrap .sm-t p a").click(function(){
if (on==1) {
$(this).find("b").removeClass("ball ball2");
$(this).find("b").addClass("ball");
$(".sm-t").removeClass("animation-l animation-r")
$(".sm-t").addClass("animation-l")
$(".bg-r").removeClass("animation-r3 animation-r4")
$(".bg-r").addClass("animation-r3")
$(".sm-t video").css('height',$(window).height()*0.8)
setTimeout(function (argument) {
$('.sm-b').css('top',$('.bg-r').innerHeight()+70+"px")
},2300)
on=2
}else if (on==2) {
$(this).find("b").removeClass("ball ball2");
$(this).find("b").addClass("ball2");
$(".sm-t").removeClass("animation-l animation-r")
$(".sm-t").addClass("animation-r")
$(".bg-r").removeClass("animation-r3 animation-r4")
$(".bg-r").addClass("animation-r4")
$(".sm-t video").css('height',$(window).height()*0.43)
setTimeout(function (argument) {
$('.sm-b').css('top',$('.sm-t').innerHeight()+70+"px")
},2300)
on=1
}
})
$(".bg-r").mouseover(function (argument) {
if (picTimer) {
clearInterval(picTimer);
picTimer=null;
}
});
$(".pptOpt .l").click(function(){
var num = $(".bg-r ul>li").size();
var a=0;
$(".bg-r ul li").each(function(i){
if ($(this).hasClass("active")) {
a=i;
return;
}
})
var b=0
if (a==0) {
b=num-1
}else{
b=a-1
}
$(".bg-r ul li").eq(a).removeClass("active");
$(".bg-r ul li").eq(b).addClass("active");
})
$(".pptOpt .r").click(function(){
var num = $(".bg-r ul>li").size();
var a=0;
$(".bg-r ul li").each(function(i){
if ($(this).hasClass("active")) {
a=i;
return;
}
})
var b=0;
if (a==num-1) {
b=0
}else{
b=a+1
}
$(".bg-r ul li").eq(a).removeClass("active");
$(".bg-r ul li").eq(b).addClass("active");
})
// 控制获取播放进度
var sym;
var timer=null
var v = document.getElementById("video");
var course_status = 0;//学习状态
$(window).blur(function(){
//your code here
v.pause();
$('#bofang').text('播放');
});
// $(window).focus(function(){
// //your code here
// console.log('window fouse');
// })
if(course_status == 0){
// 此处控制用户不能拖放进度条
setInterval(function () {
var time=video.currentTime
if(Math.abs(time-sym)>1){
video.currentTime=sym
}
sym=video.currentTime
},500);
}
//页面进来加载ajax
// ajax
//操作ajax 如 返回data=10 (秒)
if(course_status == 1){
v.currentTime=0; //观看完毕 设置为0秒
}else{
v.currentTime=30; //设置为10秒
}
v.paused = true; //进来暂停
//点击播放
v.addEventListener('play',function () {
var duration = parseInt(v.duration);
if (!timer) {
timer = setInterval(function (argument) {
//3秒一次ajax 操作
//timeDisplay 为获取的当前秒数 (毫秒,1.2222 S,转化用parsenInt(timeDisplay))
var timeDisplay;
timeDisplay = parseInt(v.currentTime);
var total = parseInt(duration / 60);
var yushu = duration % 60;
if(yushu < 10){
yushu = "0"+yushu;
}
if(timeDisplay < 60){
var second = timeDisplay;
}else{
var yushu1 = timeDisplay % 60 +1;
if(yushu1 < 10){
yushu1 = "0"+yushu1;
}
var second = parseInt(timeDisplay / 60)+":"+yushu1;
}
$('#times').val(second+' / '+total+':'+yushu);
//console.log('a'+timeDisplay);
//正常计时
if(timeDisplay > 0 && timeDisplay % 15 == 0){
reckon_by_time(timeDisplay,1,duration);
}
$(".bg-r ul li").each(function(i){
var data_time = $(this).attr('data-time');
if(data_time == timeDisplay){
$(".bg-r ul li").removeClass("active");
$("#thumb_duration"+data_time).addClass("active");
}
});
},1000);
}
//监听结束
var i = window.setInterval(function () {
if(v.ended){
clearInterval(i);
if (timer) {
clearInterval(timer)
timer=null
}
//结束后进行ajax
//console.log('b'+v.duration) //v.duration 返回视频完整时长 如要整数(parseInt(v.duration))
reckon_by_time(v.duration,2,v.duration);
return false;
}
}, 20)
},false);
//暂停
v.addEventListener('pause',function (argument) {
if (timer) {
clearInterval(timer)
timer=null
}
// 暂停进ajax操作
//timeDisplay 为获取的当前秒数
var timeDisplay;
//用秒数来显示当前播放进度
timeDisplay = v.currentTime;
//console.log('c'+timeDisplay)
//reckon_by_time(timeDisplay,3,v.duration);
})
});
function playPause(obj) {
var mv = document.getElementById("video");
if(mv.paused){
$(obj).text('暂停');
mv.play();
}else{
$(obj).text('播放');
mv.pause();
}
}
function reckon_by_time(currentTime,type,duration){
var course_status = 0;//学习状态
if(course_status == 1){
return false;
}
var course_id = 1598;
var list_id = 87;
var study_code = "xagchgbbywngghcguugmxbuerqndnmol1661394536";
$.ajax({
url:"/home/User/reckon_by_time.html",
type:'post',
data:{currentTime:parseInt(currentTime),duration:duration,type:type,course_id:course_id,list_id:list_id,study_code:study_code},
dataType:'JSON',
success:function(res){
if(res.code == -1){
alert(res.msg);
v.pause();
}
if(res.question_id > 0){
$('.layui-layer').show();
$('.layui-layer-btn0').attr('href',"/home/User/exam/id/"+res.question_id);
}
},
error:function (data) {
//alert('网络错误!');
}
});
}
/*v.addEventListener("timeupdate",function() {
// 实时监测
var timeDisplay;
//用秒数来显示当前播放进度
timeDisplay = v.currentTime;
},false)
*/
这段是我从视频网页复制下来的 代码快进也不能超过2倍 function skip() {
let video = document.getElementsByTagName('video')
for (let i=0; i<video.length; i++) {
video.currentTime = video.duration
}
}
setInterval(skip,200)
这段代码有时有效有时有无效 不明呀,多谢 a2s1ok 发表于 2022-8-25 11:20
function skip() {
let video = document.getElementsByTagName('video')
for (let i=0; i
哪个网站? 这个是啥 重庆人社培训网——重庆公需科目
https://www.cqrspx.cn/
http://uat1.cqrspx.cn/portal/login?noticeStyle=2 你这个是哪个省的 没看懂 谢谢分享
页:
[1]