如何在"Red5 Pro HTML"中停止流?



亲爱的朋友们,我在"Red5 Pro HTML"的文档中找不到 如何停止发布者的流,如果有人知道写法,请给我一个提示

查看 SDK 文档,RTCPublisherRTMPPublisher 都有一个名为 unpublish 的函数:

unpublish(( → {Promise}

请求停止广播。返回的承诺将在成功停止广播时解决或拒绝。

回报: Promise

尝试使用它。

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

最新更新