Wowza Community

How to handle crashing on stream completion?

Hi there!

Just a little bit of background for the app I’m developing. Essentially this web app receives incoming streams, an operator completes various actions based on the incoming stream. Then the operator closes the incoming stream, awaiting the next one to come in.

All of this is happening on the same page (there isn’t any reloading of the page). The operator clicks on an incoming stream tab to view the stream, so the same Wowza player instance needs to be reused multiple times with different streams ran through it.

I’m having difficulties with the Wowza JS player as it is throwing exceptions in the following scenarios:

  • When a user presses the ‘Stop’ button during a live stream
  • When the stream ends (Stopped by the person live streaming)
  • When the Wowza player element is removed from the DOM
  • When the Wowza player is set to ‘display: none’

This is the error I receive:

Uncaught DOMException: Failed to read the 'buffered' property from 'SourceBuffer': This SourceBuffer has been removed from the parent media source.
    at p6l.monitor (http://player.wowza.com/player/latest/js/wowzaplayer.js:1:905540)
   

I also get this logged to the console (only when the stream is stopped by the person streaming):

0:04:54.871 ERROR: PlayerStreamerImplBase: 294522: FILL ERROR: Failed to read the 'buffered' property from 'SourceBuffer': This SourceBuffer has been removed from the parent media source.

There will be hundreds of these errors that flood the Console.

So I assume it is because the script behind the player is expecting a stream, isn’t finding it and then throws an exception. But I haven’t been able to find anyone with the same issue.

I’ve set up an error listener to hopefully catch these exceptions but they have no effect it seems:

 errorListener = function ( errorEvent ) {
    console.log('Message: ' + errorEvent.error);
    myPlayer.finish();
  };
  
  myPlayer.onError( errorListener );

If anyone could assist me on this issue, it would be greatly appreciated :slight_smile: