fix(media): rewind instead of reloading once the media has played - #87
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #87 +/- ##
==========================================
+ Coverage 89.79% 90.56% +0.76%
==========================================
Files 39 39
Lines 2969 2978 +9
Branches 642 649 +7
==========================================
+ Hits 2666 2697 +31
+ Misses 293 270 -23
- Partials 10 11 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
skjnldsv
force-pushed
the
fix/replay-keeps-buffer
branch
from
October 2, 2026 03:15
029b6e9 to
4cc7cda
Compare
skjnldsv
force-pushed
the
fix/handler-peers
branch
from
October 2, 2026 06:02
6bc723e to
88999c9
Compare
skjnldsv
force-pushed
the
fix/replay-keeps-buffer
branch
from
October 2, 2026 06:04
4cc7cda to
c1cba49
Compare
skjnldsv
force-pushed
the
fix/replay-keeps-buffer
branch
from
October 2, 2026 07:32
76be8c2 to
05b358b
Compare
donePlaying() reloaded the element to bring the poster back, which threw away what it had buffered: every replay downloaded the whole file again. Stopping the player at the start shows plyr's poster just the same. The playground gets a video with a poster of the same name beside it, and an e2e test that the poster is back and a replay fetches nothing. The audio e2e no longer counts the error Firefox raises on a machine with no audio device: the reload used to clear it by accident. Assisted-by: ClaudeCode:claude-opus-5-5 Signed-off-by: John Molakvoæ <14975046+skjnldsv@users.noreply.github.com>
skjnldsv
force-pushed
the
fix/replay-keeps-buffer
branch
from
October 2, 2026 07:45
05b358b to
3286477
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaying a video downloaded the whole file again, every time.
Fixes nextcloud/viewer#2585
donePlaying()reloaded the element (media.load()) once it ended, to bring the poster back. A reload throws away what was buffered, and Firefox fetched the file again on the next play. It now stops the player instead: paused at the start, which is what plyr shows its poster over (.plyr--stopped.plyr__poster-enabled), and the buffer stays.The poster after playing is a feature people use, a film and a picture of the same name side by side, so it gets tests. The playground has
trailer.webmwithtrailer.jpgbeside it, and an e2e test plays it to the end, checks the poster is back on top, plays it again and checks nothing was fetched. The video is servedno-storethere, otherwise Chromium answers the reload from its cache and the test passes onmaintoo; with it,mainmakes a fourth request and fails. Unit tests coverstop()being used rather thanload(), and a rewind by hand when plyr has no player yet.Based on #86, without which the video never gets its poster in the first place. Only run locally in Chromium; Firefox runs in CI.
👾 This pull request was assisted by Claude Code, commits carry an
Assisted-bytrailer.