Greasy Fork is available in English.

HTML5 Video Player Enhance

To enhance the functionality of HTML5 Video Player (h5player) supporting all websites using shortcut keys similar to PotPlayer.

CY Fung
3 0 0


fork from播放器增强插件-修订版/code (v2.5.1 2019-09-11)
and few code from (v11.5 2019-04-25)

The main difference from the original chinese version is to making this h5Player more general for every website.
Features are not as many as the original one, but more efficient and effective.

The enhancement won't bring significant performance impact to the usage.
Same as original, the functions are used by shortcut keys.
For the performance, it is still a long way to go.

The following features are unlikely to develop in the near future:
"Screen Capture"

To use this script, your browser shall be a "modern" browser - supporting ES6, CSS3, and etc.

Once this script is enabled, there are major impacts to your video viewing:

1) Default 5x5 unsharpen filter is enabled.
2) requestAnimationFrame replaced event timeupdate (called "timeupdatef"), "Bullet Curtain"(彈幕) shall be smoother.
3) original addEventListener & removeEventListener are replaced.
4) localStorage are being saved and read at the interval of 2 seconds.

Shortcut Keys for video control:

亮度(brightness)Key: E/W
飽和度(saturate)Key: U/Y
對比度(contrast)Key: T/R
速度(playback speed)[Key: Z/X/C]
frame [Key: F/D]
hue Key: O/I
blur Key: K/J
Zoom Key: Shift-Z/Shift-X/Shift-C

fullscreen [Key: Dblclick, Shift-Enter]
miniscreen [Key: N, Shift-P]

Restore your playback progress [key: shift-R]

Mute [Key: m]
Debug Logging [ Key: Shift-O]
Open in Potplayer [ Key: Shift-T]

======================== changelogs ================================

2.5.3 - first version

2.5.5 - update code for the original fullscreen

2.5.6 & 2.5.7 - added code for the miniscreen

2.5.8 - fixed bugs and added unsharpen filter by default

2.5.9 & 2.5.10 - improvement(minor)

2.6 & 2.7 Coding Enhancement and Function rewrites. More stable and less resource to be occupied

2.7.1 performance improvement and tipsDOM appearance changed

2.7.2 key "z" can switch from 1x and custom speed, same as potPlayer

2.7.4 TCC tally with scripts/381682 v3.0.2

=== 2.8.0b1 ~ 2.8.0b8 ===
Major upgrade from 2.7.4

  • Activation of the advanced control:
    no longer global mode. depends on which one you are controlling.

  • Key "enter" re-assign to other features
    normal mode: enter to enable/disable pointer lock
    fullscreen mode: enter to leave the fullscreen

  • Pointer Lock Control:
    If you press "enter" in the web page, you will enter to the pointer lock mode of the last controlled < video >
    To escape, move you mouse rapidly, or just press enter.

  • Playback time recording:
    1) Enhanced its performance (less access to the whole localStorage).
    2) It gives a delay to start record the playback time to avoid misoperation of video playing.

  • Tips DOM position:
    1) moved to the topleft corner instead of centre, same as potplayer.
    2) position update with the screen/size change

  • [2.8.0b3] fixed detection of video element bug:
    all video element on the page shall be detected.

  • [2.8.0b3] capture for key events of the video changed

  • [2.8.0b3] sha256 library added for video playback record.

  • [2.8.0b4] added feature "mute"; to mute/unmute, press "m"

  • [2.8.0b8] added mouse wheel to adjust volume

  • [2.8.0b8] added "open in potplayer"

--- known bugs ----
1) iframe video may not be able to control [solved]
2a) interaction box not yet implement the key control [solved]
2b) click to pause/resume, no tips shown. (example viu) [na]
3) exit fullsreen may let the focus of your page lost, seem to be a bug of the browser
4) videos inside iframe /shadowRoot may be buggy for pointerLock/Fullscreen operation
5) muted shall only mute not volume change [solved]
6) lack of options to enable/disable logging [solved]