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 only gets set after players are loaded #23

Closed
Fauntleroy opened this issue Jan 3, 2016 · 7 comments
Closed

Volume only gets set after players are loaded #23

Fauntleroy opened this issue Jan 3, 2016 · 7 comments

Comments

@Fauntleroy
Copy link
Contributor

If you set the volume of ReactPlayer when you instantiate it, (at least) the YouTube and SoundCloud players will not respect it (and seem to use 0.8). I imagine this is because setVolume calls are currently stopped instead of queued when the player isn't ready yet.

@Fauntleroy
Copy link
Contributor Author

To replicate:

  • Set volume to "0" in the state block of App.js
  • Go to http://localhost:3000/
  • Play a YouTube video
  • The YouTube video will be audible
  • Change the volume using the volume slider
  • The YouTube video's volume will change as expected

@Fauntleroy
Copy link
Contributor Author

With this is looks like we have a number of method calls which may need to be queued before execution. Maybe we should add a queue method which stores these calls until onReady, then executes them all in order?

@cookpete
Copy link
Owner

cookpete commented Jan 4, 2016

Hopefully this is sorted in 0.3.5.

Inside onReady, isReady = true was happening after setVolume(), which bails if isReady === false.

@Fauntleroy
Copy link
Contributor Author

There are still some volume issues appearing (though less consistently than before). I'll try and get a more cohesive test case together later, but a brief look this morning suggests that the volume isn't properly respected when new YouTube videos are loaded into an existing player.

@cookpete
Copy link
Owner

cookpete commented Jan 4, 2016

volume isn't properly respected when new YouTube videos are loaded into an existing player.

Hm. I wonder if we should just set volume every time onPlay fires..

@cookpete
Copy link
Owner

cookpete commented Jan 4, 2016

Ah I believe the behaviour you are seeing is because volume is not sent through if the player is not active. Perhaps volume should be sent to all players, active or not, and they can adjust accordingly in the background.

@cookpete
Copy link
Owner

cookpete commented Jan 4, 2016

I've had a further look at this. The YouTube player happens to be the only player that doesn't call onReady when loading subsequent videos, so hopefully 5895663 sorts this. Published in 0.3.6.

david-hub024 pushed a commit to david-hub024/React_VideoPlayer that referenced this issue Dec 23, 2018
Setting it later was causing setVolume not to fire
Fixes cookpete/react-player#23
@mgw-sbex mgw-sbex mentioned this issue Jan 25, 2019
david-hub024 pushed a commit to david-hub024/React_VideoPlayer that referenced this issue May 23, 2020
Setting it later was causing setVolume not to fire
Fixes cookpete/react-player#23
albanqoku added a commit to albanqoku/react-player that referenced this issue Feb 24, 2021
Setting it later was causing setVolume not to fire
Fixes cookpete/react-player#23
Webmaster1116 added a commit to Webmaster1116/video-player that referenced this issue May 20, 2021
Setting it later was causing setVolume not to fire
Fixes cookpete/react-player#23
webmiraclepro added a commit to webmiraclepro/video-player that referenced this issue Sep 9, 2022
Setting it later was causing setVolume not to fire
Fixes cookpete/react-player#23
philip-luther added a commit to philip-luther/react-player that referenced this issue Nov 22, 2024
Setting it later was causing setVolume not to fire
Fixes cookpete/react-player#23
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

No branches or pull requests

2 participants