Greasy Fork

Greasy Fork is available in English.

超星网课视频秒过

本脚本用于超星学习通视频快速学习。

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         超星网课视频秒过
// @namespace    http://tampermonkey.net/
// @
// @version      0.2.1
// @description  本脚本用于超星学习通视频快速学习。
// @author       Master-cai
// @match        https://mooc1-1.chaoxing.com/mycourse/studentstudy*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // Your code here...
    var rate = 1; //默认播放速度 在此修改
    var Mute = false;
    $(".tabtags").append(`<form><p style="font-size:125%; display:inline">播放速率: </p><input id="rateInput" type="text" value=${rate} name="textName" style="border: 1px solid; display:inline;" size="1"> <p style="color:red; display:inline;font-size:125%;">(最高16倍)</p> </form>`);
    $(".tabtags").append('<div><button class="button1" style="display:inline">调整速率</button> </div>');
    // $(".tabtags").append(`<div>当前播放速率: ${rate} </div>`);

    $(".button1").on('click', function() {
        rate = document.getElementById("rateInput").value;
        window.addEventListener('mouseout', function (event) {
            event.stopPropagation();
        }, true);
        document.querySelector('iframe').contentDocument.querySelector('iframe').contentDocument.querySelector('video').playbackRate=rate;
        var doc=$("#iframe").contents().find('iframe').contents();
        if(doc.find('.vjs-play-control').eq(0).text()=="播放")setTimeout("var doc=$('#iframe').contents().find('iframe').contents();doc.find('.vjs-play-control').eq(0).click();",100);

         if(doc.find('.vjs-vol-3').eq(0)!=null)doc.find('.vjs-vol-3').eq(0).click();


        var interval = setInterval(function(){
            var l = document.querySelector('iframe').contentDocument.querySelector('iframe').contentDocument.querySelectorAll("[name='ans-videoquiz-opt']");
            if (l.length != 0){
                if(l[0].value==="true"){
                    l[0].checked=true;
                }
                else{
                    l[1].checked=true;
                };
                document.querySelector('iframe').contentDocument.querySelector('iframe').contentDocument.querySelectorAll("[class='ans-videoquiz-submit']")[0].click();
                clearInterval(interval);
            };
            return;
        }, 3000);
     })

//    document.onclick=function(event){

//    };
})();