AirenSoft / OvenPlayer

OvenPlayer is JavaScript-based LLHLS and WebRTC Player for OvenMediaEngine.
https://airensoft.com/ome.html
MIT License
514 stars 126 forks source link

WebRTC Turn port not reacheable not catched #394

Closed zguig52 closed 11 months ago

zguig52 commented 11 months ago

Hi,

First, congratulations for this amazing platform! Just did the switch from custom managed FFmpeg scripts and confs to OvenMediaEngine, this is brilliant...

I found out an uncatched error in the player: when the TURN port from OME in WebRTC is not reacheable, but OME port is reacheable, the player fails with an uncatched error:

"code":511,"message":"Connection with low-latency(OME) terminated unexpectedly.","reason":"Unexpected end of connection."

ovenplayer.js:1 Uncaught (in promise) TypeError: Cannot read properties of null (reading 'id')
    at En.e.setCurrentQuality (ovenplayer.js:1:126674)
    at Sn.t.load (ovenplayer.js:1:147688)
    at Object.<anonymous> (multimedia.js:104:38)
    at r (ovenplayer.js:1:49036)
    at Ge.t.trigger (ovenplayer.js:1:49232)
    at Object.<anonymous> (ovenplayer.js:1:142303)
    at r (ovenplayer.js:1:49036)
    at Ge.t.trigger (ovenplayer.js:1:49244)
    at qe (ovenplayer.js:1:59686)
    at M (ovenplayer.js:1:126365)

The player is dead afterwhile and custom event handlers are broken, like fallback to different sources.

Shall I implement a kind of heartbeat mode to check if the player is dead on my side?

For the moment I was using this kind of code, with live sources being in the following order:

Fallback sources are waiting classic videos, to play while the live stream is not on.

By the way, autoFallback seems to be ineffective (might be linked to #328)

zguig52 commented 11 months ago

Seems to be fixed, I was on 0.10.31, just upgraded to 0.10.32 and autoFallback is OK as well as errors are not fatal (end of stream for example)