ant-media / Ant-Media-Server

Ant Media Server is a live streaming engine software that provides adaptive, ultra low latency streaming by using WebRTC technology with ~0.5 seconds latency. Ant Media Server is auto-scalable and it can run on-premise or on-cloud.
https://antmedia.io
Other
4.3k stars 636 forks source link

POC - Origin Failover scenario #6311

Open lastpeony opened 6 months ago

lastpeony commented 6 months ago

Cluster setup with 2 origin, 1 edge, 1 nginx stream is on origin1 origin1 crashes stream moves to origin2 user watches through nginx ip(connected to edge)

web embedded player stalls. it should continue to play stream. looks like a bug related to videojs(?). It only continues to play if user refreshes the page or m3u8 indice catches up with previous success ts indice

lastpeony commented 6 months ago

This is a strange issue. I'm attempting to resolve it by monitoring any changes in the origin of the broadcast through periodic REST requests in embedded player side.

In the event that the origin address of the broadcast changes while the stream is ongoing, I reload the video player. However, this approach leads to unexpected behavior on the videojs player and isn't working. I'm currently investigating this further.

lastpeony commented 6 months ago

We abandoned the previous workaround solution and instead, I've raised an issue on the Video.js repository, and now I'm actively following up on it. https://github.com/videojs/http-streaming/issues/1511

lastpeony commented 6 months ago

According to an answer from videojs maintainer, when indices reset to 0, the stream is considered invalid. https://github.com/videojs/http-streaming/issues/1511#issuecomment-2115281544

I will revisit detecting origin failover and reloading player work around.