2
votes

Problem: Streaming live audio via an Icecast mountpoint. On the server side, when the live show stops, the server reverts to playing a music playlist (the actual mountpoint stays /live). However, when the live stream stops, the audio player stops too. Dev tools says the request has been cancelled. Player must be in HTML5, so no Flash.

Mountpoint: http://198.154.112.233:8716/

Stream: http://198.154.112.233:8716/live

I've tried:

  • Listening for the stream to end, and tell the player to reconnect. However, all of the events on the jPlayer and Mediaelement.js APIs don't return anything when the stream is interrupted.
  • Busy contacting the server host to ask for advice when dealing with their behind-the-scenes playlist switcher.

I'd like to find a client-side solution to this. Could websockets / webrtc solve this problem by keeping a connection open?

2

2 Answers

1
votes

Your problem isn't client-side, but how you are handling your encoding. No changes client-side can appropriately fix this problem.

The stream configuration you are using is that the encoder is using files on disk as a backup stream. Unfortunately, it sounds like instead of re-encoding and splicing (and matching sample-rate and channels if needed), it is just sending the raw file data.

This works some of the time, as MPEG decoders are often tolerant of corrupt streams, and will re-sync. However, sometimes the stream is too broken, and the decoder gives up. The decoder will also often stop if there is a change in sample rate or channel count. (Bitrate changes are generally not a large problem.)

To fix your problem, you must contact your host.

1
votes

Yes this is unfortunately a problem if the playlist and live stream are not the same codec. Additional tools such as Liquidsoap have solved the problem for me, as well as providing many more features: savonet.sourceforge.net