Greasy Fork

Greasy Fork is available in English.

Siki Video Playrate

siki学院视频,播放速度保持上一次选择

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Siki Video Playrate
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  siki学院视频,播放速度保持上一次选择
// @author       Jeffssss
// @match        *://service-cdn.qiqiuyun.net/js-sdk/video-player/*/player.html
// @icon         https://www.google.com/s2/favicons?sz=64&domain=sikiedu.com
// @grant        unsafeWindow
// @grant        GM_log
// @grant        GM_setValue
// @grant        GM_getValue
// @license MIT
// ==/UserScript==

(function() {
    'use strict';
    window.onload=function(){
        var vid = window.document.querySelector("video");
        vid.addEventListener('ratechange',function() {
            unsafeWindow.console.log ("播放速率修改");
            unsafeWindow.console.log (window.document.querySelector("video").playbackRate);
            GM_setValue('siki_video_rate', window.document.querySelector("video").playbackRate);
            unsafeWindow.console.log ("存储的速率" + GM_getValue('siki_video_rate', 2));
        });
        vid.addEventListener('play',function() {
            unsafeWindow.console.log ("开始播放了");
            unsafeWindow.console.log (window.document.querySelector("video").playbackRate);
            window.document.querySelector("video").playbackRate = GM_getValue('siki_video_rate', 2);
            unsafeWindow.console.log (window.document.querySelector("video").playbackRate);
        });
    }
})();