Skip to content
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

Volume change event #3964

Closed
francoism90 opened this issue Jun 23, 2022 · 4 comments
Closed

Volume change event #3964

francoism90 opened this issue Jun 23, 2022 · 4 comments
Assignees

Comments

@francoism90
Copy link

Is your feature request related to a problem? Please describe.
I would like to add a mute(d) button, which should tigger even when not playing a video.

Describe the solution you'd like
Add a volume change event.

Describe alternatives you've considered
Using video element events, but this adds complexity and makes things more difficult than needed.

Additional context
#2496

Thanks!

@dsilhavy
Copy link
Collaborator

We are exposing a setVolume method in Mediaplayer.js. This method can be called directly by the app. Consequently the app is aware when the volume changes as the previously mentioned method should be used. What would be the reason to add an event for that?

@francoism90
Copy link
Author

@dsilhavy I'm using custom controls, which need listeners to update the state. This is really helpful, as I can now listen on buffer, can*, playback, stream, text, track, etc.

If it were part of playback/stream, one can listen and simple update the state:

state.muted = player.value?.isMuted();
state.paused = player.value?.isPaused();
state.volume = player.value?.getVolume();

@dsilhavy
Copy link
Collaborator

Implemented in #3969. Can you please confirm that this is the desired behavior.

@dsilhavy dsilhavy self-assigned this Jun 27, 2022
@francoism90
Copy link
Author

@dsilhavy Many thanks! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants