fix: video player playback rate#8407
Merged
FreeTubeBot merged 3 commits intoFreeTubeApp:developmentfrom Jan 17, 2026
Merged
Conversation
…he video player (calling .attach())
Contributor
|
This PR is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 14 days. |
absidue
approved these changes
Jan 17, 2026
PikachuEXE
approved these changes
Jan 17, 2026
ChunkyProgrammer
approved these changes
Jan 17, 2026
PikachuEXE
added a commit
to PikachuEXE/FreeTube
that referenced
this pull request
Jan 19, 2026
* development: (55 commits) Translated using Weblate (Chinese (Simplified Han script)) Translated using Weblate (Czech) Translated using Weblate (Russian) Translated using Weblate (Polish) Translated using Weblate (Kurdish (Central)) Translated using Weblate (French) Use GITHUB_TOKEN instead of dedicated PUSH_TOKEN in auto-merge workflow (FreeTubeApp#8541) Local API: Implement SABR for VODs (FreeTubeApp#8047) Bump package version from 0.23.12 to 0.23.13 (FreeTubeApp#8531) Update CodeQL workflow to match the latest template (FreeTubeApp#8533) fix: video player playback rate (FreeTubeApp#8407) Decipher live DASH manifest URL (FreeTubeApp#8530) Add a show all windows button to the tray menu (FreeTubeApp#8494) Disable automatically running the flatpak workflow (FreeTubeApp#8507) fix using shift on watch page (FreeTubeApp#8491) Translated using Weblate (Hebrew) Translated using Weblate (Hebrew) Fix WAPT link in README (FreeTubeApp#8529) Fix typo in auto-merge workflow (FreeTubeApp#8518) Added translation using Weblate (Uzbek) ...
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.
Pull Request Type
Related issue
closes #8226
Description
Fixes a bug with the playback rate jumping to a wrong value (bug described in issue #8226).
Bug details
When loading the video player the playback rate is set based on a prop, which keeps track of the playback rate of a session. So, when playing the next video in a playlist or selecting a video from the next videos section, this correctly allows for keeping the same playback rate. While the current playback rate is set correctly, it is also used to set the default playback rate:
Now, when we set the playback rate back to the actual default playback rate, we correctly stop the trick play mode, but this makes the video player use the default playback rate of the video element, which is wrong from the snippet above, and propagate the value through an event update (update value in UI).
So we can fix this first bug by correctly providing the default playback rate, but this introduces a second bug where after loading the video player, the current playback rate is always reset to the default playback rate. This is because the current playback rate value of the video element is reset to the default value set when the video element is attached to the local player.
I assume this is the reason, why the default playback rate of the video element was set to the current playback rate and not the actual default playback rate.
Fixes
videoElement.defaultPlaybackRate) based on global default playback rate (defaultPlaybackRate.value) instead of the current playback rate (props.currentPlaybackRate).attach()to avoid the playback rate to be overriddenTesting
PorODesktop
Additional context
The reason why
await localPlayer.attach(videoElement)resets the playback rate to the default value of the video element is, that the source of the HTMLMediaElement is changed, which resets the playback rate to the set default value.Excerpts from the code of the shaka video player:
This is therefore not directly the fault of the shaka player, but based on the HTMLMediaElement. This can also be tested with this example:
Alternatively to the second commit, this could be fixed in the shaka player by storing the playback rate before setting a new (or first) source. But the fix would work either way.