Add mutechange event to Player#2378
Merged
JonnyBurger merged 2 commits intoremotion-dev:mainfrom Jun 1, 2023
Merged
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
JonnyBurger
approved these changes
Jun 1, 2023
Member
|
Looks absolutely perfect! Thanks a lot. Thanks for the bugfix as well, well caught! /tip 20 |
|
🎉🎈 @rjackson has been awarded $20! 🎈🎊 |
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.
This PR adds a new
mutechangeevent emitter for Player.It's implemented the same as the
isMuted()method, where the player is considered muted if the mute button is pressed or the volume is currently set to zero.Alongside this PR I have included a fix for the
volumechangeevent, to make sure it is emitted every time the volume changes. Previously it was only emitting were programmatically changed via thesetVolume()method, which means it was not emitting when the volume slider was changed.To test this change I have expanded the
packages/player-example. When running this example with:cd packages/player-example pnpm devAnd interacting with the mute button or volume slider, you can see the mutechange and fixed volumechange events being logged.
In the following screenshot, the left player shows mute being directly toggled, whereas the right shows the volume slider going down to zero and back up.
The Player API reference docs have been updated to note the new event:
Solves #2376
/claim #2376