Bitchute playback speed control hotkeys

Allows for adjusting the Bitchute player playback speed using the + and - numpad keys, adjusing playback by 25% increments, and allows setting the speed above the standard 2x speed cap. It will temporarily show the current playback speed in a little popup in the top-right corner of the player.

  1. // ==UserScript==
  2. // @name Bitchute playback speed control hotkeys
  3. // @namespace Violentmonkey Scripts
  4. // @match https://www.bitchute.com/video/*
  5. // @grant GM_addStyle
  6. // @version 1.0
  7. // @author The Mickey J
  8. // @description Allows for adjusting the Bitchute player playback speed using the + and - numpad keys, adjusing playback by 25% increments, and allows setting the speed above the standard 2x speed cap. It will temporarily show the current playback speed in a little popup in the top-right corner of the player.
  9. // ==/UserScript==
  10.  
  11. $change = 0.25;
  12. $hookedUp = false;
  13. var hideSpeedDisplayTimeout;
  14.  
  15. function setSpeed(speed) {
  16. document.getElementById('player').playbackRate = speed;
  17. var speedDisplay = document.getElementById("JSpeedDisplay");
  18. speedDisplay.innerHTML = "Speed: " + speed;
  19. speedDisplay.className = "show";
  20. //If we had a timeout, kill it.
  21. clearTimeout(hideSpeedDisplayTimeout);
  22. //And start a new one.
  23. hideSpeedDisplayTimeout = setTimeout(function(){ speedDisplay.className = speedDisplay.className.replace("show", ""); }, 2000);
  24. }
  25.  
  26. function doc_keyUp(e) {
  27. switch (e.keyCode) {
  28. case 187:
  29. //+ key number row
  30. case 107:
  31. //+ key keypad
  32. if($hookedUp) {
  33. var speed = document.getElementById('player').playbackRate + $change;
  34. setSpeed(speed);
  35. }
  36. break;
  37. case 189:
  38. //- key number row
  39. case 109:
  40. //- key numpad
  41. if($hookedUp) {
  42. var speed = document.getElementById('player').playbackRate - $change;
  43. setSpeed(speed);
  44. }
  45. break;
  46. default:
  47. break;
  48. }
  49. }
  50. document.addEventListener('keyup', doc_keyUp, false);
  51.  
  52.  
  53.  
  54. GM_addStyle(`
  55. #JSpeedDisplay {
  56. display: block;
  57. width: auto;
  58. top: 2%;
  59. right: 2%;
  60. position: absolute;
  61. font-weight: 500;
  62. font-size: xxx-large;
  63. color: white;
  64. -webkit-text-stroke: 2px black;
  65. font-weight: bold;
  66. visibility: hidden; /* Hidden by default. Visible on click */
  67. }
  68. #JSpeedDisplay.show {
  69. visibility: visible;
  70. }
  71.  
  72. `);
  73.  
  74.  
  75. function insertSetSpeedDiv() {
  76. var container_block = document.querySelector('.plyr');
  77. if(container_block) {
  78. block_to_insert = document.createElement( 'div' );
  79. block_to_insert.id = "JSpeedDisplay";
  80. block_to_insert.innerHTML = 'Speed: 1';
  81. container_block.appendChild( block_to_insert );
  82. $hookedUp = true;
  83. return true;
  84. }
  85. return false;
  86. }
  87.  
  88. function KeepTrying(func, attempts, delayMillis) {
  89. console.log('Trying to insert Speed Display div, remaining attempts: ' + attempts);
  90. if(!func() && (attempts-1 > 0)) {
  91. window.setTimeout(function() {
  92. KeepTrying(func, attempts-1, delayMillis);
  93. }, delayMillis);
  94. }
  95. }
  96.  
  97. KeepTrying(insertSetSpeedDiv, 12, 500);
  98.  

QingJ © 2025

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