javascriptwebstreamred5pro

How to stop stream in "Red5 Pro HTML"?


Dear friends i cant find in documentation of "Red5 Pro HTML" precise example how to stop stream for publisher, please if some one know write way give me a hint


Solution

  • Looking at the SDK documentation, both RTCPublisher and RTMPPublisher have a function named unpublish:

    unpublish() → {Promise}

    Request to stop a broadcast. The returned Promise will either resolve or reject on successful stop of broadcast.

    Returns: Promise

    Try using that.

    publisher.unpublish()
      .then(() => console.log('Stopped publisher stream!'))
      .catch(() => console.log('Failed to stop publisher stream!'))