Youtube player keyboard controls

Use play/pause/ArrowRight/ArrowLeft keyboard btns anywhere, but not only when youtube player is in focus. Additionaly use '[' and ']' keys to change playbackRate.

< 腳本Youtube player keyboard controls的回應

評論:普通 - 腳本能使用,但有一些問題

Deleted user 84694
§
發表於:2019-05-07
編輯:2019-05-07

[Feature request] Optionally take custom styles from localStorage

When I use your script I change the styles of the playback rate div.

Updating this script is problematic because I would lose my styles unless I make a quick backup before every update.

Maybe you can implement changes similar to this code below for this situation.

styleVar = /* take from localStorage if exists, else use default styles */

$moviePlayer.insertAdjacentHTML('afterbegin', `<div id="${playbackRateElId}" style="${styleVar}"></div>`);

For context here is what I change the styles to:

  • white text
  • transparent black background
  • move to left side of video player
  • smaller font size
$moviePlayer.insertAdjacentHTML('afterbegin', `<div id="${playbackRateElId}" style="position: absolute;
z-index: 9999999;
left: 10px;
bottom: 25%;
pointer-events: none;
display: block;
transition: opacity .7s;
opacity: 0;
color: #fff;
background-color: rgba(0, 0, 0, 0.8);
padding: 5px 10px;
border-radius: 2px;
width: auto;
height: 36px;
line-height: 36px;
font-size: 36px;
text-align: center;
text-shadow: 1px 1px 4px #000;"></div>`);
§
發表於:2020-05-17

Hello. Thx for issue. I will consider this request.

發表回覆

登入以回覆