E-Kuerschner / useAudioPlayer

React hooks for controlling audio on the web
MIT License
315 stars 35 forks source link

Seeking on streamed audio #105

Open E-Kuerschner opened 1 year ago

E-Kuerschner commented 1 year ago

Describe the bug There may be an issue when attempting to seek on live, streamed audio.

To Reproduce Steps to reproduce the behavior:

  1. run examples (yarn start in ./exampes)
  2. go to Basic Example and choose the live audio from the sound source drop down
  3. hit play
  4. click forward in the time bar

There will be an error. The seek function is being passed the value of Infinity.

Expected behavior Im not sure what the expected behavior should be. Maybe seeking should be disabled while streaming if we can detect that case.

Environment (please complete the following information):

brianshano commented 11 months ago

For streaming live radio, skip forward wouldn't be possible and I wouldn't expect to be able to skip backwards either. Any other streamed audio that might have a case for skipping forward or backward?

phemartin commented 11 months ago

@E-Kuerschner I'd expect to wait for the file to load and play it then.

@brianshano Any podcast player that fetches audio via streaming.

E-Kuerschner commented 10 months ago

@phemartin the audio in this case cannot be downloaded to completion. Internet radio streams would be an example of something that cannot (and should not) be seeked.

Im considering just disabling the seek functionality when the duration is Infinity (which is the value for audio like this)