AirenSoft / OvenPlayer

OvenPlayer is JavaScript-based LLHLS and WebRTC Player for OvenMediaEngine.
https://OvenMediaEngine.com/ovenplayer
MIT License
498 stars 124 forks source link

Calling player.load gives error when trying to load the same WebRTC stream again after a playback error #370

Closed Remboooo closed 3 months ago

Remboooo commented 10 months ago

Observed with the latest Ovenplayer, i.e. 0.10.30 The flow to produce the error is as follows:

  1. Call player.load to load a WebRTC stream (it has ABR enabled, I don't know if that matters)
  2. Stop the stream server-side, causing OvenPlayer to go into 'error' state
  3. Call player.stop()
  4. Start the stream server-side again
  5. Call player.load() with the same argument
  6. Observe the following error:
    Uncaught TypeError: Cannot read properties of null (reading 'id')
    at Bn.e.setCurrentQuality (WebRTCLoader.js:957:1)
    at Tn.t.load (Api.js:354:1)

The WebRTCLoader.js line in question is:

provider.setAutoQuality = (auto) => {

        sendMessage(ws, {
            command: 'change_rendition',
>>>         id: mainPeerConnectionInfo.id,
            auto: auto
        });
        autoQuality = auto;
    };

The line in Api.js is inside load():

        return initProvider();
SangwonOh commented 5 months ago

I'll check it out soon

IanMitchell77 commented 3 months ago

I had this problem too and .34 fixes the issue.

SangwonOh commented 3 months ago

Fixed at af179c6184fa15c313e165efef3127f4106f04bd