通用视频加减调速

通用视频调速,突破0到16倍速

  1. // ==UserScript==
  2. // @name 通用视频加减调速
  3. // @namespace https://yeyu1024.xyz
  4. // @version 1.0
  5. // @description 通用视频调速,突破0到16倍速
  6. // @author 夜雨
  7. // @run-at document-end
  8. // @match *://*/*
  9. // @compatible Chrome
  10. // @compatible Firefox
  11. // @grant GM_registerMenuCommand
  12. // @license MIT
  13. // ==/UserScript==
  14.  
  15. (function() {
  16.  
  17.  
  18. 'use strict';
  19.  
  20. //host, selector
  21. const urlList = {
  22. bilibili: 'bwp-video',
  23. douyin: ".xg-video-container video"
  24. };
  25.  
  26. try {
  27. GM_registerMenuCommand("减速/加速", function (event) {
  28. let rateVal = prompt("请输入您的速率(0-16)", "2.0");
  29. if (!isNaN(rateVal)) {
  30. console.log(rateVal)
  31. if (rateVal > 16 || rateVal < 0) {
  32. alert("无效数值")
  33. return
  34. }
  35. let video_ = null
  36. for (let key in urlList) {
  37. if(location.host.replace(/\./g,"").includes(key)){
  38. document.querySelector(urlList[key])
  39. break
  40. }
  41. }
  42.  
  43. if(!video_){
  44. video_ = document.querySelector("video")
  45. }
  46. console.warn("video_:", video_)
  47. video_.playbackRate = parseFloat(rateVal);
  48. }else{
  49. alert("无效数值")
  50. }
  51. }, "rate");
  52. }catch (e) { }
  53.  
  54. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址