Eyevinn / webrtc-player

WebRTC (recvonly) player
MIT License
87 stars 18 forks source link

Detecting failed initial connection #45

Closed nigelsim closed 1 year ago

nigelsim commented 1 year ago

I am using webrtc-player with the WHEP adaptor, and I want to be able to detect if the initial connection worked or not (as opposed retrying failed connections).

The load promise does not return a success/failure flag, and there does not seem to be an event emitted to say that the negotiation failed.

In my case, I'm calling an API to start a stream, and I'm returned the WHEP URL, but this may not be valid for a few moments, so in my previous hacky solution there was a retry loop waiting for a 2xx response (rather than the 404).

Looking at the adaptor code the errors are just logged, and the code path appears to exit. If that is correct, would it be appropriate to make the return type of the connect methods be a boolean for success/failure?