优课防止失去焦点

优课支持失去焦点继续播放,播放完成之后弹窗提示

目前为 2017-09-26 提交的版本。查看 最新版本

// ==UserScript==
// @name        优课防止失去焦点
// @qq&wx   1186632641
// @include     *http://www.uooc.net.cn/learn/*
// @version     2.0
// @description 优课支持失去焦点继续播放,播放完成之后弹窗提示
// @grant       none
// @namespace 1186632641
// ==/UserScript==
var className="";
var flag=true;
$(document).ready(function () {
  setInterval(function () {
    var vdeioButton = document.getElementsByClassName("vjs-big-play-button animated fadeIn")[0];
    if(vdeioButton !== undefined)
    {
        vdeioButton.click();
        var currentItem = document.getElementsByClassName("basic ng-scope active")[0].parentNode.parentNode.childNodes[0];
        className = currentItem.attributes.class.value;
        if(className !== "basic uncomplete")
        {
            if(flag) {
                var r=confirm("请点击最新视频");
                if (r === true)
                    flag = false;
                else
                    flag = false;
            }
        }
    }
  }, 2500);
});