ILiveRoom.ts 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269
  1. import { IArea, ILive, IUserLiveRoom } from '@/interface';
  2. import { IUser } from '@/types/IUser';
  3. /** 是否使用cdn */
  4. export enum LiveRoomUseCDNEnum {
  5. /** 使用cdn */
  6. yes,
  7. /** 不使用cdn */
  8. no,
  9. }
  10. /** 直播间类型 */
  11. export enum LiveRoomTypeEnum {
  12. /** 系统推流 */
  13. system,
  14. /** 主播使用srs推流 */
  15. srs,
  16. /** 主播使用obs/ffmpeg推流 */
  17. obs,
  18. /** 主播使用webrtc推流,直播 */
  19. wertc_live,
  20. /** 主播使用webrtc推流,会议,实现一 */
  21. wertc_meeting_one,
  22. /** 主播使用webrtc推流,会议,实现二 */
  23. wertc_meeting_two,
  24. /** 主播使用msr推流 */
  25. msr,
  26. /** 主播打pk */
  27. pk,
  28. /** 主播使用腾讯云css推流 */
  29. tencent_css,
  30. /** 主播使用腾讯云css推流打pk */
  31. tencent_css_pk,
  32. /** 转推b站 */
  33. forward_bilibili,
  34. /** 转推斗鱼 */
  35. forward_huya,
  36. /** 转推所有 */
  37. forward_all,
  38. }
  39. /** 拉流是否需要鉴权 */
  40. export enum LiveRoomPullIsShouldAuthEnum {
  41. /** 需要鉴权 */
  42. yes,
  43. /** 不需要鉴权 */
  44. no,
  45. }
  46. /** 直播间状态 */
  47. export enum LiveRoomStatusEnum {
  48. /** 正常 */
  49. normal,
  50. /** 禁用 */
  51. disable,
  52. }
  53. /** 直播间是否显示 */
  54. export enum LiveRoomIsShowEnum {
  55. /** 显示 */
  56. yes,
  57. /** 不显示 */
  58. no,
  59. }
  60. /** 直播间是否开启聊天 */
  61. export enum LiveRoomOpenChatEnum {
  62. yes,
  63. no,
  64. }
  65. /** 游客能否发言 */
  66. export enum LiveRoomTouristSendMsgEnum {
  67. yes,
  68. no,
  69. }
  70. /** 是否显示弹窗广告 */
  71. export enum LiveRoomIsShowAdEnum {
  72. yes,
  73. no,
  74. }
  75. /** 关闭房间 */
  76. export enum LiveRoomIsCloseEnum {
  77. yes,
  78. no,
  79. }
  80. /** 开启红包 */
  81. export enum LiveRoomIsShowRedbagEnum {
  82. yes,
  83. no,
  84. }
  85. /** 开启签到 */
  86. export enum LiveRoomIsShowSigninEnum {
  87. yes,
  88. no,
  89. }
  90. /** 开启手机看直播 */
  91. export enum LiveRoomIsShowPhoneLiveEnum {
  92. yes,
  93. no,
  94. }
  95. /** 是否显示直播间在线人数 */
  96. export enum LiveRoomIsShowLiveUserNumsEnum {
  97. yes,
  98. no,
  99. }
  100. /** 是否开启聊天审核 */
  101. export enum LiveRoomMsgVerifyEnum {
  102. yes,
  103. no,
  104. }
  105. /** 是否直播间视频底部的广告图 */
  106. export enum LiveRoomIsShowLiveVideoBottomImgEnum {
  107. yes,
  108. no,
  109. }
  110. /** 是否显示公众号二维码 */
  111. export enum LiveRoomIsShowOfficialAccountEnum {
  112. yes,
  113. no,
  114. }
  115. /** 是否开启转盘抽奖 */
  116. export enum LiveRoomIsShowTurntableEnum {
  117. yes,
  118. no,
  119. }
  120. /** 提醒游客登录 */
  121. export enum LiveRoomTipTouristLoginEnum {
  122. /** 关闭,即不提醒游客登录 */
  123. close,
  124. /** 开启提醒游客登录,游客可关闭 */
  125. open,
  126. /** 强制游客登录,即游客不可关闭 */
  127. force,
  128. }
  129. export interface ILiveRoom {
  130. id?: number;
  131. /** 直播间名称 */
  132. name?: string;
  133. /** 直播间简介 */
  134. desc?: string;
  135. /** 是否使用cdn */
  136. cdn?: LiveRoomUseCDNEnum;
  137. /** 拉流是否需要鉴权 */
  138. pull_is_should_auth?: LiveRoomPullIsShouldAuthEnum;
  139. /** 权重 */
  140. weight?: number;
  141. /** 推流秘钥 */
  142. key?: string;
  143. /** 直播间类型 */
  144. type?: LiveRoomTypeEnum;
  145. /** 开播预览图 */
  146. cover_img?: string;
  147. /** 直播间背景图 */
  148. bg_img?: string;
  149. /** 直播间状态 */
  150. status?: LiveRoomStatusEnum;
  151. /** 直播间是否显示 */
  152. is_show?: LiveRoomIsShowEnum;
  153. /** 直播间是否开启聊天 */
  154. open_chat?: LiveRoomOpenChatEnum;
  155. /** 提醒游客登录 */
  156. tip_tourist_login?: LiveRoomTipTouristLoginEnum;
  157. /** 提醒游客登录间隔 */
  158. tip_tourist_login_delay?: number;
  159. /** 游客能否发言 */
  160. tourist_send_msg?: LiveRoomTouristSendMsgEnum;
  161. /** 聊天关键词过滤 */
  162. keyword_filter_msg?: string;
  163. /** 用户名关键词过滤 */
  164. keyword_filter_username?: string;
  165. /** 历史消息条数 */
  166. history_msg_total?: number;
  167. /** 新注册用户不能发言时间(秒) */
  168. newuser_send_msg_delay?: number;
  169. /** 房间密码 */
  170. room_pwd?: string;
  171. /** 显示弹窗广告 */
  172. is_show_ad?: LiveRoomIsShowAdEnum;
  173. /** 弹窗广告图片 */
  174. ad_img_url?: string;
  175. /** 关闭房间 */
  176. is_close?: LiveRoomIsCloseEnum;
  177. /** 关闭房间描述 */
  178. is_close_desc?: string;
  179. /** 发送消息间隔(秒) */
  180. send_msg_throttle?: number;
  181. /** 公众号二维码 */
  182. official_account_img_url?: string;
  183. /** 是否显示公众号二维码 */
  184. is_show_official_account?: LiveRoomIsShowOfficialAccountEnum;
  185. /** 是否开启转盘抽奖 */
  186. is_show_turntable?: LiveRoomIsShowTurntableEnum;
  187. /** 是否开启红包 */
  188. is_show_redbag?: LiveRoomIsShowRedbagEnum;
  189. /** 是否开启签到 */
  190. is_show_signin?: LiveRoomIsShowSigninEnum;
  191. /** 是否开启手机看直播 */
  192. is_show_phone_live?: LiveRoomIsShowPhoneLiveEnum;
  193. /** 每天转盘抽奖次数 */
  194. turntable_num?: number;
  195. /** 公告 */
  196. announcement_msg?: string;
  197. /** 通知 */
  198. notice_msg?: string;
  199. /** 系统消息 */
  200. system_msg?: string;
  201. /** 显示直播间在线人数 */
  202. is_show_live_user_nums?: LiveRoomIsShowLiveUserNumsEnum;
  203. /** 设置直播间最低在线人数 */
  204. mock_live_user_nums_min?: number;
  205. /** 设置直播间最高在线人数 */
  206. mock_live_user_nums_max?: number;
  207. /** 直播间最在线人数刷新间隔 */
  208. mock_live_user_nums_refresh_delay?: number;
  209. /** 聊天审核 */
  210. msg_verify?: LiveRoomMsgVerifyEnum;
  211. /** 是否直播间视频底部的广告图 */
  212. is_show_live_video_bottom_img?: LiveRoomIsShowLiveVideoBottomImgEnum;
  213. /** 直播间视频底部的广告图 */
  214. live_video_bottom_img?: string;
  215. rtmp_url?: string;
  216. flv_url?: string;
  217. hls_url?: string;
  218. webrtc_url?: string;
  219. push_rtmp_url?: string;
  220. push_obs_server?: string;
  221. push_obs_stream_key?: string;
  222. push_webrtc_url?: string;
  223. push_srt_url?: string;
  224. forward_bilibili_url?: string;
  225. forward_douyu_url?: string;
  226. forward_huya_url?: string;
  227. forward_douyin_url?: string;
  228. forward_kuaishou_url?: string;
  229. forward_xiaohongshu_url?: string;
  230. /** 直播间备注 */
  231. remark?: string;
  232. /** 用户信息 */
  233. user?: IUser;
  234. /** 用户信息 */
  235. users?: IUser[];
  236. /** 分区信息 */
  237. area?: IArea;
  238. /** 分区信息 */
  239. areas?: IArea[];
  240. /** 直播信息 */
  241. live?: ILive;
  242. user_live_room?: IUserLiveRoom & { user: IUser };
  243. hidden_cover_img?: boolean;
  244. created_at?: string;
  245. updated_at?: string;
  246. deleted_at?: string;
  247. }