添加视频流接口
This commit is contained in:
parent
54f8b03159
commit
31d28cbff2
|
|
@ -412,7 +412,12 @@ func VideoFeed(c *gin.Context) {
|
||||||
// 启动一个协程来监测客户端连接是否关闭,关闭时向 clientClosed 通道发送信号
|
// 启动一个协程来监测客户端连接是否关闭,关闭时向 clientClosed 通道发送信号
|
||||||
go func() {
|
go func() {
|
||||||
<-c.Request.Context().Done()
|
<-c.Request.Context().Done()
|
||||||
clientClosed <- struct{}{}
|
//如果clientClosed通道已经关闭,不再发送
|
||||||
|
if _, ok := <-clientClosed; !ok {
|
||||||
|
return
|
||||||
|
} else {
|
||||||
|
clientClosed <- struct{}{}
|
||||||
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
// 查看是否还有其他连接,没有则设置 is_play 为 0
|
// 查看是否还有其他连接,没有则设置 is_play 为 0
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue