user254153
user254153

Reputation: 1883

Seek bar in mp3 file not working

I have been trying to play the mp3 file in browser using default html5 player.

http://ujyaaloonline.com/audios/programAudios/1a8fdf5d0433ed581bbcee74836b3305.mp3

Audio is playing but the seek bar is not working here. What might be the problem. Please help.

Upvotes: 0

Views: 1268

Answers (1)

idbehold
idbehold

Reputation: 17168

You need to support byte range requests on the machine from which you're serving the audio. See SoundManager2's Technical Notes on the subject.

Byte Serving is automatically negotiated between client and server, and offers a number of advantages over traditional downloads. Most notably, Byte Serving is closer to a "streaming" technology and enables clients to seek, buffer and resume playback at arbitrary positions within a file once the duration is known.

Example Request:

GET 1a8fdf5d0433ed581bbcee74836b3305.mp3 HTTP/1.1
Range: bytes=5210604-5275910

Expected Response:

HTTP/1.1 206 Partial Content
Accept-Ranges: bytes
Content-length: 65307
Content-Range: bytes 5210604-5275910/5275911
Content-Type: audio/mpeg
  1. You don't appear to be sending the 206 Partial Content status.
  2. You're not sending a proper Content-Range response header.
  3. Finally if the client makes a range request that is out of bounds—that is, none of the range values overlap the extent of the resource—the server should respond with a 416 Requested Range Not Satisfiable status.

Upvotes: 2

Related Questions