找到的油猴脚本是https://greasyfork.org/zh-CN/scripts/452791-%E6%B5%99%E6%B1%9F%E5%B8%88%E8%8C%83%E5%A4%A7%E5%AD%A6-%E7%BD%91%E7%BB%9C%E7%BB%A7%E7%BB%AD%E6%95%99%E8%82%B2%E5%AD%A6%E9%99%A2-%E8%A7%86%E9%A2%91%E8%BF%9E%E6%92%AD
是2022年编写的,发现网址都已经换过了,作者不再更新了,求大佬帮忙改写,另外这一类的脚本是啥语句,自学起来难吗?
学习平台 (uteacher.net)https://www.uteacher.net/Project ... brw4liz&ptype=1
//视频初始化 //aly var player_aly = null; function onAlyH5PlayerLoaded() { $('#divplayer').hide(); $('#player_aly').show(); player_aly = new Aliplayer({ "id": 'player_aly', //支持播放地址播放,此播放优先级最高 //播放方式二:点播用户推荐 "vid": vm.play_id, "playauth": vm.PlayAuth, "width": "900px", "height": "500px", "autoplay": false,//播放器是否自动播放,在移动端autoplay属性会失效 "isLive": false,//是否直播 "rePlay": false,//自动循环播放 "playsinline": true,//H5是否内置播放,有的Android浏览器不起作用 "preload": true,//播放器自动加载,目前仅h5可用 "controlBarVisibility": "hover",//控制面板的实现 可选的值为:‘click’、‘hover’、‘always’ "useH5Prism": true, //指定使用H5播放器 "skinLayout": [ //皮肤 { "name": "bigPlayButton", "align": "blabs", "x": 30, "y": 80 }, { "name": "H5Loading", "align": "cc" }, { "name": "errorDisplay", "align": "tlabs", "x": 0, "y": 0 }, { "name": "infoDisplay" }, { "name": "tooltip", "align": "blabs", "x": 0, "y": 56 }, { "name": "thumbnail" }, { "name": "controlBar", "align": "blabs", "x": 0, "y": 0, "children": [ { "name": "progress", "align": "blabs", "x": 0, "y": 44 }, { "name": "playButton", "align": "tl", "x": 15, "y": 12 }, { "name": "timeDisplay", "align": "tl", "x": 10, "y": 7 }, { "name": "fullScreenButton", "align": "tr", "x": 10, "y": 12 }, { "name": "subtitle", "align": "tr", "x": 15, "y": 12 }, { "name": "volume", "align": "tr", "x": 5, "y": 10 } ] } ] }, function (player_aly) { console.log("播放器创建了."); }); //aly初始化 player_aly.on('ready', function () { }); //aly播放回调事件 player_aly.on("play", function () { console.log('_start'); if (vm.gk_state == 0) videoplayer(); }); //aly暂停回调事件 player_aly.on("pause", function () { console.log('_pause'); if (vm.gk_state == 0) end_timing(); }); //aly播放结束回调事件 player_aly.on("ended", function () { //console.log('_ended');结束了也会触发暂停 //if (vm.gk_state == 0) // end_timing(); }); } //初始化cc function on_CCH5player_ready() { console.log('CCplayer_ready'); close_popup_load();//load防止加载未关闭 } //cc播放回调事件 function on_CCH5player_play() { console.log('CCplayer_start'); //学习未完成 if (vm.gk_state == 0) videoplayer(); } //cc暂停回调事件 function on_CCH5player_pause() { console.log('CCplayer_pause'); //学习未完成 if (vm.gk_state == 0) end_timing(); } //cc播放结束回调事件 function on_CCH5player_ended() { console.log('CCplayer_ended'); //end_timing(); 结束了也会触发暂停 } var player_cc = null; /** 播放器js文件加载完成的回调--播放器初始化 **/ function onCCH5PlayerLoaded() { //使用播放器提供的window下的createCCH5Player方法创建播放器 $('#divplayer').show(); try { player_cc = createCCH5Player({ 'vid': vm.play_id, 'siteid': '435D54363B37C983', 'width': '100%', 'height': '500', 'autoStart': 'false', 'mediatype': 1, 'isShare': 'false', 'banDrag': 'false', 'rate_allow_change': 'false', 'parentNode': document.getElementById('divplayer'), 'playtype': 1, 'newversion': 'true' }); } catch (err) { console.log(err); } }; //播放 function Play() { if (v_source == 'aly') player_aly.play(); else player_cc.play(); } //暂停 function Pause() { if (v_source == 'aly') player_aly.pause(); else player_cc.pause(); } //获取当前播放位置 function GetPlayTime() { if (v_source == 'aly') { if (player_aly != null) return player_aly.getCurrentTime(); else return 0; } else { if (player_cc != null) return player_cc.getPosition(); else return 0; } } //设置播放位置 function SetPlayTime(time) { if (v_source == 'aly') player_aly.seek(time); else player_cc.jumpToTime(time); }