Greasy Fork

Greasy Fork is available in English.

视频倍速播放(追剧学习神器)

看视频播太慢,这能忍?直接倍速播放,【食用方法】①调节右上角加速框右侧上下按钮即可调节倍率 ②在右上角的加速框内输入加速倍率,如2、4、8、16等。

当前为 2021-06-26 提交的版本,查看 最新版本

您需要先安装一个扩展,例如 篡改猴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/
// @icon         https://img-blog.csdnimg.cn/20181221195058594.gif
// @version      1.0.5
// @description  看视频播太慢,这能忍?直接倍速播放,【食用方法】①调节右上角加速框右侧上下按钮即可调节倍率 ②在右上角的加速框内输入加速倍率,如2、4、8、16等。
// @author       wll
// @require      https://cdn.bootcdn.net/ajax/libs/jquery/2.2.0/jquery.js
// @match        *://ke.qq.com/webcourse/index.html
// @match        *://www.bilibili.com/*
// @match        *://www.iqiyi.com/*
// @match        *://ehuixue.cn/index/study/*
// @match        *://*.ehuixue.cn/index/study/*
// @match        *://*.chaoxing.com/*
// @match        *://*.douyin.com/*
// @match        *://*.pan.baidu.com/*
// @match        *://*.youku.com/*
// @note         增加支持网站:	依照规则增加@match所在标签即可
// @note         郑重声明:	本脚本只做学习交流使用,未经作者允许,禁止转载,不得使用与非法用途,一经发现,追责到底
// @note         授权联系:	[email protected]
// @note         版本更新	20-12-26 1.0.0	初版发布视频倍速播放
// @note         版本更新	21-02-04 1.0.1 	优化用户体验
// @note         版本更新	21-02-04 1.0.2 	优化标题,优化简介
// @note         版本更新	21-06-18 1.0.3 	增加新的倍速网址,ehuixue.cn/index/study,ehuixue.cn/index/study,chaoxing.com
// @note         版本更新	21-06-25 1.0.4 	增加新的倍速网址,douyin.com
// @note         版本更新	21-06-26 1.0.5 	增加新的倍速网址,pan.baidu.com,youku.com
// ==/UserScript==

(function() {
	'use strict';

	var stepHtml = '<input id="rangeId" type="number" step="0.1" min="0.1" max="20" value="1" style="z-index:999999;position:absolute;top:100px;right:100px;border:solid 1px;background-color:#E3EDCD;" />';
	$("body").prepend(stepHtml);

	window.setInterval(function() {
		let step = document.getElementById("rangeId").value || 1.0;

		console.log("倍速播放方法启动中....." + step);

		var htmlVideo = $("video").length;

		if(htmlVideo > 0) {

			var url = location.href;
			console.log("url-->" + url);

			if(url.indexOf('bilibili.com/video/') > 0) {
				//play video twice as fast
				document.querySelector('video').defaultPlaybackRate = 2.0; //默认两倍速播放
				document.querySelector('video').play();
			}

			// now play three times as fast just for the heck of it
			document.querySelector('video').playbackRate = step; //修改此值设置当前的播放倍数
		} else {
			console.log("当前视频不支持倍速播放.....(ಥ_ಥ) o(╥﹏╥)o");
		}

	}, 1000);

})();