Skip to content

Show the playback notice when the browser can't draw the video - #131

Merged
zfleeman merged 1 commit into
mainfrom
zf/detect-undecodable-video
Oct 22, 2026
Merged

zfleeman merged 1 commit into
mainfrom
zf/detect-undecodable-video

Conversation

@zfleeman

Copy link
Copy Markdown
Owner

The web UI's "Your browser can't play this video" notice didn't appear for an HEVC MKV in Firefox. Firefox played the audio and reported the real 1920x1080 size, but the video stayed black. The old check only caught videos that fail to load or report a width of 0, so it missed this case.

The page now also checks video.getVideoPlaybackQuality().totalVideoFrames one second after playback starts. If the video is still playing and no frames have been drawn, the browser can't decode it, so the notice appears.

Testing

I played two pages for 3 seconds in headless Firefox 158 (driven with Selenium) and read the player's stats:

HEVC MKV H.264 MP4
Size reported 1920x1080 1920x1080
totalVideoFrames 0 72
Notice before this change hidden hidden
Notice after this change shown hidden

The MKV needs #130 to open at all, so I ran this test on a temporary merge of both branches.

uv run pytest --cov passes (290 tests, 99.39%), and ruff is clean. There are no JavaScript tests, so the browser run above is the only test of the change itself.

@zfleeman
zfleeman merged commit ac16756 into main Oct 22, 2026
6 checks passed
@zfleeman
zfleeman deleted the zf/detect-undecodable-video branch October 22, 2026 19:46
@zfleeman zfleeman mentioned this pull request Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant