AwesomeWebProjects / react-player

One audio player built with ReactJS, Web Audio API and Web Worker API
https://dazzling-jang-471a34.netlify.com/
MIT License
107 stars 22 forks source link

Playback issue? #36

Closed kcseb closed 4 years ago

kcseb commented 5 years ago

It would seem as though audio playback ceases and then starts from the beginning. It does this over and over only getting to about 7 seconds in.

An example of this can be found at https://soundbytez.io/@FeralLogic:e/FeralLogic0x0001

danielbarion commented 5 years ago

Hello @kcseb

Your Player Example

This probably is because your file are too large (~55mb);

What are the current player flow ?

  1. Start player
  2. Download 7 ~ 10 seconds of music (this is about bits and kb downloaded) with one request
  3. Clone the response to read stream body and close her (the original request stay downloading)
  4. When the audio context time are close of the end => read the finished original request and play full song

Now, what is probably the problem ?

The request are not finished when the player try read him again to load full song

How Spotify handle his musics ?

The back-end sends just fragments of full song in every request

Try with small file size... (maybe max 20mb), I already have an idea to solve this issue, but i'm very busy now and in the next days, I'll back to this project in one or two weeks;

I hope these explanation can answer your question / trouble;

If not, please, reply and let me know.

kcseb commented 5 years ago

I gave this a try wth a much smaller audio file. Ths is no more than 5MB in size.

https://soundbytez.io/@SoundBytez:8/soundbytez-test-recording

However, the issue still persists. The React Player plays a second or two then loops. It refuses to play the full audio stream, however, the in-built HTML audio player will play the entire audio stream just fine. The same thing occurs with my previous example of a much longer stream. The in-built HTML audio player handles both files fine.

danielbarion commented 5 years ago

Okay, i'll take a look ass soon i can.

Thank you @kcseb for the report and show the error;

danielbarion commented 5 years ago

@kcseb just a little feedback, i'm so busy now, but i'll take a look in this issue when i back code into player project okay.

danielbarion commented 4 years ago

@kcseb can you give-me a feedback plase ? I'm back now...

danielbarion commented 4 years ago

No feedback received.