@realsee/live 0.6.14 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (163) hide show
  1. package/README.md +50 -55
  2. package/dist/index.cjs.js +89 -24
  3. package/dist/index.d.cts +1336 -0
  4. package/dist/index.d.ts +1336 -4
  5. package/dist/index.esm.js +30 -0
  6. package/docs/README.md +435 -0
  7. package/docs/classes/BrowserRTC.md +436 -0
  8. package/docs/classes/BrowserRTC4Chime.md +558 -0
  9. package/docs/classes/CoreRTC.md +448 -0
  10. package/docs/classes/Live.md +797 -0
  11. package/docs/classes/Subscribe.md +211 -0
  12. package/docs/classes/VRWebViewRTC.md +436 -0
  13. package/docs/enumerations/BuiltInRTCType.md +27 -0
  14. package/docs/enumerations/BuiltinActionType.md +81 -0
  15. package/docs/enumerations/BuiltinEventType.md +33 -0
  16. package/docs/enumerations/Command.md +107 -0
  17. package/docs/enumerations/LiveState.md +53 -0
  18. package/docs/enumerations/MemUserStatus.md +67 -0
  19. package/docs/enumerations/MicroStatus.md +33 -0
  20. package/docs/enumerations/RTCJoinedInfoCodeEnum.md +69 -0
  21. package/docs/enumerations/RTCType.md +39 -0
  22. package/docs/enumerations/UserStatus.md +45 -0
  23. package/docs/enumerations/WebSocketCloseError.md +117 -0
  24. package/docs/enumerations/WebSocketErrorType.md +77 -0
  25. package/docs/enumerations/WebSocketState.md +69 -0
  26. package/docs/functions/GetVoiceSignFn.md +27 -0
  27. package/docs/functions/clearLiveInstanceIfNeed.md +17 -0
  28. package/docs/functions/createLive.md +27 -0
  29. package/docs/functions/createLiveReact.md +449 -0
  30. package/docs/functions/parseLiveMsg.md +27 -0
  31. package/docs/functions/parseWSClsErr.md +21 -0
  32. package/docs/globals.md +77 -0
  33. package/docs/interfaces/AttendeeResponse.md +37 -0
  34. package/docs/interfaces/LiveOptions.md +246 -0
  35. package/docs/interfaces/MeetingResponse.md +55 -0
  36. package/docs/interfaces/MeetingSessionConfigurationOptions.md +93 -0
  37. package/docs/interfaces/Permission.md +147 -0
  38. package/docs/interfaces/RTCJoinedInfo.md +67 -0
  39. package/docs/interfaces/RTCProtocol.md +404 -0
  40. package/docs/interfaces/VRWebViewRTCOptions.md +41 -0
  41. package/docs/namespaces/SubscribeMixinType/README.md +17 -0
  42. package/docs/namespaces/SubscribeMixinType/interfaces/emit.md +31 -0
  43. package/docs/namespaces/SubscribeMixinType/interfaces/hasListener.md +25 -0
  44. package/docs/namespaces/SubscribeMixinType/interfaces/off.md +31 -0
  45. package/docs/namespaces/SubscribeMixinType/interfaces/on.md +37 -0
  46. package/docs/namespaces/SubscribeMixinType/interfaces/once.md +35 -0
  47. package/docs/type-aliases/BuiltinMsg.md +41 -0
  48. package/docs/type-aliases/EventMap.md +17 -0
  49. package/docs/type-aliases/EventType.md +19 -0
  50. package/docs/type-aliases/GetVoiceSign.md +15 -0
  51. package/docs/type-aliases/GetVoiceSignParams.md +35 -0
  52. package/docs/type-aliases/GetVoiceSignReturnType.md +41 -0
  53. package/docs/type-aliases/KeyframeEventType.md +19 -0
  54. package/docs/type-aliases/LiveBuiltInData.md +47 -0
  55. package/docs/type-aliases/LiveConnectOptions.md +47 -0
  56. package/docs/type-aliases/LiveEventType.md +165 -0
  57. package/docs/type-aliases/LiveMsg.md +53 -0
  58. package/docs/type-aliases/LiveProviderPropTypes.md +27 -0
  59. package/docs/type-aliases/RTCActionReactCallback.md +13 -0
  60. package/docs/type-aliases/RTCEventType.md +65 -0
  61. package/docs/type-aliases/ReqLiveMsg.md +45 -0
  62. package/docs/type-aliases/RoomInfo.md +55 -0
  63. package/docs/type-aliases/UserInfo.md +77 -0
  64. package/docs/type-aliases/UserInfoExt.md +33 -0
  65. package/docs/type-aliases/UserVolume.md +25 -0
  66. package/docs/type-aliases/WebSocketError.md +31 -0
  67. package/package.json +41 -31
  68. package/dist/index.cjs.js.map +0 -1
  69. package/dist/index.es.js +0 -2179
  70. package/dist/index.es.js.map +0 -1
  71. package/dist/live/controller.d.ts +0 -90
  72. package/dist/live/createLive.d.ts +0 -8
  73. package/dist/live/createLiveReact.d.ts +0 -52
  74. package/dist/live/live.d.ts +0 -182
  75. package/dist/rtc/BrowserRTC.d.ts +0 -39
  76. package/dist/rtc/BrowserRTC4Chime.d.ts +0 -60
  77. package/dist/rtc/CoreRTC.d.ts +0 -23
  78. package/dist/rtc/VRWebViewRTC.d.ts +0 -22
  79. package/dist/rtc/index.d.ts +0 -5
  80. package/dist/typings/chime/AttendeeResponse.d.ts +0 -5
  81. package/dist/typings/chime/MeetingResponse.d.ts +0 -12
  82. package/dist/typings/chime/MeetingSessionConfigurationOptions.d.ts +0 -16
  83. package/dist/typings/chime/index.d.ts +0 -3
  84. package/dist/typings/index.d.ts +0 -4
  85. package/dist/typings/live/EventType.d.ts +0 -74
  86. package/dist/typings/live/GetVoiceSign.d.ts +0 -17
  87. package/dist/typings/live/LiveConnectOptions.d.ts +0 -7
  88. package/dist/typings/live/LiveMsg.d.ts +0 -119
  89. package/dist/typings/live/LiveOptions.d.ts +0 -79
  90. package/dist/typings/live/LiveState.d.ts +0 -15
  91. package/dist/typings/live/RoomInfo.d.ts +0 -13
  92. package/dist/typings/live/UserInfo.d.ts +0 -103
  93. package/dist/typings/live/UserVolume.d.ts +0 -7
  94. package/dist/typings/live/WebSocket.d.ts +0 -82
  95. package/dist/typings/live/index.d.ts +0 -10
  96. package/dist/typings/react/RTCActionReactCallback.d.ts +0 -2
  97. package/dist/typings/react/index.d.ts +0 -1
  98. package/dist/typings/rtc/VRWebViewRTCOptions.d.ts +0 -6
  99. package/dist/typings/rtc/eventType.d.ts +0 -29
  100. package/dist/typings/rtc/index.d.ts +0 -5
  101. package/dist/typings/rtc/joinedInfo.d.ts +0 -34
  102. package/dist/typings/rtc/protocol.d.ts +0 -58
  103. package/dist/typings/rtc/type.d.ts +0 -12
  104. package/dist/utils/RobustWebSocket.d.ts +0 -157
  105. package/dist/utils/appendUri.d.ts +0 -1
  106. package/dist/utils/clientDetector.d.ts +0 -4
  107. package/dist/utils/equal.d.ts +0 -10
  108. package/dist/utils/logger.d.ts +0 -16
  109. package/dist/utils/subscribe.d.ts +0 -75
  110. package/dist/utils/uuid.d.ts +0 -4
  111. package/docs/.nojekyll +0 -1
  112. package/docs/assets/highlight.css +0 -120
  113. package/docs/assets/main.js +0 -58
  114. package/docs/assets/search.js +0 -1
  115. package/docs/assets/style.css +0 -1280
  116. package/docs/classes/BrowserRTC.html +0 -561
  117. package/docs/classes/BrowserRTC4Chime.html +0 -602
  118. package/docs/classes/CoreRTC.html +0 -432
  119. package/docs/classes/VRWebViewRTC.html +0 -448
  120. package/docs/enums/BuiltInRTCType.html +0 -69
  121. package/docs/enums/BuiltinActionType.html +0 -112
  122. package/docs/enums/BuiltinEventType.html +0 -76
  123. package/docs/enums/Command.html +0 -118
  124. package/docs/enums/LiveState.html +0 -89
  125. package/docs/enums/MemUserStatus.html +0 -97
  126. package/docs/enums/MicroStatus.html +0 -72
  127. package/docs/enums/RTCJoinedInfoCodeEnum.html +0 -94
  128. package/docs/enums/RTCType.html +0 -79
  129. package/docs/enums/UserStatus.html +0 -85
  130. package/docs/enums/WebSocketCloseError.html +0 -139
  131. package/docs/enums/WebSocketErrorType.html +0 -104
  132. package/docs/enums/WebSocketState.html +0 -103
  133. package/docs/functions/createLive.html +0 -107
  134. package/docs/functions/createLiveReact.html +0 -575
  135. package/docs/functions/parseLiveMsg.html +0 -105
  136. package/docs/functions/parseWSClsErr.html +0 -99
  137. package/docs/index.html +0 -470
  138. package/docs/interfaces/AttendeeResponse.html +0 -80
  139. package/docs/interfaces/GetVoiceSignReturnType.html +0 -90
  140. package/docs/interfaces/LiveOptions.html +0 -272
  141. package/docs/interfaces/MeetingResponse.html +0 -90
  142. package/docs/interfaces/MeetingSessionConfigurationOptions.html +0 -119
  143. package/docs/interfaces/Permission.html +0 -157
  144. package/docs/interfaces/RTCJoinedInfo.html +0 -104
  145. package/docs/interfaces/RTCProtocol.html +0 -412
  146. package/docs/interfaces/VRWebViewRTCOptions.html +0 -73
  147. package/docs/modules.html +0 -148
  148. package/docs/types/BuiltinMsg.html +0 -108
  149. package/docs/types/EventType.html +0 -97
  150. package/docs/types/GetVoiceSign.html +0 -124
  151. package/docs/types/KeyframeTypes.html +0 -97
  152. package/docs/types/LiveConnectOptions.html +0 -107
  153. package/docs/types/LiveEventType.html +0 -272
  154. package/docs/types/LiveMsg.html +0 -113
  155. package/docs/types/LiveProviderPropTypes.html +0 -102
  156. package/docs/types/RTCActionReactCallback.html +0 -90
  157. package/docs/types/RTCEventType.html +0 -155
  158. package/docs/types/ReqLiveMsg.html +0 -114
  159. package/docs/types/RoomInfo.html +0 -114
  160. package/docs/types/UserInfo.html +0 -135
  161. package/docs/types/UserInfoExt.html +0 -105
  162. package/docs/types/UserVolume.html +0 -99
  163. package/docs/types/WebSocketError.html +0 -101
package/docs/index.html DELETED
@@ -1,470 +0,0 @@
1
- <!DOCTYPE html><html class="default" lang="en"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>如视 Live SDK</title><meta name="description" content="Documentation for 如视 Live SDK"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="assets/style.css"/><link rel="stylesheet" href="assets/highlight.css"/><link rel="stylesheet" href="assets/custom.css"/><script async src="assets/search.js" id="search-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os"</script><header class="tsd-page-toolbar">
2
- <div class="tsd-toolbar-contents container">
3
- <div class="table-cell" id="tsd-search" data-base=".">
4
- <div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><path d="M15.7824 13.833L12.6666 10.7177C12.5259 10.5771 12.3353 10.499 12.1353 10.499H11.6259C12.4884 9.39596 13.001 8.00859 13.001 6.49937C13.001 2.90909 10.0914 0 6.50048 0C2.90959 0 0 2.90909 0 6.49937C0 10.0896 2.90959 12.9987 6.50048 12.9987C8.00996 12.9987 9.39756 12.4863 10.5008 11.6239V12.1332C10.5008 12.3332 10.5789 12.5238 10.7195 12.6644L13.8354 15.7797C14.1292 16.0734 14.6042 16.0734 14.8948 15.7797L15.7793 14.8954C16.0731 14.6017 16.0731 14.1267 15.7824 13.833ZM6.50048 10.499C4.29094 10.499 2.50018 8.71165 2.50018 6.49937C2.50018 4.29021 4.28781 2.49976 6.50048 2.49976C8.71001 2.49976 10.5008 4.28708 10.5008 6.49937C10.5008 8.70852 8.71314 10.499 6.50048 10.499Z" fill="var(--color-text)"></path></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div>
5
- <div class="field">
6
- <div id="tsd-toolbar-links"></div></div>
7
- <ul class="results">
8
- <li class="state loading">Preparing search index...</li>
9
- <li class="state failure">The search index is not available</li></ul><a href="index.html" class="title">如视 Live SDK</a></div>
10
- <div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><rect x="1" y="3" width="14" height="2" fill="var(--color-text)"></rect><rect x="1" y="7" width="14" height="2" fill="var(--color-text)"></rect><rect x="1" y="11" width="14" height="2" fill="var(--color-text)"></rect></svg></a></div></div></header>
11
- <div class="container container-main">
12
- <div class="col-8 col-content">
13
- <div class="tsd-page-title">
14
- <h2>如视 Live SDK</h2></div>
15
- <div class="tsd-panel tsd-typography">
16
- <a href="#livejs" id="livejs" style="color: inherit; text-decoration: none;">
17
- <h1>Live.js</h1>
18
- </a>
19
- <p><a href="https://www.npmjs.com/package/@realsee/live"><img src="https://img.shields.io/npm/v/@realsee/live.svg?style=flat-square&logo=npm&label=npm%20install%20@realsee/live" alt="npm version"></a></p>
20
-
21
- <a href="#功能说明" id="功能说明" style="color: inherit; text-decoration: none;">
22
- <h2>功能说明</h2>
23
- </a>
24
- <p><strong>Live</strong> 是 <a href="https://developers.realsee.com/docs/#/docs/live/README">如视开发者中心 VRTC 服务</a> 的核心客户端 Web SDK,搭配 Live Container
25
- SDKs(iOS/Android/微信小程序)和 Live API 可以快速实现实时同屏、实时语音、IM 等功能。</p>
26
-
27
- <a href="#名词释义" id="名词释义" style="color: inherit; text-decoration: none;">
28
- <h3>名词释义</h3>
29
- </a>
30
- <ul>
31
- <li><strong>帧数据(Keyframe)</strong>: 指用户界面需同屏交互信息的状态数据的集合。</li>
32
- </ul>
33
- <blockquote>
34
- <p>通常以键值对的形式表现——键为界面模块名字,值为该模块的状态信息。<br>比如帧数据 <code>{&quot;popupPanel&quot;: { hidden: true }}</code> 表示界面交互中有个弹窗面板,我们命名为<code>popupPanel</code>,它有个<code>hidden</code>状态,<code>true</code>表示其正处于隐藏状态。</p>
35
- </blockquote>
36
- <ul>
37
- <li><strong>快照(Snapshot)</strong>: 指某个时刻所有 <strong>帧数据</strong> 的集合。</li>
38
- </ul>
39
- <blockquote>
40
- <p>您可以理解 <strong>帧数据</strong> 是 <strong>快照</strong> 的子集,通过某时刻的&quot;快照&quot;信息能够还原该时刻的用户界面所有状态。</p>
41
- </blockquote>
42
- <ul>
43
- <li><strong>RTC</strong>: Real-Time Communication, 在本文中则特指渲染 HTML 页面的 WebView/Browser 等容器的音视频实时通信能力。</li>
44
- </ul>
45
- <blockquote>
46
- <p>需注意的是 <strong>Live</strong> 并不包含 <strong>RTC</strong> 功能的实现,需借助客户端原生能力的支持。更多细节详见后文 <a href="#rtc-%E5%8D%8F%E8%AE%AE">RTC 协议</a> 部分。</p>
47
- </blockquote>
48
-
49
- <a href="#快速上手" id="快速上手" style="color: inherit; text-decoration: none;">
50
- <h2>快速上手</h2>
51
- </a>
52
-
53
- <a href="#安装-sdk" id="安装-sdk" style="color: inherit; text-decoration: none;">
54
- <h3>安装 SDK</h3>
55
- </a>
56
- <p>可以通过 Node 包管理工具 <a href="https://www.npmjs.com/">npm</a> 或 <a href="https://yarnpkg.com/">yarn</a> 安装<strong>Live</strong>:</p>
57
- <pre><code class="hljs language-bash"><span class="hl-0"># npm</span><br/><span class="hl-1">npm </span><span class="hl-2">i</span><span class="hl-1"> </span><span class="hl-2">@realsee/live</span><br/><span class="hl-0"># yarn</span><br/><span class="hl-1">yarn </span><span class="hl-2">add</span><span class="hl-1"> </span><span class="hl-2">@realsee/live</span>
58
- </code></pre>
59
-
60
- <a href="#如何使用" id="如何使用" style="color: inherit; text-decoration: none;">
61
- <h3>如何使用</h3>
62
- </a>
63
- <p>简单使用样例(先不考虑实时语音能力):</p>
64
- <pre><code class="hljs language-js"><span class="hl-3">import</span><span class="hl-1"> { </span><span class="hl-4">createLive</span><span class="hl-1"> } </span><span class="hl-3">from</span><span class="hl-1"> </span><span class="hl-2">&#39;@realsee/live&#39;</span><span class="hl-1">;</span><br/><br/><span class="hl-5">const</span><span class="hl-1"> </span><span class="hl-6">live</span><span class="hl-1"> = </span><span class="hl-7">createLive</span><span class="hl-1">({</span><br/><span class="hl-1"> </span><span class="hl-4">url:</span><span class="hl-1"> </span><span class="hl-2">&#39;wss://ws-access.realsee.com/***/?=xxx&#39;</span><span class="hl-1"> </span><span class="hl-0">/* 连接 WebSocket 服务的 URL */</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-7">getTicket</span><span class="hl-4">:</span><span class="hl-1"> </span><span class="hl-5">async</span><span class="hl-1"> () </span><span class="hl-5">=&gt;</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-0">/* 获取带看&quot;门票&quot;的回调函数 */</span><br/><span class="hl-1"> },</span><br/><span class="hl-1">});</span>
65
- </code></pre>
66
- <p>在创建 <code>live</code> 实例时配置了两个参数:</p>
67
- <ul>
68
- <li><code>url</code>:连接 WebSocket 服务的 URL,如果在创建 <code>live</code> 实例阶段并不知道 URL ,您可以在合适的时机通过 <code>live.connect({ url })</code> 方法进行 WebScoket 连接。</li>
69
- <li><code>getTicket()</code>:是一个异步回调函数,其返回值是连接 WebScoket 服务的 **&quot;门票&quot;**,关于如何获取 <code>ticket</code> 请查阅 <a href="">VR 带看 API</a>。</li>
70
- </ul>
71
- <blockquote>
72
- <p>关于 <code>createLive()</code> 函数的更多参数配置请参考 <a href="https://unpkg.com/@realsee/live/docs/interfaces/live.LiveOptions.html">LiveOptions</a> 。</p>
73
- </blockquote>
74
- <p>获取实例 <code>live</code> 之后,可以做很多有趣的事情。但在讲述详细用途之前,先简单介绍下 <strong>Live</strong> 中的 <strong>消息系统</strong>。</p>
75
-
76
- <a href="#消息系统" id="消息系统" style="color: inherit; text-decoration: none;">
77
- <h2>消息系统</h2>
78
- </a>
79
- <p><strong>Live</strong> 核心职责是借助 WebSocket 长链双工通信能力实现多端用户的同屏连线。用户间的通信都是基于 WebSocket 消息。</p>
80
- <p><strong>Live</strong> 将消息分为<code>帧数据</code>、<code>广播</code>、<code>房间信息</code>三类。针对每一类信息提供相应的发送、接收 API,更多 API
81
- 细节请参考 <a href="https://unpkg.com/@realsee/live/docs/index.html">Live API 文档</a> 。</p>
82
- <p><strong>帧数据</strong> 是进行同屏的信息载体,由用户自行定义当前场景中哪些信息用以同屏,将这些信息组织成 <code>{key: value}</code> 的形式即可。</p>
83
- <p><strong>广播消息</strong> 用以房间成员之间以事件的形式指定某个用户向其发送自定义广播消息。如:主持人向观众发送问候消息。</p>
84
- <p><strong>房间信息</strong> 为内置消息体,由 WebSocket 服务主动推送,包括房间状态、当前用户及参与用户列表等。部分信息也可通过 <strong>Live</strong> 提供的更新方式进行修改。</p>
85
-
86
- <a href="#帧数据同步" id="帧数据同步" style="color: inherit; text-decoration: none;">
87
- <h3>帧数据同步</h3>
88
- </a>
89
- <p>当前 UI 交互状态的同步:</p>
90
- <p>以 <a href="https://developers.realsee.com/docs/#/docs/five/web/quickstart">Five</a> 同屏为例</p>
91
- <pre><code class="hljs language-js"><span class="hl-0">// 发送本地 帧数据 (Five State)</span><br/><span class="hl-4">live</span><span class="hl-1">.</span><span class="hl-7">sendKeyframe</span><span class="hl-1">(</span><span class="hl-2">&#39;five&#39;</span><span class="hl-1">, { </span><span class="hl-4">panoIndex:</span><span class="hl-1"> </span><span class="hl-8">13</span><span class="hl-1"> });</span><br/><br/><span class="hl-0">// 接收远程 帧数据 (Five State)</span><br/><span class="hl-4">live</span><span class="hl-1">.</span><span class="hl-4">keyframes</span><span class="hl-1">.</span><span class="hl-7">on</span><span class="hl-1">(</span><span class="hl-2">&#39;five&#39;</span><span class="hl-1">, (</span><span class="hl-4">newState</span><span class="hl-1">, </span><span class="hl-4">prevState</span><span class="hl-1">) </span><span class="hl-5">=&gt;</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-0">// 可以拿最新的 `newState` 更新本地 UI 状态</span><br/><span class="hl-1">});</span>
92
- </code></pre>
93
- <p>您也可以通过 <code>live.snapshot</code> 属性来获取当前所有序列帧数据的&quot;快照&quot;。</p>
94
-
95
- <a href="#房间信息" id="房间信息" style="color: inherit; text-decoration: none;">
96
- <h3>房间信息</h3>
97
- </a>
98
- <p><strong>Live</strong> 有会话房间的概念,当您成功连接 WebSocket 服务之后等同于您作为一个用户加入了一个房间。此房间用户除了您之外还会有其他用户,您可以通过如下方式获取或更新用户信息:</p>
99
- <pre><code class="hljs language-js"><span class="hl-0">// 属性:获取本地用户信息</span><br/><span class="hl-4">live</span><span class="hl-1">.</span><span class="hl-4">selfInfo</span><span class="hl-1">;</span><br/><br/><span class="hl-0">// 属性:获取当前房间内所有用户列表</span><br/><span class="hl-4">live</span><span class="hl-1">.</span><span class="hl-4">userList</span><span class="hl-1">;</span><br/><br/><span class="hl-0">// 方法:更新本地用户信息</span><br/><span class="hl-4">live</span><span class="hl-1">.</span><span class="hl-7">setSelfInfo</span><span class="hl-1">({});</span><br/><br/><span class="hl-0">// 事件:本地用户信息发生变更</span><br/><span class="hl-4">live</span><span class="hl-1">.</span><span class="hl-7">on</span><span class="hl-1">(</span><span class="hl-2">&#39;selfInfoUpdate&#39;</span><span class="hl-1">, (</span><span class="hl-4">userInfo</span><span class="hl-1">) </span><span class="hl-5">=&gt;</span><span class="hl-1"> {});</span><br/><br/><span class="hl-0">// 事件:房间用户列表信息发生变更</span><br/><span class="hl-4">live</span><span class="hl-1">.</span><span class="hl-7">on</span><span class="hl-1">(</span><span class="hl-2">&#39;userListUpdate&#39;</span><span class="hl-1">, (</span><span class="hl-4">userList</span><span class="hl-1">) </span><span class="hl-5">=&gt;</span><span class="hl-1"> {});</span>
100
- </code></pre>
101
-
102
- <a href="#广播消息" id="广播消息" style="color: inherit; text-decoration: none;">
103
- <h3>广播消息</h3>
104
- </a>
105
- <p>除了帧数据和房间信息之外,还可以用事件的形式向房间内的其他用户广播消息:</p>
106
- <pre><code class="hljs language-js"><span class="hl-4">live</span><span class="hl-1">.</span><span class="hl-7">broadcast</span><span class="hl-1">(</span><br/><span class="hl-1"> </span><span class="hl-4">data</span><span class="hl-1"> </span><span class="hl-0">/* 广播的数据 */</span><span class="hl-1">,</span><br/><span class="hl-1"> [</span><span class="hl-2">&#39;user_id_1&#39;</span><span class="hl-1">, </span><span class="hl-2">&#39;user_id_2&#39;</span><span class="hl-1">] </span><span class="hl-0">/* 收到此用户的userId */</span><span class="hl-1">,</span><br/><span class="hl-1">);</span>
107
- </code></pre>
108
- <p>此时,房间内用户 Id 为 <code>user_id_1</code>、<code>user_id_2</code> 的用户会收到此广播消息(其他用户无感知):</p>
109
- <pre><code class="hljs language-js"><span class="hl-4">live</span><span class="hl-1">.</span><span class="hl-7">on</span><span class="hl-1">(</span><span class="hl-2">&#39;broadcast&#39;</span><span class="hl-1">, (</span><span class="hl-4">data</span><span class="hl-1"> </span><span class="hl-0">/* 广播的数据 */</span><span class="hl-1">) </span><span class="hl-5">=&gt;</span><span class="hl-1"> {});</span>
110
- </code></pre>
111
- <p>更多的例子请查看 <a href="https://unpkg.com/@realsee/live/docs/index.html">Live API</a> 文档 。</p>
112
-
113
- <a href="#事件监听" id="事件监听" style="color: inherit; text-decoration: none;">
114
- <h2>事件监听</h2>
115
- </a>
116
- <p><strong>Live</strong> 提供 <code>WebSocket 事件</code>、<code>live 事件</code> 和 <code>RTC 事件</code> 三类异步事件的监听。</p>
117
- <p>其中, <code>WebSocket 事件</code>、<code>live 事件</code> 都可以通过 <code>live.on(&#39;/*事件名*/&#39;, /*事件回调*/)</code> 的方式监听。</p>
118
- <p>比如监听 WebSocket 状态发生变更:</p>
119
- <pre><code class="hljs language-ts"><span class="hl-4">live</span><span class="hl-1">.</span><span class="hl-7">on</span><span class="hl-1">(</span><span class="hl-2">&#39;ws.readyStateUpdate&#39;</span><span class="hl-1">, (</span><span class="hl-4">readyState</span><span class="hl-1">: </span><span class="hl-9">WebSocketState</span><span class="hl-1">) </span><span class="hl-5">=&gt;</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-4">console</span><span class="hl-1">.</span><span class="hl-7">log</span><span class="hl-1">(</span><span class="hl-4">readyState</span><span class="hl-1">); </span><span class="hl-0">// readyState 即是最新的 WebScoket 状态</span><br/><span class="hl-1">});</span>
120
- </code></pre>
121
-
122
- <a href="#websocket-事件" id="websocket-事件" style="color: inherit; text-decoration: none;">
123
- <h3>WebSocket 事件</h3>
124
- </a>
125
- <ul>
126
- <li><p><code>ws.beforeConnect(reConnect?: number): void</code> WebSocket 完成连接之后。</p>
127
- </li>
128
- <li><p><code>ws.afterConnect(reConnect?: number): void</code> WebSocket 完成连接之前。</p>
129
- </li>
130
- <li><p><code>ws.readyStateUpdate(readyState: WebSocketState): void</code> WebSocket 完成状态发生变更。</p>
131
- </li>
132
- </ul>
133
- <p><strong>WebSocket 连接状态枚举表:</strong></p>
134
- <table>
135
- <thead>
136
- <tr>
137
- <th>状态名称</th>
138
- <th>状态描述</th>
139
- </tr>
140
- </thead>
141
- <tbody><tr>
142
- <td>NOTINITIALIZED</td>
143
- <td>未被初始化</td>
144
- </tr>
145
- <tr>
146
- <td>CONNECTING</td>
147
- <td>正在连接中</td>
148
- </tr>
149
- <tr>
150
- <td>OPEN</td>
151
- <td>连接成功</td>
152
- </tr>
153
- <tr>
154
- <td>CLOSING</td>
155
- <td>关闭中</td>
156
- </tr>
157
- <tr>
158
- <td>CLOSED</td>
159
- <td>关闭成功</td>
160
- </tr>
161
- </tbody></table>
162
- <p><strong>Live</strong> 前后端服务交互是基于 WebSocket 长链接的。一次带看成功进入、退出的标识由 WebSocket 的状态 <code>OPEN</code>、<code>CLOSED</code>体现。 因此,所有 <strong>VRTC</strong> 相关的事件处理逻辑应保证在<code>OPEN</code>
163
- 事件之后进行。</p>
164
-
165
- <a href="#live-事件" id="live-事件" style="color: inherit; text-decoration: none;">
166
- <h3>live 事件</h3>
167
- </a>
168
- <ul>
169
- <li><p><code>broadcast(evtMsg: Record&lt;string, any&gt;, frontRequestId: string): void</code> 接收其他用户的广播消息。</p>
170
- </li>
171
- <li><p><code>builtinEvent(builtinMsg: BuiltinMsg): void</code> 接收服务端推送的内置事件消息。</p>
172
- </li>
173
- <li><p><code>keyframes(keyframes: Partial&lt;Snapshot&gt;, frontRequestId: string): void</code> 接收其他用户的帧数据。</p>
174
- </li>
175
- <li><p><code>readyKeyframeSync(lastKeyframe: Partial&lt;Snapshot&gt;): void</code> 表明帧同步行为已就绪。</p>
176
- </li>
177
- <li><p><code>selfInfoUpdate(userInfo: UserInfo, frontRequestId: string): void</code> 自身的信息发生变更。</p>
178
- </li>
179
- <li><p><code>userListUpdate(userList: UserInfo[], frontRequestId: string): void</code> 用户列信息表发生变更。</p>
180
- </li>
181
- </ul>
182
- <p><code>live</code> 实例提供了很多诸如<code>live.connect()</code>、<code>live.broadcast()</code>、<code>live.sendKeyframe()</code>等方法,这些方法都是异步反馈且可能会影响房间内的其他用户。
183
- 您可以通过监听以上事件来获知这些影响。</p>
184
- <p>需要注意的是 <code>readyKeyframeSync</code> 事件是可进行帧同步的节点标识,收到此事件后您的帧同步行为才生效。</p>
185
-
186
- <a href="#rtc-事件" id="rtc-事件" style="color: inherit; text-decoration: none;">
187
- <h3>RTC 事件</h3>
188
- </a>
189
- <ul>
190
- <li><p><code>error(error: Error): void</code> 异常事件。</p>
191
- </li>
192
- <li><p><code>initWillStart(): void</code> 即将初始化事件。</p>
193
- </li>
194
- <li><p><code>inited(): void</code> 初始化完成事件。</p>
195
- </li>
196
- <li><p><code>joinWillStart(): void</code> 即将加入语音房间事件。</p>
197
- </li>
198
- <li><p><code>joined(): void</code> 成功加入语音房间事件。</p>
199
- </li>
200
- <li><p><code>userVolumes(userVolumes: UserVolume[]): void</code> 房间内每个说话用户的音量。</p>
201
- </li>
202
- <li><p><code>weakNetwork(): void</code> 弱网提醒事件。</p>
203
- </li>
204
- </ul>
205
- <p><code>live.$RTC</code> 实例需满足 <a href="">RTC 协议</a>,其事件通过 <code>live.$RTC.on(&#39;/*事件名*/&#39;, /*事件回调*/)</code> 方式来监听,比如监听语音房间内正在说话的用户及其音量:</p>
206
- <pre><code class="hljs language-ts"><span class="hl-4">live</span><span class="hl-1">.</span><span class="hl-4">$RTC</span><span class="hl-1">.</span><span class="hl-7">on</span><span class="hl-1">(</span><span class="hl-2">&#39;userVolumes&#39;</span><span class="hl-1">, (</span><span class="hl-4">userVolumes</span><span class="hl-1">: </span><span class="hl-9">UserVolume</span><span class="hl-1">[]) </span><span class="hl-5">=&gt;</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-4">console</span><span class="hl-1">.</span><span class="hl-7">log</span><span class="hl-1">(</span><span class="hl-4">userVolumes</span><span class="hl-1">); </span><span class="hl-0">// userVolumes 正在说话的用户及其音量数据。</span><br/><span class="hl-1">});</span>
207
- </code></pre>
208
-
209
- <a href="#异常处理" id="异常处理" style="color: inherit; text-decoration: none;">
210
- <h3>异常处理</h3>
211
- </a>
212
- <ul>
213
- <li><code>ws.error(error: WebSocketError): void</code> WebSocket 连接出现异常。</li>
214
- </ul>
215
- <p><strong>WebSocket 错误状态枚举表:</strong></p>
216
- <table>
217
- <thead>
218
- <tr>
219
- <th>错误字段</th>
220
- <th>错误描述</th>
221
- <th>触发场景</th>
222
- </tr>
223
- </thead>
224
- <tbody><tr>
225
- <td>Close</td>
226
- <td>错误类型枚举参照<a href="https://developer.mozilla.org/zh-CN/docs/Web/API/CloseEvent">CloseEvent</a></td>
227
- <td>错误原因参照<a href="https://developer.mozilla.org/zh-CN/docs/Web/API/CloseEvent">CloseEvent</a></td>
228
- </tr>
229
- <tr>
230
- <td>Error</td>
231
- <td></td>
232
- <td></td>
233
- </tr>
234
- <tr>
235
- <td>MicroAuth</td>
236
- <td>麦克风授权错误</td>
237
- <td>语音功能获取麦克风授权失败</td>
238
- </tr>
239
- <tr>
240
- <td>DuplicateConnect</td>
241
- <td>重复连接</td>
242
- <td>使用相同的 WS 链接申请连接</td>
243
- </tr>
244
- <tr>
245
- <td>IllegalURL</td>
246
- <td>非法的 WS 链接</td>
247
- <td>传入的 WS 链接不合法</td>
248
- </tr>
249
- <tr>
250
- <td>Unknown</td>
251
- <td>未知错误</td>
252
- <td>其他未被枚举的错误原样返回</td>
253
- </tr>
254
- </tbody></table>
255
- <ul>
256
- <li><code>error(liveMsg: LiveMsg): void</code> 服务端推送出现异常。</li>
257
- </ul>
258
- <p>与 WebSocket 通信的结构体<code>LiveMsg</code>格式如下:</p>
259
- <table>
260
- <thead>
261
- <tr>
262
- <th>名称</th>
263
- <th>类型</th>
264
- <th>描述</th>
265
- </tr>
266
- </thead>
267
- <tbody><tr>
268
- <td>appId</td>
269
- <td>string</td>
270
- <td></td>
271
- </tr>
272
- <tr>
273
- <td>code</td>
274
- <td>string</td>
275
- <td>返回码,详情参照<a href="https://developers.realsee.com/docs/#/docs/live/server/README">服务端 API Code 码表</a></td>
276
- </tr>
277
- <tr>
278
- <td>command</td>
279
- <td>指令</td>
280
- <td>WebSocket 通信指令类型,详情请查看<a href="https://unpkg.com/@realsee/live/docs/index.html">Live API</a> 文档</td>
281
- </tr>
282
- <tr>
283
- <td>data</td>
284
- <td>Record&lt;string, any&gt;</td>
285
- <td>本条指令对应的业务数据</td>
286
- </tr>
287
- <tr>
288
- <td>frontRequestId:</td>
289
- <td>string</td>
290
- <td>前端的请求 ID,由 WS 服务原样透传回前端</td>
291
- </tr>
292
- <tr>
293
- <td>message</td>
294
- <td>string</td>
295
- <td>返回描述</td>
296
- </tr>
297
- <tr>
298
- <td>requestId</td>
299
- <td>string</td>
300
- <td>后端请求 ID</td>
301
- </tr>
302
- <tr>
303
- <td>roomCode</td>
304
- <td>string</td>
305
- <td>带看房间号</td>
306
- </tr>
307
- <tr>
308
- <td>triggerUserId</td>
309
- <td>string</td>
310
- <td>触发指令的用户 ID</td>
311
- </tr>
312
- </tbody></table>
313
- <p>当 WebSocket 推送的数据结构体不满足 <code>LiveMsg</code> 或者 <code>code</code> 值不为 <code>SUCCESS</code> 时会以 <code>error</code> 事件的形式抛出来。</p>
314
- <ul>
315
- <li><code>error(error: Error): void</code> RTC 语音出现异常。</li>
316
- </ul>
317
- <blockquote>
318
- <p>RTC 语音不同容器或 RTC 解决方案不同,其错误信息内容可能不完全一致。</p>
319
- </blockquote>
320
-
321
- <a href="#rtc-协议" id="rtc-协议" style="color: inherit; text-decoration: none;">
322
- <h2>RTC 协议</h2>
323
- </a>
324
- <p>语音能力需依赖 WebView/Browser 容器,即需要容器端实现 RTC 能力。</p>
325
- <p>为了方便开发者接入,<strong>如视开发者中心 VRTC 服务</strong> 为主流平台提供 <a href="https://developers.realsee.com/docs/#/docs/live/client/container/README">容器 SDK</a>
326
- 和 <a href="https://www.npmjs.com/package/@realsee/jsbridge-x">jsbridge-x</a> 。</p>
327
- <p><strong>Live</strong> 通过 <strong>jsbridge-x</strong> 与 集成了<strong>容器 SDK</strong> 的客户端应用或微信小程序应用程序桥接,实现原生能力的调用。这个 <code>jsbridge-x</code>
328
- 实例需作为配置参数提供给<code>createLive()</code>。</p>
329
- <p>如果是 iOS/Android App(已接入如视 VRTC 容器 SDK)</p>
330
- <pre><code class="hljs language-js"><span class="hl-3">import</span><span class="hl-1"> </span><span class="hl-4">JSBridge</span><span class="hl-1"> </span><span class="hl-3">from</span><span class="hl-1"> </span><span class="hl-2">&#39;@realsee/jsbridge-x&#39;</span><span class="hl-1">;</span><br/><span class="hl-3">import</span><span class="hl-1"> { </span><span class="hl-4">createLive</span><span class="hl-1">, </span><span class="hl-4">VRWebViewRTC</span><span class="hl-1"> } </span><span class="hl-3">from</span><span class="hl-1"> </span><span class="hl-2">&#39;@realsee/live&#39;</span><span class="hl-1">;</span><br/><br/><span class="hl-5">const</span><span class="hl-1"> </span><span class="hl-6">jsBridgeInstance</span><span class="hl-1"> = </span><span class="hl-5">new</span><span class="hl-1"> </span><span class="hl-7">JSBridge</span><span class="hl-1">();</span><br/><br/><span class="hl-5">const</span><span class="hl-1"> </span><span class="hl-6">rtcInstance</span><span class="hl-1"> = </span><span class="hl-5">new</span><span class="hl-1"> </span><span class="hl-7">VRWebViewRTC</span><span class="hl-1">({</span><br/><span class="hl-1"> </span><span class="hl-4">jsBridge</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-7">getVoiceSign</span><span class="hl-4">:</span><span class="hl-1"> () </span><span class="hl-5">=&gt;</span><span class="hl-1"> {},</span><br/><span class="hl-1">});</span><br/><br/><span class="hl-5">const</span><span class="hl-1"> </span><span class="hl-6">live</span><span class="hl-1"> = </span><span class="hl-7">createLive</span><span class="hl-1">({</span><br/><span class="hl-1"> </span><span class="hl-4">rtc:</span><span class="hl-1"> </span><span class="hl-4">rtcInstance</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-7">getTicket</span><span class="hl-4">:</span><span class="hl-1"> </span><span class="hl-5">async</span><span class="hl-1"> () </span><span class="hl-5">=&gt;</span><span class="hl-1"> </span><span class="hl-2">&#39;&#39;</span><span class="hl-1">,</span><br/><span class="hl-1">});</span>
331
- </code></pre>
332
- <p>提供 RTC 实例配置参数之后,语音的连接、断开、重连等逻辑就托管给了 <strong>Live</strong> 。您可以通过 live 实例上的 <code>$RTC</code> 命名空间访问语音相关的状态和事件。</p>
333
- <pre><code class="hljs language-js"><span class="hl-0">// 状态:用户是否成功加入语音房间</span><br/><span class="hl-4">live</span><span class="hl-1">.</span><span class="hl-4">$RTC</span><span class="hl-1">.</span><span class="hl-4">joined</span><span class="hl-1">;</span><br/><span class="hl-0">// 状态:用户麦克风状态</span><br/><span class="hl-4">live</span><span class="hl-1">.</span><span class="hl-4">$RTC</span><span class="hl-1">.</span><span class="hl-4">micro</span><span class="hl-1">;</span><br/><span class="hl-0">// 监听用户音量变化</span><br/><span class="hl-4">live</span><span class="hl-1">.</span><span class="hl-4">$RTC</span><span class="hl-1">.</span><span class="hl-7">on</span><span class="hl-1">(</span><span class="hl-2">&#39;userVolumes&#39;</span><span class="hl-1">, (</span><span class="hl-4">userVolumes</span><span class="hl-1">) </span><span class="hl-5">=&gt;</span><span class="hl-1"> {});</span>
334
- </code></pre>
335
-
336
- <a href="#浏览器端支持" id="浏览器端支持" style="color: inherit; text-decoration: none;">
337
- <h2>浏览器端支持</h2>
338
- </a>
339
- <p>不同于客户端(Android\iOS) 已经内置 <strong>RTC</strong> 能力,浏览器端需要我们自己安装 第三方 <strong>RTC SDK</strong> 依赖。 <strong>Live</strong> 内置 腾讯<a href="https://github.com/tencentyun/TRTCSDK/blob/HEAD/Web/README-zh_CN.md">TRTC</a> 和 亚马逊<a href="https://github.com/aws/amazon-chime-sdk-js">Chime</a> 两个语音能力集成实现。</p>
340
- <blockquote>
341
- <p>纯浏览器端不需要 <strong>Native</strong> 中转能力,没有 <strong>jsBridge</strong> 依赖。</p>
342
- </blockquote>
343
-
344
- <a href="#trtc" id="trtc" style="color: inherit; text-decoration: none;">
345
- <h3>TRTC</h3>
346
- </a>
347
- <p>安装依赖:</p>
348
- <pre><code class="hljs language-shell"><span class="hl-0"># 需要您自行安装</span><br/><span class="hl-1">yarn </span><span class="hl-2">add</span><span class="hl-1"> </span><span class="hl-2">trtc-js-sdk</span>
349
- </code></pre>
350
- <p>使用方式:</p>
351
- <pre><code class="hljs language-tsx"><span class="hl-3">import</span><span class="hl-1"> { </span><span class="hl-4">createLive</span><span class="hl-1">, </span><span class="hl-4">BrowserRTC</span><span class="hl-1"> } </span><span class="hl-3">from</span><span class="hl-1"> </span><span class="hl-2">&#39;@realsee/live&#39;</span><span class="hl-1">;</span><br/><br/><span class="hl-5">const</span><span class="hl-1"> </span><span class="hl-6">rtcInstance</span><span class="hl-1"> = </span><span class="hl-5">new</span><span class="hl-1"> </span><span class="hl-7">VRWebViewRTC</span><span class="hl-1">({</span><br/><span class="hl-1"> </span><span class="hl-7">getVoiceSign</span><span class="hl-4">:</span><span class="hl-1"> () </span><span class="hl-5">=&gt;</span><span class="hl-1"> {},</span><br/><span class="hl-1">});</span><br/><br/><span class="hl-5">const</span><span class="hl-1"> </span><span class="hl-6">live</span><span class="hl-1"> = </span><span class="hl-7">createLive</span><span class="hl-1">({</span><br/><span class="hl-1"> </span><span class="hl-4">rtc:</span><span class="hl-1"> </span><span class="hl-4">rtcInstance</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-7">getTicket</span><span class="hl-4">:</span><span class="hl-1"> </span><span class="hl-5">async</span><span class="hl-1"> () </span><span class="hl-5">=&gt;</span><span class="hl-1"> </span><span class="hl-2">&#39;&#39;</span><span class="hl-1">,</span><br/><span class="hl-1">});</span>
352
- </code></pre>
353
-
354
- <a href="#chime" id="chime" style="color: inherit; text-decoration: none;">
355
- <h3>Chime</h3>
356
- </a>
357
- <p>安装依赖:</p>
358
- <pre><code class="hljs language-shell"><span class="hl-0"># 需要您自行安装</span><br/><span class="hl-1">yarn </span><span class="hl-2">add</span><span class="hl-1"> </span><span class="hl-2">amazon-chime-sdk-js</span>
359
- </code></pre>
360
- <p>使用方式:</p>
361
- <pre><code class="hljs language-tsx"><span class="hl-3">import</span><span class="hl-1"> { </span><span class="hl-4">createLive</span><span class="hl-1">, </span><span class="hl-4">BrowserRTC4Chime</span><span class="hl-1"> } </span><span class="hl-3">from</span><span class="hl-1"> </span><span class="hl-2">&#39;@realsee/live&#39;</span><span class="hl-1">;</span><br/><br/><span class="hl-5">const</span><span class="hl-1"> </span><span class="hl-6">rtcInstance</span><span class="hl-1"> = </span><span class="hl-5">new</span><span class="hl-1"> </span><span class="hl-7">BrowserRTC4Chime</span><span class="hl-1">({</span><br/><span class="hl-1"> </span><span class="hl-7">getVoiceSign</span><span class="hl-4">:</span><span class="hl-1"> () </span><span class="hl-5">=&gt;</span><span class="hl-1"> {},</span><br/><span class="hl-1">});</span><br/><br/><span class="hl-5">const</span><span class="hl-1"> </span><span class="hl-6">live</span><span class="hl-1"> = </span><span class="hl-7">createLive</span><span class="hl-1">({</span><br/><span class="hl-1"> </span><span class="hl-4">rtc:</span><span class="hl-1"> </span><span class="hl-4">rtcInstance</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-7">getTicket</span><span class="hl-4">:</span><span class="hl-1"> </span><span class="hl-5">async</span><span class="hl-1"> () </span><span class="hl-5">=&gt;</span><span class="hl-1"> </span><span class="hl-2">&#39;&#39;</span><span class="hl-1">,</span><br/><span class="hl-1">});</span>
362
- </code></pre>
363
-
364
- <a href="#使用内置的-jsbridge-和-rtc-实现" id="使用内置的-jsbridge-和-rtc-实现" style="color: inherit; text-decoration: none;">
365
- <h3>使用内置的 JsBridge 和 RTC 实现</h3>
366
- </a>
367
- <p>使用方式:</p>
368
- <pre><code class="hljs language-tsx"><span class="hl-3">import</span><span class="hl-1"> { </span><span class="hl-4">createLive</span><span class="hl-1"> } </span><span class="hl-3">from</span><span class="hl-1"> </span><span class="hl-2">&#39;@realsee/live&#39;</span><span class="hl-1">;</span><br/><br/><span class="hl-5">const</span><span class="hl-1"> </span><span class="hl-6">live</span><span class="hl-1"> = </span><span class="hl-7">createLive</span><span class="hl-1">({</span><br/><span class="hl-1"> </span><span class="hl-4">useBuiltInRTC:</span><span class="hl-1"> </span><span class="hl-5">true</span><span class="hl-1">, </span><span class="hl-0">// 使用内置rtc</span><br/><span class="hl-1"> </span><span class="hl-4">builtInRTCType:</span><span class="hl-1"> </span><span class="hl-4">BuiltInRTCType</span><span class="hl-1">.</span><span class="hl-4">RealseeXChimeRTC</span><span class="hl-1">, </span><span class="hl-0">// 内置 rtc 类型,不填则默认trtc,chime请指明</span><br/><span class="hl-1"> </span><span class="hl-4">useBuiltInJsBridge:</span><span class="hl-1"> </span><span class="hl-5">true</span><span class="hl-1">, </span><span class="hl-0">// 使用内置的jsBridge</span><br/><span class="hl-1"> </span><span class="hl-4">getVoiceSign</span><span class="hl-1">, </span><span class="hl-0">// 内置的rtc还是要把 getVoiceSign 方法传递进去</span><br/><span class="hl-1"> </span><span class="hl-7">getTicket</span><span class="hl-4">:</span><span class="hl-1"> </span><span class="hl-5">async</span><span class="hl-1"> () </span><span class="hl-5">=&gt;</span><span class="hl-1"> </span><span class="hl-2">&#39;&#39;</span><span class="hl-1"> </span><span class="hl-0">/* 必须提供 */</span><span class="hl-1">,</span><br/><span class="hl-1">});</span><br/><br/><span class="hl-0">// 可以直接使用里面的 jsBridge, 该实例由 @realsee/jsbridge-x 提供支持</span><br/><span class="hl-5">const</span><span class="hl-1"> </span><span class="hl-6">jsBridge</span><span class="hl-1"> = </span><span class="hl-4">live</span><span class="hl-1">.</span><span class="hl-4">jsBridge</span><span class="hl-1">;</span><br/><span class="hl-4">jsBridge</span><br/><span class="hl-1"> .</span><span class="hl-7">ready</span><span class="hl-1">()</span><br/><span class="hl-1"> .</span><span class="hl-7">then</span><span class="hl-1">(() </span><span class="hl-5">=&gt;</span><span class="hl-1"> </span><span class="hl-4">console</span><span class="hl-1">.</span><span class="hl-7">info</span><span class="hl-1">(</span><span class="hl-2">`</span><span class="hl-5">${</span><span class="hl-4">jsBridge</span><span class="hl-10">.</span><span class="hl-4">webViewType</span><span class="hl-5">}</span><span class="hl-2"> jsBridge is ready`</span><span class="hl-1">));</span>
369
- </code></pre>
370
-
371
- <a href="#typescript-amp-react-支持" id="typescript-amp-react-支持" style="color: inherit; text-decoration: none;">
372
- <h2>TypeScript &amp; React 支持</h2>
373
- </a>
374
- <p><strong>Live</strong> 有完整的 <a href="https://www.typescriptlang.org/docs/handbook/2/generics.html">TypeScript Generics</a>
375
- 和 <a href="https://reactjs.org/docs/hooks-intro.html">React Hooks</a> 支持,如果您的技术栈基于 <code>TypeScript</code> 和 <code>React</code> 可以参考如下方式更优雅地使用 <strong>Live</strong>。</p>
376
- <p><img src="https://vrlab-static.ljcdn.com/release/web/tssupportminify.f2eaeed2.png" alt="TypeScript效果演示"></p>
377
- <p>步骤一:新建文件 <code>LiveReact.ts</code> 并创建您自己的 <code>LiveReact</code> 实例。</p>
378
- <pre><code class="hljs language-tsx"><span class="hl-3">import</span><span class="hl-1"> { </span><span class="hl-4">createLiveReact</span><span class="hl-1"> } </span><span class="hl-3">from</span><span class="hl-1"> </span><span class="hl-2">&#39;@realsee/live&#39;</span><span class="hl-1">;</span><br/><br/><span class="hl-0">/** 定义帧数据快照结构 */</span><br/><span class="hl-5">interface</span><span class="hl-1"> </span><span class="hl-9">Snapshot</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-0">/** 以 Five 状态快照为例 */</span><br/><span class="hl-1"> </span><span class="hl-4">five</span><span class="hl-1">: {</span><br/><span class="hl-1"> </span><span class="hl-4">panoIndex</span><span class="hl-1">: </span><span class="hl-9">number</span><span class="hl-1">;</span><br/><span class="hl-1"> </span><span class="hl-4">fov</span><span class="hl-1">: </span><span class="hl-9">number</span><span class="hl-1">;</span><br/><span class="hl-1"> </span><span class="hl-4">mode</span><span class="hl-1">: </span><span class="hl-2">&#39;Panorama&#39;</span><span class="hl-1"> | </span><span class="hl-2">&#39;Model&#39;</span><span class="hl-1">;</span><br/><span class="hl-1"> </span><span class="hl-4">latitude</span><span class="hl-1">: </span><span class="hl-9">number</span><span class="hl-1">;</span><br/><span class="hl-1"> </span><span class="hl-4">longitude</span><span class="hl-1">: </span><span class="hl-9">number</span><span class="hl-1">;</span><br/><span class="hl-1"> };</span><br/><span class="hl-1">}</span><br/><br/><span class="hl-0">/** 通过 `createLiveReact()` 函数创建实例*/</span><br/><br/><span class="hl-5">const</span><span class="hl-1"> </span><span class="hl-6">LiveReact</span><span class="hl-1"> = </span><span class="hl-7">createLiveReact</span><span class="hl-1">&lt;</span><span class="hl-9">Snapshot</span><span class="hl-1">&gt;({</span><br/><span class="hl-1"> </span><span class="hl-7">getTicket</span><span class="hl-4">:</span><span class="hl-1"> </span><span class="hl-5">async</span><span class="hl-1"> () </span><span class="hl-5">=&gt;</span><span class="hl-1"> </span><span class="hl-2">&#39;&#39;</span><span class="hl-1"> </span><span class="hl-0">/* 必须提供 */</span><span class="hl-1">,</span><br/><span class="hl-1">});</span><br/><br/><span class="hl-3">export</span><span class="hl-1"> </span><span class="hl-3">default</span><span class="hl-1"> </span><span class="hl-4">LiveReact</span><span class="hl-1">;</span><br/><br/><span class="hl-0">/** 如果您不喜欢 `LiveReact.LiveProvider` 这类编程习惯,可以将需要的函数&quot;抛&quot;出来 */</span><br/><span class="hl-3">export</span><span class="hl-1"> </span><span class="hl-5">const</span><span class="hl-1"> </span><span class="hl-6">LiveProvider</span><span class="hl-1"> = </span><span class="hl-4">LiveReact</span><span class="hl-1">.</span><span class="hl-4">LiveProvider</span><span class="hl-1">;</span><br/><span class="hl-3">export</span><span class="hl-1"> </span><span class="hl-5">const</span><span class="hl-1"> </span><span class="hl-6">useConnect</span><span class="hl-1"> = </span><span class="hl-4">LiveReact</span><span class="hl-1">.</span><span class="hl-4">useConnect</span><span class="hl-1">;</span><br/><span class="hl-3">export</span><span class="hl-1"> </span><span class="hl-5">const</span><span class="hl-1"> </span><span class="hl-6">useKeyframe</span><span class="hl-1"> = </span><span class="hl-4">LiveReact</span><span class="hl-1">.</span><span class="hl-4">useKeyframe</span><span class="hl-1">;</span><br/><span class="hl-0">// export ..</span>
379
- </code></pre>
380
- <p>步骤二:通过 <code>LiveProvider</code> 将 <code>live</code> 实例集成到 <code>React</code> 的 <a href="https://reactjs.org/docs/context.html">Context</a> 上下文环境中。</p>
381
- <pre><code class="hljs language-jsx"><span class="hl-3">import</span><span class="hl-1"> { </span><span class="hl-4">LiveProvider</span><span class="hl-1"> } </span><span class="hl-3">from</span><span class="hl-1"> </span><span class="hl-2">&#39;./LiveReact&#39;</span><span class="hl-1">;</span><br/><br/><span class="hl-4">ReactDOM</span><span class="hl-1">.</span><span class="hl-7">render</span><span class="hl-1">(</span><br/><span class="hl-1"> </span><span class="hl-11">&lt;</span><span class="hl-9">LiveProvider</span><span class="hl-11">&gt;</span><br/><span class="hl-1"> </span><span class="hl-11">&lt;</span><span class="hl-9">RootApp</span><span class="hl-1"> </span><span class="hl-11">/&gt;</span><br/><span class="hl-1"> </span><span class="hl-11">&lt;/</span><span class="hl-9">LiveProvider</span><span class="hl-11">&gt;</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">containter</span><span class="hl-1">,</span><br/><span class="hl-1">);</span>
382
- </code></pre>
383
- <p>步骤三:在您的 <code>React</code> 函数组件中使用相关 <code>Hooks</code> 函数。</p>
384
- <pre><code class="hljs language-jsx"><span class="hl-3">import</span><span class="hl-1"> { </span><span class="hl-4">useConnect</span><span class="hl-1"> } </span><span class="hl-3">from</span><span class="hl-1"> </span><span class="hl-2">&#39;./LiveReact&#39;</span><span class="hl-1">;</span><br/><br/><span class="hl-5">function</span><span class="hl-1"> </span><span class="hl-7">ReconnectBtn</span><span class="hl-1">() {</span><br/><span class="hl-1"> </span><span class="hl-5">const</span><span class="hl-1"> </span><span class="hl-6">connect</span><span class="hl-1"> = </span><span class="hl-7">useConnect</span><span class="hl-1">();</span><br/><br/><span class="hl-1"> </span><span class="hl-3">return</span><span class="hl-1"> </span><span class="hl-11">&lt;</span><span class="hl-12">button</span><span class="hl-1"> </span><span class="hl-13">onClick</span><span class="hl-1">=</span><span class="hl-5">{</span><span class="hl-10">() </span><span class="hl-5">=&gt;</span><span class="hl-10"> </span><span class="hl-7">connect</span><span class="hl-10">()</span><span class="hl-5">}</span><span class="hl-11">&gt;</span><span class="hl-1">重新连接</span><span class="hl-11">&lt;/</span><span class="hl-12">button</span><span class="hl-11">&gt;</span><span class="hl-1">;</span><br/><span class="hl-1">}</span>
385
- </code></pre>
386
-
387
- <a href="#live-api-文档" id="live-api-文档" style="color: inherit; text-decoration: none;">
388
- <h2>Live API 文档</h2>
389
- </a>
390
- <p>欢迎查看 <a href="https://unpkg.com/@realsee/live/docs/index.html">Live API</a> 文档 。<br>该文档由 <a href="https://typedoc.org/">TypeDoc</a> 生成,您可以详细查看 API 使用方式、事件 Hooks 及数据结构定义等。</p>
391
-
392
- <a href="#相关文档链接" id="相关文档链接" style="color: inherit; text-decoration: none;">
393
- <h2>相关文档链接</h2>
394
- </a>
395
- <ul>
396
- <li><a href="https://www.npmjs.com/package/@realsee/five">@realsee/five</a></li>
397
- <li><a href="https://www.npmjs.com/package/@realsee/jsbridge">@realsee/jsbridge</a></li>
398
- <li><a href="https://developers.realsee.com/docs/#/docs/live/README">如视开发者中心 VRTC 服务</a></li>
399
- </ul>
400
- </div></div>
401
- <div class="col-4 col-menu menu-sticky-wrap menu-highlight">
402
- <div class="tsd-navigation settings">
403
- <details class="tsd-index-accordion"><summary class="tsd-accordion-summary">
404
- <h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><path d="M4.93896 8.531L12 15.591L19.061 8.531L16.939 6.409L12 11.349L7.06098 6.409L4.93896 8.531Z" fill="var(--color-text)"></path></svg> Settings</h3></summary>
405
- <div class="tsd-accordion-details">
406
- <div class="tsd-filter-visibility">
407
- <h4 class="uppercase">Member Visibility</h4><form>
408
- <ul id="tsd-filter-options">
409
- <li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li>
410
- <li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-private" name="private"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Private</span></label></li>
411
- <li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li>
412
- <li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></form></div>
413
- <div class="tsd-theme-toggle">
414
- <h4 class="uppercase">Theme</h4><select id="theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div>
415
- <nav class="tsd-navigation primary">
416
- <details class="tsd-index-accordion" open><summary class="tsd-accordion-summary">
417
- <h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><path d="M4.93896 8.531L12 15.591L19.061 8.531L16.939 6.409L12 11.349L7.06098 6.409L4.93896 8.531Z" fill="var(--color-text)"></path></svg> Modules</h3></summary>
418
- <div class="tsd-accordion-details">
419
- <ul>
420
- <li class="current selected"><a href="modules.html">如视 <wbr/>Live SDK</a>
421
- <ul></ul></li></ul></div></details></nav>
422
- <nav class="tsd-navigation secondary menu-sticky">
423
- <ul>
424
- <li class="tsd-kind-enum"><a href="enums/BuiltInRTCType.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-enum)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6" id="icon-8-path"></rect><path d="M9.45 16V7.24H14.49V8.224H10.518V10.936H14.07V11.908H10.518V15.016H14.49V16H9.45Z" fill="var(--color-text)" id="icon-8-text"></path></svg>Built<wbr/>InRTCType</a></li>
425
- <li class="tsd-kind-enum"><a href="enums/BuiltinActionType.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-8-path"></use><use href="#icon-8-text"></use></svg>Builtin<wbr/>Action<wbr/>Type</a></li>
426
- <li class="tsd-kind-enum"><a href="enums/BuiltinEventType.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-8-path"></use><use href="#icon-8-text"></use></svg>Builtin<wbr/>Event<wbr/>Type</a></li>
427
- <li class="tsd-kind-enum"><a href="enums/Command.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-8-path"></use><use href="#icon-8-text"></use></svg>Command</a></li>
428
- <li class="tsd-kind-enum"><a href="enums/LiveState.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-8-path"></use><use href="#icon-8-text"></use></svg>Live<wbr/>State</a></li>
429
- <li class="tsd-kind-enum"><a href="enums/MemUserStatus.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-8-path"></use><use href="#icon-8-text"></use></svg>Mem<wbr/>User<wbr/>Status</a></li>
430
- <li class="tsd-kind-enum"><a href="enums/MicroStatus.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-8-path"></use><use href="#icon-8-text"></use></svg>Micro<wbr/>Status</a></li>
431
- <li class="tsd-kind-enum"><a href="enums/RTCJoinedInfoCodeEnum.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-8-path"></use><use href="#icon-8-text"></use></svg>RTCJoined<wbr/>Info<wbr/>Code<wbr/>Enum</a></li>
432
- <li class="tsd-kind-enum"><a href="enums/RTCType.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-8-path"></use><use href="#icon-8-text"></use></svg>RTCType</a></li>
433
- <li class="tsd-kind-enum"><a href="enums/UserStatus.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-8-path"></use><use href="#icon-8-text"></use></svg>User<wbr/>Status</a></li>
434
- <li class="tsd-kind-enum"><a href="enums/WebSocketCloseError.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-8-path"></use><use href="#icon-8-text"></use></svg>Web<wbr/>Socket<wbr/>Close<wbr/>Error</a></li>
435
- <li class="tsd-kind-enum"><a href="enums/WebSocketErrorType.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-8-path"></use><use href="#icon-8-text"></use></svg>Web<wbr/>Socket<wbr/>Error<wbr/>Type</a></li>
436
- <li class="tsd-kind-enum"><a href="enums/WebSocketState.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-8-path"></use><use href="#icon-8-text"></use></svg>Web<wbr/>Socket<wbr/>State</a></li>
437
- <li class="tsd-kind-class"><a href="classes/BrowserRTC.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-class)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6" id="icon-128-path"></rect><path d="M11.898 16.1201C11.098 16.1201 10.466 15.8961 10.002 15.4481C9.53803 15.0001 9.30603 14.3841 9.30603 13.6001V9.64012C9.30603 8.85612 9.53803 8.24012 10.002 7.79212C10.466 7.34412 11.098 7.12012 11.898 7.12012C12.682 7.12012 13.306 7.34812 13.77 7.80412C14.234 8.25212 14.466 8.86412 14.466 9.64012H13.386C13.386 9.14412 13.254 8.76412 12.99 8.50012C12.734 8.22812 12.37 8.09212 11.898 8.09212C11.426 8.09212 11.054 8.22412 10.782 8.48812C10.518 8.75212 10.386 9.13212 10.386 9.62812V13.6001C10.386 14.0961 10.518 14.4801 10.782 14.7521C11.054 15.0161 11.426 15.1481 11.898 15.1481C12.37 15.1481 12.734 15.0161 12.99 14.7521C13.254 14.4801 13.386 14.0961 13.386 13.6001H14.466C14.466 14.3761 14.234 14.9921 13.77 15.4481C13.306 15.8961 12.682 16.1201 11.898 16.1201Z" fill="var(--color-text)" id="icon-128-text"></path></svg>BrowserRTC</a></li>
438
- <li class="tsd-kind-class"><a href="classes/BrowserRTC4Chime.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-128-path"></use><use href="#icon-128-text"></use></svg>BrowserRTC4<wbr/>Chime</a></li>
439
- <li class="tsd-kind-class"><a href="classes/CoreRTC.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-128-path"></use><use href="#icon-128-text"></use></svg>CoreRTC</a></li>
440
- <li class="tsd-kind-class"><a href="classes/VRWebViewRTC.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-128-path"></use><use href="#icon-128-text"></use></svg>VRWeb<wbr/>ViewRTC</a></li>
441
- <li class="tsd-kind-interface"><a href="interfaces/AttendeeResponse.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-interface)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6" id="icon-256-path"></rect><path d="M9.51 16V15.016H11.298V8.224H9.51V7.24H14.19V8.224H12.402V15.016H14.19V16H9.51Z" fill="var(--color-text)" id="icon-256-text"></path></svg>Attendee<wbr/>Response</a></li>
442
- <li class="tsd-kind-interface"><a href="interfaces/GetVoiceSignReturnType.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-256-path"></use><use href="#icon-256-text"></use></svg>Get<wbr/>Voice<wbr/>Sign<wbr/>Return<wbr/>Type</a></li>
443
- <li class="tsd-kind-interface"><a href="interfaces/LiveOptions.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-256-path"></use><use href="#icon-256-text"></use></svg>Live<wbr/>Options</a></li>
444
- <li class="tsd-kind-interface"><a href="interfaces/MeetingResponse.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-256-path"></use><use href="#icon-256-text"></use></svg>Meeting<wbr/>Response</a></li>
445
- <li class="tsd-kind-interface"><a href="interfaces/MeetingSessionConfigurationOptions.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-256-path"></use><use href="#icon-256-text"></use></svg>Meeting<wbr/>Session<wbr/>Configuration<wbr/>Options</a></li>
446
- <li class="tsd-kind-interface"><a href="interfaces/Permission.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-256-path"></use><use href="#icon-256-text"></use></svg>Permission</a></li>
447
- <li class="tsd-kind-interface"><a href="interfaces/RTCJoinedInfo.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-256-path"></use><use href="#icon-256-text"></use></svg>RTCJoined<wbr/>Info</a></li>
448
- <li class="tsd-kind-interface"><a href="interfaces/RTCProtocol.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-256-path"></use><use href="#icon-256-text"></use></svg>RTCProtocol</a></li>
449
- <li class="tsd-kind-interface"><a href="interfaces/VRWebViewRTCOptions.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-256-path"></use><use href="#icon-256-text"></use></svg>VRWeb<wbr/>ViewRTCOptions</a></li>
450
- <li class="tsd-kind-type-alias"><a href="types/BuiltinMsg.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><rect fill="var(--color-icon-background)" stroke="var(--color-ts)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6" id="icon-4194304-path"></rect><path d="M11.31 16V8.224H8.91V7.24H14.79V8.224H12.39V16H11.31Z" fill="var(--color-text)" id="icon-4194304-text"></path></svg>Builtin<wbr/>Msg</a></li>
451
- <li class="tsd-kind-type-alias"><a href="types/EventType.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-4194304-path"></use><use href="#icon-4194304-text"></use></svg>Event<wbr/>Type</a></li>
452
- <li class="tsd-kind-type-alias"><a href="types/GetVoiceSign.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-4194304-path"></use><use href="#icon-4194304-text"></use></svg>Get<wbr/>Voice<wbr/>Sign</a></li>
453
- <li class="tsd-kind-type-alias"><a href="types/KeyframeTypes.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-4194304-path"></use><use href="#icon-4194304-text"></use></svg>Keyframe<wbr/>Types</a></li>
454
- <li class="tsd-kind-type-alias"><a href="types/LiveConnectOptions.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-4194304-path"></use><use href="#icon-4194304-text"></use></svg>Live<wbr/>Connect<wbr/>Options</a></li>
455
- <li class="tsd-kind-type-alias"><a href="types/LiveEventType.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-4194304-path"></use><use href="#icon-4194304-text"></use></svg>Live<wbr/>Event<wbr/>Type</a></li>
456
- <li class="tsd-kind-type-alias"><a href="types/LiveMsg.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-4194304-path"></use><use href="#icon-4194304-text"></use></svg>Live<wbr/>Msg</a></li>
457
- <li class="tsd-kind-type-alias"><a href="types/LiveProviderPropTypes.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-4194304-path"></use><use href="#icon-4194304-text"></use></svg>Live<wbr/>Provider<wbr/>Prop<wbr/>Types</a></li>
458
- <li class="tsd-kind-type-alias"><a href="types/RTCActionReactCallback.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-4194304-path"></use><use href="#icon-4194304-text"></use></svg>RTCAction<wbr/>React<wbr/>Callback</a></li>
459
- <li class="tsd-kind-type-alias"><a href="types/RTCEventType.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-4194304-path"></use><use href="#icon-4194304-text"></use></svg>RTCEvent<wbr/>Type</a></li>
460
- <li class="tsd-kind-type-alias"><a href="types/ReqLiveMsg.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-4194304-path"></use><use href="#icon-4194304-text"></use></svg>Req<wbr/>Live<wbr/>Msg</a></li>
461
- <li class="tsd-kind-type-alias"><a href="types/RoomInfo.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-4194304-path"></use><use href="#icon-4194304-text"></use></svg>Room<wbr/>Info</a></li>
462
- <li class="tsd-kind-type-alias"><a href="types/UserInfo.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-4194304-path"></use><use href="#icon-4194304-text"></use></svg>User<wbr/>Info</a></li>
463
- <li class="tsd-kind-type-alias"><a href="types/UserInfoExt.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-4194304-path"></use><use href="#icon-4194304-text"></use></svg>User<wbr/>Info<wbr/>Ext</a></li>
464
- <li class="tsd-kind-type-alias"><a href="types/UserVolume.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-4194304-path"></use><use href="#icon-4194304-text"></use></svg>User<wbr/>Volume</a></li>
465
- <li class="tsd-kind-type-alias"><a href="types/WebSocketError.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-4194304-path"></use><use href="#icon-4194304-text"></use></svg>Web<wbr/>Socket<wbr/>Error</a></li>
466
- <li class="tsd-kind-function"><a href="functions/createLive.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-function)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6" id="icon-64-path"></rect><path d="M9.39 16V7.24H14.55V8.224H10.446V11.128H14.238V12.112H10.47V16H9.39Z" fill="var(--color-text)" id="icon-64-text"></path></svg>create<wbr/>Live</a></li>
467
- <li class="tsd-kind-function"><a href="functions/createLiveReact.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-64-path"></use><use href="#icon-64-text"></use></svg>create<wbr/>Live<wbr/>React</a></li>
468
- <li class="tsd-kind-function"><a href="functions/parseLiveMsg.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-64-path"></use><use href="#icon-64-text"></use></svg>parse<wbr/>Live<wbr/>Msg</a></li>
469
- <li class="tsd-kind-function"><a href="functions/parseWSClsErr.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-64-path"></use><use href="#icon-64-text"></use></svg>parseWSCls<wbr/>Err</a></li></ul></nav></div></div>
470
- <div class="overlay"></div><script src="assets/main.js"></script></body></html>