Greasy Fork is available in English.

Smooth YouTube livestream

5/11/2025, 9:27:12 PM

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

Penulis
𝖢𝖸 𝖥𝗎𝗇𝗀
Pemasangan harian
0
Total pemasangan
93
Nilai
0 0 0
Versi
0.1.5
Dibuat
11 Mei 2025
Diperbarui
02 November 2025
Size
4,52 KB
Lisensi
MIT
Berlaku untuk

This userscript is designed to improve the smoothness of YouTube livestreams. Here's what it does:

  1. Trigger: It listens for the canplay event, which fires when a media element (like a video) is ready to play.
  2. Check if it's a livestream: It checks whether the element with class .ytp-live-badge.ytp-live-badge-is-livehead is present. This badge indicates a live stream.
  3. Target media elements: If a media element (like a video) is part of YouTube's player and is playing at normal speed (playbackRate === 1), it temporarily changes the playback speed to 0.968.
  4. Revert after 30 seconds: After 30 seconds, it sets the playback rate back to 1.0.

🧠 Purpose: Slightly slowing down a live stream for a short time helps buffer and can make the stream smoother, especially if you're falling slightly behind due to latency or network issues.


这个用户脚本是为了改善 YouTube 直播流的流畅度而设计的。其工作原理如下:

  1. 事件监听:监听 canplay 事件(当媒体元素准备好播放时触发)。
  2. 判断是否为直播:检查页面上是否存在 .ytp-live-badge.ytp-live-badge-is-livehead 元素(这是直播标志)。
  3. 处理媒体元素:如果检测到是 YouTube 播放器中的视频并且播放速度是正常(1.0),就将播放速度短暂设置为 0.968
  4. 30秒后恢复:30秒后再将播放速度恢复为 1.0

🧠 目的:这种微调播放速度的方式可以帮助视频稍微“追上”直播的实时进度,从而提升观看流畅度,特别是在出现网络延迟或缓冲时。