超星网课视频秒过

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

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 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){

//    };
})();