Skip to content

Fix playback rate reset when video ends - #7718

Merged
FreeTubeBot merged 4 commits into
FreeTubeApp:developmentfrom
caetano-dev:playbackrate
Sep 21, 2025
Merged

FreeTubeBot merged 4 commits into
FreeTubeApp:developmentfrom
caetano-dev:playbackrate

Conversation

@caetano-dev

Copy link
Copy Markdown
Contributor

Pull Request Type

  • Bugfix
  • Feature Implementation
  • Documentation
  • Other

Related issue

Closes #7445

Description

Fixes a bug that made the video speed reset when the video ended.

These changes include a session storage to preserve the selected speed and a watch to monitor the currentPlaybackRate prop and keep it in sync.

Testing

1 - Open a video and set a custom speed.
2 - Let the video end.
3 - See that the video speed remains the same.

(previously, the speed would automatically reset to the default at the end)

Desktop

  • OS: Linux
  • OS Version: Ubuntu 24.04.2 LTS
  • FreeTube version: v0.23.5 Beta

Additional context

It seems like the bug was happening because the Shaka Player replaces the <video> element's source when it loads a new manifest. This throws away the current playbackRate.

@github-actions github-actions Bot added the PR: waiting for review For PRs that are complete, tested, and ready for review label Jul 21, 2025
@FreeTubeBot
FreeTubeBot enabled auto-merge (squash) July 21, 2025 14:23
@efb4f5ff-1298-471a-8973-3d47447115dc

Copy link
Copy Markdown
Member

fyi: havent forgotten about this one but i have made some notes on my issue you are trying to solve and the gist of it is that the issue is maybe running way deeper than i though. So i will investigate the notes first and come back to this

@efb4f5ff-1298-471a-8973-3d47447115dc

Copy link
Copy Markdown
Member

So the other case that was listed in my notes and should be checked is playlists

  1. Watch a playlist
  2. Change playback rate
  3. Video ends
  4. Next video resets playback rate
  5. Change playback rate again
  6. Click on next video in Playlist
  7. See that playback is saved

@caetano-dev

Copy link
Copy Markdown
Contributor Author

Hello! It seems like it is working fine on this branch.

Here is my test on a playlist I created. The same behaviour was found on playlists from other channels.

video.mp4

@efb4f5ff-1298-471a-8973-3d47447115dc

Copy link
Copy Markdown
Member

Could you rebase into dev so we can test this with working playback

auto-merge was automatically disabled August 13, 2025 11:47

Head branch was pushed to by a user without write access

@FreeTubeBot
FreeTubeBot enabled auto-merge (squash) August 13, 2025 11:47
@caetano-dev

Copy link
Copy Markdown
Contributor Author

Rebased

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Functionally wise LGTM but i prefer @absidue to sign off code wise first

@absidue absidue left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove the sessionStorage code.

auto-merge was automatically disabled August 17, 2025 22:53

Head branch was pushed to by a user without write access

@FreeTubeBot
FreeTubeBot enabled auto-merge (squash) August 17, 2025 22:53
@caetano-dev

Copy link
Copy Markdown
Contributor Author

Done!

@github-actions

github-actions Bot commented Sep 9, 2025

Copy link
Copy Markdown
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.

@efb4f5ff-1298-471a-8973-3d47447115dc

efb4f5ff-1298-471a-8973-3d47447115dc commented Sep 16, 2025 •

Copy link
Copy Markdown
Member

Sorry for the delay. Please rebase into dev branch so playback isnt broken anymore and this can be properly tested

@efb4f5ff-1298-471a-8973-3d47447115dc efb4f5ff-1298-471a-8973-3d47447115dc added PR: changes requested and removed PR: waiting for review For PRs that are complete, tested, and ready for review labels Sep 16, 2025
auto-merge was automatically disabled September 17, 2025 11:12

Head branch was pushed to by a user without write access

@FreeTubeBot
FreeTubeBot enabled auto-merge (squash) September 17, 2025 11:13
@caetano-dev

Copy link
Copy Markdown
Contributor Author

Rebased

@PikachuEXE

Copy link
Copy Markdown
Member

I don't think that's a proper rebase
I can see the commits added but the "base" of the branch is on older dev commit
image

After proper rebase it should look like
image

auto-merge was automatically disabled September 18, 2025 11:14

Head branch was pushed to by a user without write access

@FreeTubeBot
FreeTubeBot enabled auto-merge (squash) September 18, 2025 11:14
@caetano-dev

Copy link
Copy Markdown
Contributor Author

My bad, my fork was outdated. I rebased it again.

@efb4f5ff-1298-471a-8973-3d47447115dc efb4f5ff-1298-471a-8973-3d47447115dc added PR: waiting for review For PRs that are complete, tested, and ready for review and removed PR: changes requested labels Sep 19, 2025
@FreeTubeBot
FreeTubeBot merged commit d411734 into FreeTubeApp:development Sep 21, 2025
@github-actions github-actions Bot removed the PR: waiting for review For PRs that are complete, tested, and ready for review label Sep 21, 2025
PikachuEXE added a commit to PikachuEXE/FreeTube that referenced this pull request Sep 22, 2025
* development: (24 commits)
  Add proxy login support (FreeTubeApp#7996)
  Migrate the History view to the composition API (FreeTubeApp#8064)
  Fix player button hiding (FreeTubeApp#8065)
  Translated using Weblate (Norwegian Bokmål)
  Translated using Weblate (Indonesian)
  Fix playback rate reset when video ends (FreeTubeApp#7718)
  Skip Electron binary download in CI as we do not run it (FreeTubeApp#8063)
  Feat: Display player overlay controls on keyboard interaction (FreeTubeApp#7757)
  Translated using Weblate (Hungarian)
  Translated using Weblate (Czech)
  Translated using Weblate (Estonian)
  Translated using Weblate (French)
  Bump electron from 37.4.0 to 38.1.0 (FreeTubeApp#8025)
  Translated using Weblate (Dutch)
  Translated using Weblate (Portuguese (Brazil))
  Translated using Weblate (German)
  Translated using Weblate (Breton)
  Translated using Weblate (Italian)
  Translated using Weblate (Chinese (Simplified Han script))
  Support exporting single playlists as a list of video URLs (FreeTubeApp#8054)
  ...

# Conflicts:
#	src/renderer/components/ft-shaka-video-player/ft-shaka-video-player.js
FreeTubeBot pushed a commit that referenced this pull request Oct 20, 2025
* Bump shaka-player from 4.16.4 to 4.16.6

Bumps [shaka-player](https://github.com/shaka-project/shaka-player) from 4.16.4 to 4.16.6.
- [Release notes](https://github.com/shaka-project/shaka-player/releases)
- [Changelog](https://github.com/shaka-project/shaka-player/blob/v4.16.6/CHANGELOG.md)
- [Commits](shaka-project/shaka-player@v4.16.4...v4.16.6)

---
updated-dependencies:
- dependency-name: shaka-player
  dependency-version: 4.16.6
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

* Revert "Fix playback rate reset when video ends (#7718)"

This reverts commit d411734.

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: efb4f5ff-1298-471a-8973-3d47447115dc <73130443+efb4f5ff-1298-471a-8973-3d47447115dc@users.noreply.github.com>
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.

[Bug]: Playback rate not saved when autoplay is enabled

5 participants