-
-
Notifications
You must be signed in to change notification settings - Fork 207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: volume keep resetting after stopping playback #1971
Conversation
Since the media element itself got removed after stopping, we basically need to reapply the current volume. The solution is to just check if the `mediaElementRef` got set to `null` or `HTMLMediaElement` and then manually apply the current volume to the element directly. fix jellyfin#1956
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your contribution and sorry for the delay!
We renamed the currentVolume property from the reactive state to remoteCurrentVolume
because we didn't think about this possible edge case. Rename it back, modify the getters/setters and just use VueUse's syncRef (you might need to use toRef
too from them, as state's currentVolume is just a reactive property, but not a ref.
As stated in the comment, playbackManager never refers to the player element specifically, so your approach is completely undesired here.
Applied your suggestion, although I don't know if it's what you wanted |
Looks like I did something wrong since the volume is resetting again |
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Cloudflare Pages deployment
|
@noaione I found out that this is a VueUse's bug. Opened PR there vueuse/vueuse#2999, as the bug is an inconsistency between the DOM element's and composable's state. Will keep this PR open until the fix is merged upstream and VueUse is updated by Renovate PRs to track this issue (and in the strange case we need to perform additional changes) You can test my VueUse's changes by adding locally a copy of the composable and importing it instead from VueUse. The behaviour should match 1:1 your branch here. If not, please let me know so we can review it |
Checked and fixed for me in #1970 Please let me know if there's an edge case not working as expected |
Since the media element itself got removed after stopping, we basically need to reapply the current volume.
The solution is to just check if the
mediaElementRef
got set tonull
orHTMLMediaElement
and then manually apply the current volume to the element directly.Fix #1956