How to stop stream in "Red5 Pro HTML"?

420 views Asked by At

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

1

There are 1 answers

1
cbr On BEST ANSWER

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!'))