您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Automatically play videos in order
// ==UserScript== // @name 优科学堂& 南昌大学科学技术学院继续教育平台自动刷课时脚本//该脚本能实现自动播放下一个视频 // @namespace http://tampermonkey.net/ // @version 0.1 // @description Automatically play videos in order // @author You // @match https://ndky.youkexuetang.cn/student/#/courseList/courseList/course?id=7860 // @grant none // @license 3.0 // ==/UserScript== (function() { 'use strict'; var currentVideoIndex = 0; var videos = []; var observer = new MutationObserver(function(mutations) { mutations.forEach(function(mutation) { if (mutation.type === 'childList') { videos = document.getElementsByTagName('video'); if (currentVideoIndex < videos.length) { var video = videos[currentVideoIndex]; if (video.readyState === 4) { // the video is ready video.play(); setEndEventListener(video); } else { // wait until the video is ready video.oncanplaythrough = function() { this.play(); setEndEventListener(this); } } } } }); }); observer.observe(document, { childList: true, subtree: true }); function setEndEventListener(video) { video.onended = function() { currentVideoIndex++; if (currentVideoIndex < videos.length) { var nextVideo = videos[currentVideoIndex]; if (nextVideo.readyState === 4) { // the video is ready nextVideo.play(); setEndEventListener(nextVideo); } else { // wait until the video is ready nextVideo.oncanplaythrough = function() { this.play(); setEndEventListener(this); } } } } } })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址