Seamless Playlist Experience in Ant Media Server — Resolve Freezing in Switching PlayList Items

ahmet oğuz mermerkaya
2 min readFeb 23, 2024

--

The problem with the playlist is that when you play the list with HLS, you see that the stream is restarted/freezes when it switches through playlist items. We’re going to fix this issue by using some flags in HLS.

You can have a seamless playlist experience in HLS playback because switching between items may take a few hundred-milliseconds and WebRTC playback is effected in this case. While playing the streams with Ant Media Server player, add ‘playOrder=hls’ query to the URL to play with HLS.

Here is a sample:
https://{YOUR_ANT_MEDIA_SERVER}:5443/{YOUR_APP}/play.html?id={STREAM_ID}&playerOrder=hls

  • Click the LiveApp on the left
  • Click theSettings tab and scroll to the bottom
  • Uncheck the Delete HLS files after the stream is finished.

Keep in mind that if you still see some buffering in switching playlist items, you can increase the Segment Duration to 10 seconds or further in the screenshot below

  • Scroll down and click Save button
  • Scroll up and Choose the mode from Basic to Advanced
  • Find hlsflags and change its value to delete_segments+append_list+omit_endlist

You can proceed with this documentation: https://antmedia.io/docs/guides/publish-live-stream/playlist/#how-to-create-a-playlist

Reference: https://github.com/orgs/ant-media/discussions/6015

--

--