1 Star 0 Fork 1

IeatCW/plugin-room

forked from m7s/plugin-room 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

Room 插件

可以用于视频会议等,多人实时视频场景

插件地址

https://github.com/Monibuca/plugin-room

插件引入

    import (  _ "m7s.live/plugin/room/v4" )

配置

默认配置如下:

room:
  http: # 默认使用全局http配置
    listenaddr: :8080
    listenaddrtls: ""
    certfile: ""
    keyfile: ""
    cors: true
    username: ""
    password: ""
  appname: room # 房间用于广播数据的流的AppName(StreamPath=AppName/RoomID)
  size: 20 # 房间大小(最大人数)
  private: {} # 私密房间配置,key是房间ID,value是密码
  verify: # 入房验证远程请求
    url: ""
    method: ""
    header: {}

插件使用方式

通过WebSocket建立与本插件的连接,规则如下:

  • ws://localhost:8080/room/[roomID]/[userID] 建立连接,如果是私密房间,需要携带密码(?password=xxx)
  • 连接建立后,客户端接收到{"data":"4f8990a1-e7ae-4926-81b0-a3ab191c8e3b","event":"joined"}代表进房成功,data是token用于发布流时的参数
  • 进房后,可以通过WebSocket发送任意文本数据,该数据会被广播到房间内的其他用户(包括自己),格式:{"data":"abc","event":"msg","userId":"dexter"}
  • 在房间里面可以发布视频流,发布流的时候需要在StreamPath后面携带三个参数userId,roomId,token。
  • 当有用户发布流的时候,房间内其他人会收到事件:{"data":"[streamPath]","event":"publish","userId":"dexter"},用户可以选择订阅这个流
MIT License Copyright (c) 2022 Monibuca Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

暂无描述 展开 收起
Go
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/ieat/plugin-room.git
git@gitee.com:ieat/plugin-room.git
ieat
plugin-room
plugin-room
v4

搜索帮助

344bd9b3 5694891 D2dac590 5694891