benwiley4000 / cassette

📼 A flexible media player component library for React that requires no up-front config
https://benwiley4000.github.io/cassette/styleguide
MIT License
185 stars 28 forks source link

currentTime loaded from snapshot confuses media element when playing radio stream #375

Closed benwiley4000 closed 5 years ago

benwiley4000 commented 5 years ago

Noticed while investigating #374.

Normally we restore the current time with a state snapshot to pick up playback where we were before.

This doesn't work well for radio streams since the current time doesn't correspond to something that's available to play when we refresh the page.

I think the best solution is to set the currentTime to 0 on durationchange if the duration value is Infinity.