如何在 "Red5 Pro HTML" 中停止直播?

How to stop stream in "Red5 Pro HTML"?

亲爱的朋友们,我在文档中找不到 "Red5 Pro HTML" 如何停止发布者流的精确示例,请知道的人给我提示

查看 SDK documentationRTCPublisherRTMPPublisher 都有一个名为 unpublish:

的函数

unpublish() → {Promise}

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

Returns: Promise

尝试使用它。

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