慕课学习

国科大慕课学习,鼠标离开界面不会暂停,且不用在视频中答题

当前为 2021-05-28 提交的版本,查看 最新版本

您需要先安装一个扩展,例如 篡改猴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.1
// @description  国科大慕课学习,鼠标离开界面不会暂停,且不用在视频中答题
// @author       You

// @match        http://mooc1.ecourse.ucas.ac.cn/ananas/modules/video/index.html?**
// @icon         https://www.google.com/s2/favicons?domain=ucas.ac.cn
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    var t2 = window.setInterval(function() {

       var eles = document.getElementsByClassName('vjs-big-play-button');
       var btn = eles[0];
       if(btn.hidden == false){
           btn.click();
       }



    },100)

    var tstop = window.setTimeout(function() {

       var stop = document.getElementsByClassName("vjs-play-control vjs-control vjs-button vjs-playing")[0];
       stop.onclick = function(){
            window.clearInterval(t2);
           console.log('stop');
           var start = document.getElementsByClassName("vjs-play-control vjs-control vjs-button vjs-paused")[0];
           start.onclick = function(){
               window.setInterval(t2);
           };
       };
    },1000)


    /*var tv = window.setTimeout(function() {

       var video = document.getElementById("video_html5_api")[0];
       video.onclick = function(){
            window.clearInterval(t2);
           console.log('stop');
           var start = document.getElementsByClassName("vjs-play-control vjs-control vjs-button vjs-paused")[0];
           start.onclick = function(){
               window.setInterval(t2);
           };
       };;
    },1100)

    function stopF(){
        window.clearInterval(t2);
        console.log(1);
        var start = document.getElementsByClassName("vjs-play-control vjs-control vjs-button vjs-paused")[0];
        start.onclick = startF;
    }

    function startF(){
         window.setInterval(t2);
    }
*/




})();