云端学习网页自动播放编码

云端学习网页自动播放编码

2023年6月22日发(作者:)

var time = 30 * 1000,testNextTimer,nowindex, nowobj, findNexttimer, thisTid,treeobjarr;

/**

* 查找是否有下一页

*/

function testNext() {

// 检验当前课件是否已播放完成,已播放完成,下一课件可播放;未播放完成,下一课件不可播放

var isLearnedFlag = false;

var url = contextPath + "/web/player!?" +

"curCourseId=" + getCurCourseId(chapterId) + "&chapterIds=" + chapterId + "&chapterWareId=" + wareId;

myLandAjaxJson(url, "", function (code, ajaxPara) {

var temp = eval("(" + ajaxPara + ")");

if ( == "00") {

isLearnedFlag = true;

} else if ( == "11") {

isLearnedFlag = false;

mylandAlert("信息提示", e);

}

});

if (isLearnedFlag) {

chapterWareId = nxtNode;

chapterId = nxtChapterId;

firstWareMark = 1;

curCourseId = getCurCourseId(chapterId);

selectingNode = eByParam("id", chapterId, null);

player_mp4(chapterId, curCourseId);

}

$(".aui_buttons button").click();

("testNext")

}

/**

* 查找当前播放节点

*/

function findnow() {

thisTid = ectedNodes()[0].tId;

("thisTid:", thisTid)

for (var i = 0; i < ; i++) {

var treenode = treeobjarr[i]

if (thisTid == ) {

nowindex = i;

("nowindex:", nowindex)

break;

} }

}

/**

* 查找下一个可以播放的节点

*/

function findNext() {

("findNext")

for (var i = nowindex + 1; i < ; i++) {

var treenode = treeobjarr[i]

if (_Child_State == -1) {

nowindex = i;

nowobj = treenode;

("nextindex:", nowindex)

("nextobj:", nowobj)

break;

}

}

}

/**

* 播放下一节点

* @param e undefined

* @param treeId undefined

* @param treeNode 下一章节节点

*/

function selectNext(e, treeId, treeNode) {

chapterWareId = "";

var lastAvalibleNode = ectedNodes()[0];

if (nt) {

Node(treeNode);

} else {

if (new Date().getTime() - clickTime < 3000) {

return;

}

clickTime = new Date().getTime(); // 记录当前时间

var isLearnedFlag = false;

var url = contextPath + "/web/player!?" +

"curCourseId=" + Id + "&chapterIds=" + ;

myLandAjaxJson(url, "", function (code, ajaxPara) {

var temp = eval("(" + ajaxPara + ")");

if ( == "00") {

isLearnedFlag = true;

} else if ( == "11") { isLearnedFlag = false;

mylandAlert("信息提示", e);

} else { // 02提示未登录或session失效

isLearnedFlag = false;

mylandConfirmByFunc("信息提示", e, function () {

= thirdWebSite;

return true;

}, null, "确定", null);

return;

}

});

if (isLearnedFlag) {

player_mp4(, Id);

Node(treeNode)

} else {

if (lastAvalibleNode != null) {

Node(lastAvalibleNode);

}

}

}

}

/**

* 翻章节

* @param nowobj 当前将要翻页的对象

*/

function testfanye(nowobj) {

(nowobj)

selectNext(undefined, undefined, nowobj);

$(".aui_buttons button").click();

if (thisTid != ectedNodes()[0].tId) {

("yi jing fan ye")

thisTid = ectedNodes()[0].tId;

("thisTid:", thisTid)

findNext();

} else {

("pre and next tid is same")

}

}

// 开始逻辑

testNextTimer = setInterval(testNext, time);

treeobjarr = ormToArray(es())

findnow(); findNext();

findNexttimer = setInterval(function () {

testfanye(nowobj)

}, time);

// 关闭逻辑

//关闭自动下页

clearInterval(testNextTimer)

//关闭翻章节

发布者:admin,转转请注明出处:http://www.yc00.com/xiaochengxu/1687384917a6089.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信