Closed danielr18 closed 5 years ago
I believe the reloadActiveTrack
could be put in the control props. It would allow users to add a reload button when mediaCannotPlay
is set. If you are offline and try to play a track, mediaCannotPlay
will be true, and you can't play it again without changing tracks even after you come back online.
Just made the changes, feel free to modify the documentation of the new control prop if you want to improve it.
Great thank you! I'll try to release this soon.
@danielr18 released in v2.0.0-beta.2!
Fixes #425.
The logic is that when the player gets a network error, it checks if it's online to try and reload the active track, and if it's not, it listens to the online event and once the player is back online, it will try to reload.
The reload track method has an option to auto play the track, however I'm not sure if we should auto play after the error, the player becomes paused after the error, maybe it's best to just reload and leave it paused? Might be weird if you were offline for a considerate amount of time and then when you go back online, something starts playing.
The
online
event listener is removed:@benwiley4000 Let me know what you think.