@realsee/live 0.1.1 → 0.3.0-alpha.1
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.
- package/README.md +111 -58
- package/docs/.nojekyll +1 -0
- package/docs/assets/custom.css +43 -0
- package/docs/assets/highlight.css +127 -0
- package/docs/assets/icons.css +1043 -0
- package/docs/assets/{images/icons.png → icons.png} +0 -0
- package/docs/assets/{images/icons@2x.png → icons@2x.png} +0 -0
- package/docs/assets/main.js +52 -0
- package/docs/assets/search.js +1 -0
- package/docs/assets/style.css +1388 -0
- package/docs/assets/{images/widgets.png → widgets.png} +0 -0
- package/docs/assets/{images/widgets@2x.png → widgets@2x.png} +0 -0
- package/docs/classes/RTCProtocol.BrowserRTC.html +60 -0
- package/docs/classes/RTCProtocol.BrowserRTC4Chime.html +66 -0
- package/docs/classes/RTCProtocol.RTCExample.html +62 -814
- package/docs/classes/RTCProtocol.VRWebViewRTC.html +60 -0
- package/docs/classes/shared_utils.Subscribe.html +55 -596
- package/docs/enums/RTCProtocol.RTCJoinedInfoCodeEnum.html +9 -0
- package/docs/enums/RTCProtocol.RTCType.html +1 -185
- package/docs/enums/live.BuiltinActionType.html +15 -325
- package/docs/enums/live.BuiltinEventType.html +7 -268
- package/docs/enums/live.Command.html +7 -346
- package/docs/enums/live.MemUserStatus.html +1 -307
- package/docs/enums/live.MicroStatus.html +3 -258
- package/docs/enums/live.UserStatus.html +9 -287
- package/docs/enums/live.WebSocketCloseError.html +19 -382
- package/docs/enums/live.WebSocketErrorType.html +1 -307
- package/docs/enums/live.WebSocketState.html +13 -325
- package/docs/index.html +356 -510
- package/docs/interfaces/RTCProtocol.GetVoiceSignReturnType.html +1 -0
- package/docs/interfaces/RTCProtocol.RTCJoinedInfo.html +1 -0
- package/docs/interfaces/RTCProtocol.RTCProtocol-1.html +60 -765
- package/docs/interfaces/RTCProtocol.VRWebViewRTCOptions.html +1 -0
- package/docs/interfaces/live.Live.html +119 -1302
- package/docs/interfaces/live.LiveOptions.html +22 -499
- package/docs/interfaces/live.LiveReact.html +52 -984
- package/docs/modules/RTCProtocol.html +17 -361
- package/docs/modules/live.html +103 -1219
- package/docs/modules/shared_utils.html +10 -248
- package/docs/modules.html +1 -125
- package/lib/RTC/BrowserRTC.d.ts +30 -0
- package/lib/RTC/BrowserRTC.js +169 -0
- package/lib/RTC/BrowserRTC.js.map +1 -0
- package/lib/RTC/BrowserRTC4Chime.d.ts +53 -0
- package/lib/RTC/BrowserRTC4Chime.js +299 -0
- package/lib/RTC/BrowserRTC4Chime.js.map +1 -0
- package/lib/RTC/VRWebViewRTC.d.ts +23 -0
- package/lib/RTC/VRWebViewRTC.js +124 -0
- package/lib/RTC/VRWebViewRTC.js.map +1 -0
- package/lib/RTC/index.d.ts +22 -0
- package/lib/{RTCProtocol → RTC}/index.js +3 -7
- package/lib/RTC/index.js.map +1 -0
- package/lib/createLive.d.ts +1 -1
- package/lib/createLive.js +50 -22
- package/lib/createLive.js.map +1 -1
- package/lib/createLiveReact.d.ts +11 -10
- package/lib/createLiveReact.js +4 -6
- package/lib/createLiveReact.js.map +1 -1
- package/lib/shared-utils/Subscribe.d.ts +1 -1
- package/lib/typings/Chime/AttendeeResponse.d.ts +5 -0
- package/lib/typings/Chime/AttendeeResponse.js +3 -0
- package/lib/typings/Chime/AttendeeResponse.js.map +1 -0
- package/lib/typings/Chime/MeetingResponse.d.ts +12 -0
- package/lib/typings/Chime/MeetingResponse.js +3 -0
- package/lib/typings/Chime/MeetingResponse.js.map +1 -0
- package/lib/typings/Chime/MeetingSessionConfigurationOptions.d.ts +16 -0
- package/lib/typings/Chime/MeetingSessionConfigurationOptions.js +3 -0
- package/lib/typings/Chime/MeetingSessionConfigurationOptions.js.map +1 -0
- package/lib/typings/EventType.d.ts +10 -0
- package/lib/typings/GetVoiceSign.d.ts +11 -0
- package/lib/typings/GetVoiceSign.js +3 -0
- package/lib/typings/GetVoiceSign.js.map +1 -0
- package/lib/typings/Live.d.ts +6 -4
- package/lib/typings/LiveMsg.d.ts +4 -0
- package/lib/typings/LiveMsg.js +4 -0
- package/lib/typings/LiveMsg.js.map +1 -1
- package/lib/typings/LiveOptions.d.ts +3 -7
- package/lib/typings/RTCEventType.d.ts +2 -14
- package/lib/typings/RTCEventType.js +0 -7
- package/lib/typings/RTCEventType.js.map +1 -1
- package/lib/typings/RTCJoinedInfo.d.ts +28 -0
- package/lib/typings/RTCJoinedInfo.js +23 -0
- package/lib/typings/RTCJoinedInfo.js.map +1 -0
- package/lib/{RTCProtocol/index.d.ts → typings/RTCProtocol.d.ts} +1 -19
- package/lib/typings/RTCProtocol.js +9 -0
- package/lib/typings/RTCProtocol.js.map +1 -0
- package/lib/typings/VRWebViewRTCOptions.d.ts +6 -0
- package/lib/typings/VRWebViewRTCOptions.js +3 -0
- package/lib/typings/VRWebViewRTCOptions.js.map +1 -0
- package/lib/typings/WebSocket.d.ts +2 -1
- package/lib/typings/WebSocket.js +1 -0
- package/lib/typings/WebSocket.js.map +1 -1
- package/package.json +8 -3
- package/umd/{RTCProtocol.046933a5.js → RTCProtocol.543610f0.js} +1 -1
- package/umd/createLive.a6edf473.js +1 -0
- package/umd/createLiveReact.e21b4514.js +1 -0
- package/docs/assets/css/main.css +0 -2787
- package/docs/assets/js/main.js +0 -248
- package/docs/assets/js/search.js +0 -1
- package/lib/RTCProtocol/index.js.map +0 -1
- package/umd/createLive.6845145e.js +0 -1
- package/umd/createLiveReact.406cf5a3.js +0 -1
|
@@ -1,248 +1,10 @@
|
|
|
1
|
-
<!
|
|
2
|
-
<
|
|
3
|
-
<
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
</head>
|
|
12
|
-
<body>
|
|
13
|
-
<header>
|
|
14
|
-
<div class="tsd-page-toolbar">
|
|
15
|
-
<div class="container">
|
|
16
|
-
<div class="table-wrap">
|
|
17
|
-
<div class="table-cell" id="tsd-search" data-index="../assets/js/search.json" data-base="..">
|
|
18
|
-
<div class="field">
|
|
19
|
-
<label for="tsd-search-field" class="tsd-widget search no-caption">Search</label>
|
|
20
|
-
<input id="tsd-search-field" type="text" />
|
|
21
|
-
</div>
|
|
22
|
-
<ul class="results">
|
|
23
|
-
<li class="state loading">Preparing search index...</li>
|
|
24
|
-
<li class="state failure">The search index is not available</li>
|
|
25
|
-
</ul>
|
|
26
|
-
<a href="../index.html" class="title">如视 Live SDK - v0.1.1</a>
|
|
27
|
-
</div>
|
|
28
|
-
<div class="table-cell" id="tsd-widgets">
|
|
29
|
-
<div id="tsd-filter">
|
|
30
|
-
<a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a>
|
|
31
|
-
<div class="tsd-filter-group">
|
|
32
|
-
<div class="tsd-select" id="tsd-filter-visibility">
|
|
33
|
-
<span class="tsd-select-label">All</span>
|
|
34
|
-
<ul class="tsd-select-list">
|
|
35
|
-
<li data-value="public">Public</li>
|
|
36
|
-
<li data-value="protected">Public/Protected</li>
|
|
37
|
-
<li data-value="private" class="selected">All</li>
|
|
38
|
-
</ul>
|
|
39
|
-
</div>
|
|
40
|
-
<input type="checkbox" id="tsd-filter-inherited" checked />
|
|
41
|
-
<label class="tsd-widget" for="tsd-filter-inherited">Inherited</label>
|
|
42
|
-
</div>
|
|
43
|
-
</div>
|
|
44
|
-
<a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a>
|
|
45
|
-
</div>
|
|
46
|
-
</div>
|
|
47
|
-
</div>
|
|
48
|
-
</div>
|
|
49
|
-
<div class="tsd-page-title">
|
|
50
|
-
<div class="container">
|
|
51
|
-
<ul class="tsd-breadcrumb">
|
|
52
|
-
<li>
|
|
53
|
-
<a href="../modules.html">如视 Live SDK - v0.1.1</a>
|
|
54
|
-
</li>
|
|
55
|
-
<li>
|
|
56
|
-
<a href="shared_utils.html">shared-utils</a>
|
|
57
|
-
</li>
|
|
58
|
-
</ul>
|
|
59
|
-
<h1>Module shared-utils</h1>
|
|
60
|
-
</div>
|
|
61
|
-
</div>
|
|
62
|
-
</header>
|
|
63
|
-
<div class="container container-main">
|
|
64
|
-
<div class="row">
|
|
65
|
-
<div class="col-8 col-content">
|
|
66
|
-
<section class="tsd-panel-group tsd-index-group">
|
|
67
|
-
<h2>Index</h2>
|
|
68
|
-
<section class="tsd-panel tsd-index-panel">
|
|
69
|
-
<div class="tsd-index-content">
|
|
70
|
-
<section class="tsd-index-section ">
|
|
71
|
-
<h3>Classes</h3>
|
|
72
|
-
<ul class="tsd-index-list">
|
|
73
|
-
<li class="tsd-kind-class tsd-parent-kind-module tsd-has-type-parameter"><a href="../classes/shared_utils.Subscribe.html" class="tsd-kind-icon">Subscribe</a></li>
|
|
74
|
-
</ul>
|
|
75
|
-
</section>
|
|
76
|
-
<section class="tsd-index-section ">
|
|
77
|
-
<h3>Functions</h3>
|
|
78
|
-
<ul class="tsd-index-list">
|
|
79
|
-
<li class="tsd-kind-function tsd-parent-kind-module"><a href="shared_utils.html#appendUri" class="tsd-kind-icon">append<wbr>Uri</a></li>
|
|
80
|
-
<li class="tsd-kind-function tsd-parent-kind-module"><a href="shared_utils.html#equal" class="tsd-kind-icon">equal</a></li>
|
|
81
|
-
<li class="tsd-kind-function tsd-parent-kind-module"><a href="shared_utils.html#uuid" class="tsd-kind-icon">uuid</a></li>
|
|
82
|
-
</ul>
|
|
83
|
-
</section>
|
|
84
|
-
</div>
|
|
85
|
-
</section>
|
|
86
|
-
</section>
|
|
87
|
-
<section class="tsd-panel-group tsd-member-group ">
|
|
88
|
-
<h2>Functions</h2>
|
|
89
|
-
<section class="tsd-panel tsd-member tsd-kind-function tsd-parent-kind-module">
|
|
90
|
-
<a name="appendUri" class="tsd-anchor"></a>
|
|
91
|
-
<h3>append<wbr>Uri</h3>
|
|
92
|
-
<ul class="tsd-signatures tsd-kind-function tsd-parent-kind-module">
|
|
93
|
-
<li class="tsd-signature tsd-kind-icon">append<wbr>Uri<span class="tsd-signature-symbol">(</span>uri<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, query<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">Record</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></li>
|
|
94
|
-
</ul>
|
|
95
|
-
<ul class="tsd-descriptions">
|
|
96
|
-
<li class="tsd-description">
|
|
97
|
-
<aside class="tsd-sources">
|
|
98
|
-
<ul>
|
|
99
|
-
<li>Defined in shared-utils/appendUri.ts:1</li>
|
|
100
|
-
</ul>
|
|
101
|
-
</aside>
|
|
102
|
-
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
103
|
-
<ul class="tsd-parameters">
|
|
104
|
-
<li>
|
|
105
|
-
<h5>uri: <span class="tsd-signature-type">string</span></h5>
|
|
106
|
-
</li>
|
|
107
|
-
<li>
|
|
108
|
-
<h5>query: <span class="tsd-signature-type">Record</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol"> = {}</span></h5>
|
|
109
|
-
</li>
|
|
110
|
-
</ul>
|
|
111
|
-
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4>
|
|
112
|
-
</li>
|
|
113
|
-
</ul>
|
|
114
|
-
</section>
|
|
115
|
-
<section class="tsd-panel tsd-member tsd-kind-function tsd-parent-kind-module">
|
|
116
|
-
<a name="equal" class="tsd-anchor"></a>
|
|
117
|
-
<h3>equal</h3>
|
|
118
|
-
<ul class="tsd-signatures tsd-kind-function tsd-parent-kind-module">
|
|
119
|
-
<li class="tsd-signature tsd-kind-icon">equal<span class="tsd-signature-symbol">(</span>value<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span>, other<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span>, opt<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-symbol">{ </span>deep<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol"> }</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li>
|
|
120
|
-
</ul>
|
|
121
|
-
<ul class="tsd-descriptions">
|
|
122
|
-
<li class="tsd-description">
|
|
123
|
-
<aside class="tsd-sources">
|
|
124
|
-
<ul>
|
|
125
|
-
<li>Defined in shared-utils/equal.ts:77</li>
|
|
126
|
-
</ul>
|
|
127
|
-
</aside>
|
|
128
|
-
<div class="tsd-comment tsd-typography">
|
|
129
|
-
<div class="lead">
|
|
130
|
-
<p>对象比较。</p>
|
|
131
|
-
</div>
|
|
132
|
-
</div>
|
|
133
|
-
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
134
|
-
<ul class="tsd-parameters">
|
|
135
|
-
<li>
|
|
136
|
-
<h5>value: <span class="tsd-signature-type">any</span></h5>
|
|
137
|
-
<div class="tsd-comment tsd-typography">
|
|
138
|
-
<p>第一个比较的值。</p>
|
|
139
|
-
</div>
|
|
140
|
-
</li>
|
|
141
|
-
<li>
|
|
142
|
-
<h5>other: <span class="tsd-signature-type">any</span></h5>
|
|
143
|
-
<div class="tsd-comment tsd-typography">
|
|
144
|
-
<p>第二个比较的值。</p>
|
|
145
|
-
</div>
|
|
146
|
-
</li>
|
|
147
|
-
<li>
|
|
148
|
-
<h5>opt: <span class="tsd-signature-symbol">{ </span>deep<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol"> }</span><span class="tsd-signature-symbol"> = ...</span></h5>
|
|
149
|
-
<ul class="tsd-parameters">
|
|
150
|
-
<li class="tsd-parameter">
|
|
151
|
-
<h5>deep<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></h5>
|
|
152
|
-
</li>
|
|
153
|
-
</ul>
|
|
154
|
-
</li>
|
|
155
|
-
</ul>
|
|
156
|
-
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4>
|
|
157
|
-
<p>是否相等。</p>
|
|
158
|
-
</li>
|
|
159
|
-
</ul>
|
|
160
|
-
</section>
|
|
161
|
-
<section class="tsd-panel tsd-member tsd-kind-function tsd-parent-kind-module">
|
|
162
|
-
<a name="uuid" class="tsd-anchor"></a>
|
|
163
|
-
<h3>uuid</h3>
|
|
164
|
-
<ul class="tsd-signatures tsd-kind-function tsd-parent-kind-module">
|
|
165
|
-
<li class="tsd-signature tsd-kind-icon">uuid<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></li>
|
|
166
|
-
</ul>
|
|
167
|
-
<ul class="tsd-descriptions">
|
|
168
|
-
<li class="tsd-description">
|
|
169
|
-
<aside class="tsd-sources">
|
|
170
|
-
<ul>
|
|
171
|
-
<li>Defined in shared-utils/uuid.ts:9</li>
|
|
172
|
-
</ul>
|
|
173
|
-
</aside>
|
|
174
|
-
<div class="tsd-comment tsd-typography">
|
|
175
|
-
<div class="lead">
|
|
176
|
-
<p>基于伪随机数生成 <strong>uuid</strong>。</p>
|
|
177
|
-
</div>
|
|
178
|
-
</div>
|
|
179
|
-
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4>
|
|
180
|
-
</li>
|
|
181
|
-
</ul>
|
|
182
|
-
</section>
|
|
183
|
-
</section>
|
|
184
|
-
</div>
|
|
185
|
-
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
|
|
186
|
-
<nav class="tsd-navigation primary">
|
|
187
|
-
<ul>
|
|
188
|
-
<li class=" ">
|
|
189
|
-
<a href="../modules.html">Modules</a>
|
|
190
|
-
</li>
|
|
191
|
-
<li class=" tsd-kind-module">
|
|
192
|
-
<a href="RTCProtocol.html">RTCProtocol</a>
|
|
193
|
-
</li>
|
|
194
|
-
<li class=" tsd-kind-module">
|
|
195
|
-
<a href="live.html">live</a>
|
|
196
|
-
</li>
|
|
197
|
-
<li class="current tsd-kind-module">
|
|
198
|
-
<a href="shared_utils.html">shared-<wbr>utils</a>
|
|
199
|
-
</li>
|
|
200
|
-
</ul>
|
|
201
|
-
</nav>
|
|
202
|
-
<nav class="tsd-navigation secondary menu-sticky">
|
|
203
|
-
<ul class="before-current">
|
|
204
|
-
<li class=" tsd-kind-class tsd-parent-kind-module tsd-has-type-parameter">
|
|
205
|
-
<a href="../classes/shared_utils.Subscribe.html" class="tsd-kind-icon">Subscribe</a>
|
|
206
|
-
</li>
|
|
207
|
-
<li class=" tsd-kind-function tsd-parent-kind-module">
|
|
208
|
-
<a href="shared_utils.html#appendUri" class="tsd-kind-icon">append<wbr>Uri</a>
|
|
209
|
-
</li>
|
|
210
|
-
<li class=" tsd-kind-function tsd-parent-kind-module">
|
|
211
|
-
<a href="shared_utils.html#equal" class="tsd-kind-icon">equal</a>
|
|
212
|
-
</li>
|
|
213
|
-
<li class=" tsd-kind-function tsd-parent-kind-module">
|
|
214
|
-
<a href="shared_utils.html#uuid" class="tsd-kind-icon">uuid</a>
|
|
215
|
-
</li>
|
|
216
|
-
</ul>
|
|
217
|
-
</nav>
|
|
218
|
-
</div>
|
|
219
|
-
</div>
|
|
220
|
-
</div>
|
|
221
|
-
<footer>
|
|
222
|
-
<div class="container">
|
|
223
|
-
<h2>Legend</h2>
|
|
224
|
-
<div class="tsd-legend-group">
|
|
225
|
-
<ul class="tsd-legend">
|
|
226
|
-
<li class="tsd-kind-function"><span class="tsd-kind-icon">Function</span></li>
|
|
227
|
-
<li class="tsd-kind-function tsd-has-type-parameter"><span class="tsd-kind-icon">Function with type parameter</span></li>
|
|
228
|
-
<li class="tsd-kind-type-alias"><span class="tsd-kind-icon">Type alias</span></li>
|
|
229
|
-
<li class="tsd-kind-type-alias tsd-has-type-parameter"><span class="tsd-kind-icon">Type alias with type parameter</span></li>
|
|
230
|
-
</ul>
|
|
231
|
-
<ul class="tsd-legend">
|
|
232
|
-
<li class="tsd-kind-interface"><span class="tsd-kind-icon">Interface</span></li>
|
|
233
|
-
<li class="tsd-kind-interface tsd-has-type-parameter"><span class="tsd-kind-icon">Interface with type parameter</span></li>
|
|
234
|
-
</ul>
|
|
235
|
-
<ul class="tsd-legend">
|
|
236
|
-
<li class="tsd-kind-class"><span class="tsd-kind-icon">Class</span></li>
|
|
237
|
-
<li class="tsd-kind-class tsd-has-type-parameter"><span class="tsd-kind-icon">Class with type parameter</span></li>
|
|
238
|
-
</ul>
|
|
239
|
-
<ul class="tsd-legend">
|
|
240
|
-
<li class="tsd-kind-enum"><span class="tsd-kind-icon">Enumeration</span></li>
|
|
241
|
-
</ul>
|
|
242
|
-
</div>
|
|
243
|
-
</div>
|
|
244
|
-
</footer>
|
|
245
|
-
<div class="overlay"></div>
|
|
246
|
-
<script src="../assets/js/main.js"></script>
|
|
247
|
-
</body>
|
|
248
|
-
</html>
|
|
1
|
+
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>shared-utils | 如视 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.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">如视 Live SDK</a></div><div class="table-cell" id="tsd-widgets"><div id="tsd-filter"><a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a><div class="tsd-filter-group"><div class="tsd-select" id="tsd-filter-visibility"><span class="tsd-select-label">All</span><ul class="tsd-select-list"><li data-value="public">Public</li><li data-value="protected">Public/Protected</li><li data-value="private" class="selected">All</li></ul></div> <input type="checkbox" id="tsd-filter-inherited" checked/><label class="tsd-widget" for="tsd-filter-inherited">Inherited</label><input type="checkbox" id="tsd-filter-externals" checked/><label class="tsd-widget" for="tsd-filter-externals">Externals</label></div></div><a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a></div></div></div></div><div class="tsd-page-title"><div class="container"><ul class="tsd-breadcrumb"><li><a href="../modules.html">如视 Live SDK</a></li><li><a href="shared_utils.html">shared-utils</a></li></ul><h1>Module shared-utils</h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><section class="tsd-panel-group tsd-index-group"><h2>Index</h2><section class="tsd-panel tsd-index-panel"><div class="tsd-index-content"><section class="tsd-index-section "><h3>Classes</h3><ul class="tsd-index-list"><li class="tsd-kind-class tsd-parent-kind-module tsd-has-type-parameter"><a href="../classes/shared_utils.Subscribe.html" class="tsd-kind-icon">Subscribe</a></li></ul></section><section class="tsd-index-section "><h3>Type aliases</h3><ul class="tsd-index-list"><li class="tsd-kind-type-alias tsd-parent-kind-module"><a href="shared_utils.html#EventMap" class="tsd-kind-icon">Event<wbr/>Map</a></li></ul></section><section class="tsd-index-section "><h3>Functions</h3><ul class="tsd-index-list"><li class="tsd-kind-function tsd-parent-kind-module"><a href="shared_utils.html#appendUri" class="tsd-kind-icon">append<wbr/>Uri</a></li><li class="tsd-kind-function tsd-parent-kind-module"><a href="shared_utils.html#equal" class="tsd-kind-icon">equal</a></li><li class="tsd-kind-function tsd-parent-kind-module"><a href="shared_utils.html#uuid" class="tsd-kind-icon">uuid</a></li></ul></section></div></section></section><section class="tsd-panel-group tsd-member-group "><h2>Type aliases</h2><section class="tsd-panel tsd-member tsd-kind-type-alias tsd-parent-kind-module"><a id="EventMap" class="tsd-anchor"></a><h3>Event<wbr/>Map</h3><div class="tsd-signature tsd-kind-icon">Event<wbr/>Map<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{}</span></div><aside class="tsd-sources"><ul><li>Defined in shared-utils/Subscribe.ts:13</li></ul></aside><div class="tsd-type-declaration"><h4>Type declaration</h4><ul class="tsd-parameters"><li class="tsd-parameter-index-signature"><h5><span class="tsd-signature-symbol">[</span>name: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">]: </span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">...</span>args<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">boolean</span></h5><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-kind-type-literal"><li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">...</span>args<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">boolean</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5><span class="tsd-flag ts-flagRest">Rest</span> <span class="tsd-signature-symbol">...</span>args: <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">boolean</span></h4></li></ul></li></ul></li></ul></div></section></section><section class="tsd-panel-group tsd-member-group "><h2>Functions</h2><section class="tsd-panel tsd-member tsd-kind-function tsd-parent-kind-module"><a id="appendUri" class="tsd-anchor"></a><h3>append<wbr/>Uri</h3><ul class="tsd-signatures tsd-kind-function tsd-parent-kind-module"><li class="tsd-signature tsd-kind-icon">append<wbr/>Uri<span class="tsd-signature-symbol">(</span>uri<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, query<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">Record</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in shared-utils/appendUri.ts:1</li></ul></aside><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>uri: <span class="tsd-signature-type">string</span></h5></li><li><h5>query: <span class="tsd-signature-type">Record</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol"> = {}</span></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-function tsd-parent-kind-module"><a id="equal" class="tsd-anchor"></a><h3>equal</h3><ul class="tsd-signatures tsd-kind-function tsd-parent-kind-module"><li class="tsd-signature tsd-kind-icon">equal<span class="tsd-signature-symbol">(</span>value<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span>, other<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span>, opt<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-symbol">{ </span>deep<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol"> }</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in shared-utils/equal.ts:77</li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
|
2
|
+
<p>对象比较。</p>
|
|
3
|
+
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>value: <span class="tsd-signature-type">any</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
|
|
4
|
+
<p>第一个比较的值。</p>
|
|
5
|
+
</div></div></li><li><h5>other: <span class="tsd-signature-type">any</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
|
|
6
|
+
<p>第二个比较的值。</p>
|
|
7
|
+
</div></div></li><li><h5>opt: <span class="tsd-signature-symbol">{ </span>deep<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol"> }</span><span class="tsd-signature-symbol"> = ...</span></h5><ul class="tsd-parameters"><li class="tsd-parameter"><h5>deep<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></h5></li></ul></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4><div><p>是否相等。</p>
|
|
8
|
+
</div></li></ul></section><section class="tsd-panel tsd-member tsd-kind-function tsd-parent-kind-module"><a id="uuid" class="tsd-anchor"></a><h3>uuid</h3><ul class="tsd-signatures tsd-kind-function tsd-parent-kind-module"><li class="tsd-signature tsd-kind-icon">uuid<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in shared-utils/uuid.ts:9</li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
|
9
|
+
<p>基于伪随机数生成 <strong>uuid</strong>。</p>
|
|
10
|
+
</div></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4></li></ul></section></section></div><div class="col-4 col-menu menu-sticky-wrap menu-highlight"><nav class="tsd-navigation primary"><ul><li class=""><a href="../modules.html">Modules</a></li><li class=" tsd-kind-module"><a href="RTCProtocol.html">RTCProtocol</a></li><li class=" tsd-kind-module"><a href="live.html">live</a></li><li class="current tsd-kind-module"><a href="shared_utils.html">shared-<wbr/>utils</a></li></ul></nav><nav class="tsd-navigation secondary menu-sticky"><ul><li class="tsd-kind-class tsd-parent-kind-module tsd-has-type-parameter"><a href="../classes/shared_utils.Subscribe.html" class="tsd-kind-icon">Subscribe</a></li><li class="tsd-kind-type-alias tsd-parent-kind-module"><a href="shared_utils.html#EventMap" class="tsd-kind-icon">Event<wbr/>Map</a></li><li class="tsd-kind-function tsd-parent-kind-module"><a href="shared_utils.html#appendUri" class="tsd-kind-icon">append<wbr/>Uri</a></li><li class="tsd-kind-function tsd-parent-kind-module"><a href="shared_utils.html#equal" class="tsd-kind-icon">equal</a></li><li class="tsd-kind-function tsd-parent-kind-module"><a href="shared_utils.html#uuid" class="tsd-kind-icon">uuid</a></li></ul></nav></div></div></div><footer class=""><div class="container"><h2>Legend</h2><div class="tsd-legend-group"><ul class="tsd-legend"><li class="tsd-kind-function"><span class="tsd-kind-icon">Function</span></li><li class="tsd-kind-function tsd-has-type-parameter"><span class="tsd-kind-icon">Function with type parameter</span></li><li class="tsd-kind-type-alias"><span class="tsd-kind-icon">Type alias</span></li><li class="tsd-kind-type-alias tsd-has-type-parameter"><span class="tsd-kind-icon">Type alias with type parameter</span></li></ul><ul class="tsd-legend"><li class="tsd-kind-interface"><span class="tsd-kind-icon">Interface</span></li><li class="tsd-kind-interface tsd-has-type-parameter"><span class="tsd-kind-icon">Interface with type parameter</span></li></ul><ul class="tsd-legend"><li class="tsd-kind-class"><span class="tsd-kind-icon">Class</span></li><li class="tsd-kind-class tsd-has-type-parameter"><span class="tsd-kind-icon">Class with type parameter</span></li></ul><ul class="tsd-legend"><li class="tsd-kind-enum"><span class="tsd-kind-icon">Enumeration</span></li></ul></div><h2>Settings</h2><p>Theme <select id="theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></p></div></footer><div class="overlay"></div><script src="../assets/main.js"></script></body></html>
|
package/docs/modules.html
CHANGED
|
@@ -1,125 +1 @@
|
|
|
1
|
-
<!
|
|
2
|
-
<html class="default no-js">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8">
|
|
5
|
-
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
6
|
-
<title>如视 Live SDK - v0.1.1</title>
|
|
7
|
-
<meta name="description" content="Documentation for 如视 Live SDK - v0.1.1">
|
|
8
|
-
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
9
|
-
<link rel="stylesheet" href="assets/css/main.css">
|
|
10
|
-
<script async src="assets/js/search.js" id="search-script"></script>
|
|
11
|
-
</head>
|
|
12
|
-
<body>
|
|
13
|
-
<header>
|
|
14
|
-
<div class="tsd-page-toolbar">
|
|
15
|
-
<div class="container">
|
|
16
|
-
<div class="table-wrap">
|
|
17
|
-
<div class="table-cell" id="tsd-search" data-index="assets/js/search.json" data-base=".">
|
|
18
|
-
<div class="field">
|
|
19
|
-
<label for="tsd-search-field" class="tsd-widget search no-caption">Search</label>
|
|
20
|
-
<input id="tsd-search-field" type="text" />
|
|
21
|
-
</div>
|
|
22
|
-
<ul class="results">
|
|
23
|
-
<li class="state loading">Preparing search index...</li>
|
|
24
|
-
<li class="state failure">The search index is not available</li>
|
|
25
|
-
</ul>
|
|
26
|
-
<a href="index.html" class="title">如视 Live SDK - v0.1.1</a>
|
|
27
|
-
</div>
|
|
28
|
-
<div class="table-cell" id="tsd-widgets">
|
|
29
|
-
<div id="tsd-filter">
|
|
30
|
-
<a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a>
|
|
31
|
-
<div class="tsd-filter-group">
|
|
32
|
-
<div class="tsd-select" id="tsd-filter-visibility">
|
|
33
|
-
<span class="tsd-select-label">All</span>
|
|
34
|
-
<ul class="tsd-select-list">
|
|
35
|
-
<li data-value="public">Public</li>
|
|
36
|
-
<li data-value="protected">Public/Protected</li>
|
|
37
|
-
<li data-value="private" class="selected">All</li>
|
|
38
|
-
</ul>
|
|
39
|
-
</div>
|
|
40
|
-
<input type="checkbox" id="tsd-filter-inherited" checked />
|
|
41
|
-
<label class="tsd-widget" for="tsd-filter-inherited">Inherited</label>
|
|
42
|
-
</div>
|
|
43
|
-
</div>
|
|
44
|
-
<a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a>
|
|
45
|
-
</div>
|
|
46
|
-
</div>
|
|
47
|
-
</div>
|
|
48
|
-
</div>
|
|
49
|
-
<div class="tsd-page-title">
|
|
50
|
-
<div class="container">
|
|
51
|
-
<h1>如视 Live SDK - v0.1.1</h1>
|
|
52
|
-
</div>
|
|
53
|
-
</div>
|
|
54
|
-
</header>
|
|
55
|
-
<div class="container container-main">
|
|
56
|
-
<div class="row">
|
|
57
|
-
<div class="col-8 col-content">
|
|
58
|
-
<section class="tsd-panel-group tsd-index-group">
|
|
59
|
-
<h2>Index</h2>
|
|
60
|
-
<section class="tsd-panel tsd-index-panel">
|
|
61
|
-
<div class="tsd-index-content">
|
|
62
|
-
<section class="tsd-index-section ">
|
|
63
|
-
<h3>Modules</h3>
|
|
64
|
-
<ul class="tsd-index-list">
|
|
65
|
-
<li class="tsd-kind-module"><a href="modules/RTCProtocol.html" class="tsd-kind-icon">RTCProtocol</a></li>
|
|
66
|
-
<li class="tsd-kind-module"><a href="modules/live.html" class="tsd-kind-icon">live</a></li>
|
|
67
|
-
<li class="tsd-kind-module"><a href="modules/shared_utils.html" class="tsd-kind-icon">shared-<wbr>utils</a></li>
|
|
68
|
-
</ul>
|
|
69
|
-
</section>
|
|
70
|
-
</div>
|
|
71
|
-
</section>
|
|
72
|
-
</section>
|
|
73
|
-
</div>
|
|
74
|
-
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
|
|
75
|
-
<nav class="tsd-navigation primary">
|
|
76
|
-
<ul>
|
|
77
|
-
<li class="current ">
|
|
78
|
-
<a href="modules.html">Modules</a>
|
|
79
|
-
</li>
|
|
80
|
-
<li class=" tsd-kind-module">
|
|
81
|
-
<a href="modules/RTCProtocol.html">RTCProtocol</a>
|
|
82
|
-
</li>
|
|
83
|
-
<li class=" tsd-kind-module">
|
|
84
|
-
<a href="modules/live.html">live</a>
|
|
85
|
-
</li>
|
|
86
|
-
<li class=" tsd-kind-module">
|
|
87
|
-
<a href="modules/shared_utils.html">shared-<wbr>utils</a>
|
|
88
|
-
</li>
|
|
89
|
-
</ul>
|
|
90
|
-
</nav>
|
|
91
|
-
<nav class="tsd-navigation secondary menu-sticky">
|
|
92
|
-
<ul class="before-current">
|
|
93
|
-
</ul>
|
|
94
|
-
</nav>
|
|
95
|
-
</div>
|
|
96
|
-
</div>
|
|
97
|
-
</div>
|
|
98
|
-
<footer>
|
|
99
|
-
<div class="container">
|
|
100
|
-
<h2>Legend</h2>
|
|
101
|
-
<div class="tsd-legend-group">
|
|
102
|
-
<ul class="tsd-legend">
|
|
103
|
-
<li class="tsd-kind-function"><span class="tsd-kind-icon">Function</span></li>
|
|
104
|
-
<li class="tsd-kind-function tsd-has-type-parameter"><span class="tsd-kind-icon">Function with type parameter</span></li>
|
|
105
|
-
<li class="tsd-kind-type-alias"><span class="tsd-kind-icon">Type alias</span></li>
|
|
106
|
-
<li class="tsd-kind-type-alias tsd-has-type-parameter"><span class="tsd-kind-icon">Type alias with type parameter</span></li>
|
|
107
|
-
</ul>
|
|
108
|
-
<ul class="tsd-legend">
|
|
109
|
-
<li class="tsd-kind-interface"><span class="tsd-kind-icon">Interface</span></li>
|
|
110
|
-
<li class="tsd-kind-interface tsd-has-type-parameter"><span class="tsd-kind-icon">Interface with type parameter</span></li>
|
|
111
|
-
</ul>
|
|
112
|
-
<ul class="tsd-legend">
|
|
113
|
-
<li class="tsd-kind-class"><span class="tsd-kind-icon">Class</span></li>
|
|
114
|
-
<li class="tsd-kind-class tsd-has-type-parameter"><span class="tsd-kind-icon">Class with type parameter</span></li>
|
|
115
|
-
</ul>
|
|
116
|
-
<ul class="tsd-legend">
|
|
117
|
-
<li class="tsd-kind-enum"><span class="tsd-kind-icon">Enumeration</span></li>
|
|
118
|
-
</ul>
|
|
119
|
-
</div>
|
|
120
|
-
</div>
|
|
121
|
-
</footer>
|
|
122
|
-
<div class="overlay"></div>
|
|
123
|
-
<script src="assets/js/main.js"></script>
|
|
124
|
-
</body>
|
|
125
|
-
</html>
|
|
1
|
+
<!DOCTYPE html><html class="default"><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.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base="."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="index.html" class="title">如视 Live SDK</a></div><div class="table-cell" id="tsd-widgets"><div id="tsd-filter"><a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a><div class="tsd-filter-group"><div class="tsd-select" id="tsd-filter-visibility"><span class="tsd-select-label">All</span><ul class="tsd-select-list"><li data-value="public">Public</li><li data-value="protected">Public/Protected</li><li data-value="private" class="selected">All</li></ul></div> <input type="checkbox" id="tsd-filter-inherited" checked/><label class="tsd-widget" for="tsd-filter-inherited">Inherited</label><input type="checkbox" id="tsd-filter-externals" checked/><label class="tsd-widget" for="tsd-filter-externals">Externals</label></div></div><a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a></div></div></div></div><div class="tsd-page-title"><div class="container"><h1> 如视 Live SDK</h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><section class="tsd-panel-group tsd-index-group"><h2>Index</h2><section class="tsd-panel tsd-index-panel"><div class="tsd-index-content"><section class="tsd-index-section "><h3>Modules</h3><ul class="tsd-index-list"><li class="tsd-kind-module"><a href="modules/RTCProtocol.html" class="tsd-kind-icon">RTCProtocol</a></li><li class="tsd-kind-module"><a href="modules/live.html" class="tsd-kind-icon">live</a></li><li class="tsd-kind-module"><a href="modules/shared_utils.html" class="tsd-kind-icon">shared-<wbr/>utils</a></li></ul></section></div></section></section></div><div class="col-4 col-menu menu-sticky-wrap menu-highlight"><nav class="tsd-navigation primary"><ul><li class="current"><a href="modules.html">Modules</a></li><li class=" tsd-kind-module"><a href="modules/RTCProtocol.html">RTCProtocol</a></li><li class=" tsd-kind-module"><a href="modules/live.html">live</a></li><li class=" tsd-kind-module"><a href="modules/shared_utils.html">shared-<wbr/>utils</a></li></ul></nav></div></div></div><footer class=""><div class="container"><h2>Legend</h2><div class="tsd-legend-group"><ul class="tsd-legend"><li class="tsd-kind-function"><span class="tsd-kind-icon">Function</span></li><li class="tsd-kind-function tsd-has-type-parameter"><span class="tsd-kind-icon">Function with type parameter</span></li><li class="tsd-kind-type-alias"><span class="tsd-kind-icon">Type alias</span></li><li class="tsd-kind-type-alias tsd-has-type-parameter"><span class="tsd-kind-icon">Type alias with type parameter</span></li></ul><ul class="tsd-legend"><li class="tsd-kind-interface"><span class="tsd-kind-icon">Interface</span></li><li class="tsd-kind-interface tsd-has-type-parameter"><span class="tsd-kind-icon">Interface with type parameter</span></li></ul><ul class="tsd-legend"><li class="tsd-kind-class"><span class="tsd-kind-icon">Class</span></li><li class="tsd-kind-class tsd-has-type-parameter"><span class="tsd-kind-icon">Class with type parameter</span></li></ul><ul class="tsd-legend"><li class="tsd-kind-enum"><span class="tsd-kind-icon">Enumeration</span></li></ul></div><h2>Settings</h2><p>Theme <select id="theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></p></div></footer><div class="overlay"></div><script src="assets/main.js"></script></body></html>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Subscribe } from '../shared-utils/Subscribe';
|
|
2
|
+
import { RTCEventType } from '../typings/RTCEventType';
|
|
3
|
+
import { RTCProtocol, RTCType } from '../typings/RTCProtocol';
|
|
4
|
+
import { GetVoiceSign } from '../typings/GetVoiceSign';
|
|
5
|
+
export declare class BrowserRTC extends Subscribe<RTCEventType> implements RTCProtocol {
|
|
6
|
+
type: RTCType;
|
|
7
|
+
joined: boolean;
|
|
8
|
+
micro: boolean;
|
|
9
|
+
voiceId: string;
|
|
10
|
+
private _getVoiceSign;
|
|
11
|
+
private $dom;
|
|
12
|
+
private _trtc;
|
|
13
|
+
constructor(options: {
|
|
14
|
+
getVoiceSign: GetVoiceSign;
|
|
15
|
+
});
|
|
16
|
+
private _initParentDom;
|
|
17
|
+
join: (options: {
|
|
18
|
+
voiceId: string;
|
|
19
|
+
userId: string;
|
|
20
|
+
roomId: string;
|
|
21
|
+
type: RTCType;
|
|
22
|
+
}) => Promise<boolean>;
|
|
23
|
+
quit(): Promise<boolean>;
|
|
24
|
+
detectMicro(): Promise<boolean>;
|
|
25
|
+
toggleMicro(flag?: boolean): Promise<boolean>;
|
|
26
|
+
shock(): void;
|
|
27
|
+
private _registerRtcEvent;
|
|
28
|
+
private _handleStreamAdded;
|
|
29
|
+
private _handleStreamSubscribed;
|
|
30
|
+
}
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BrowserRTC = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var Subscribe_1 = require("../shared-utils/Subscribe");
|
|
6
|
+
var RTCProtocol_1 = require("../typings/RTCProtocol");
|
|
7
|
+
var trtc_js_sdk_1 = (0, tslib_1.__importDefault)(require("trtc-js-sdk"));
|
|
8
|
+
var uuid_1 = require("../shared-utils/uuid");
|
|
9
|
+
var BrowserRTC = /** @class */ (function (_super) {
|
|
10
|
+
(0, tslib_1.__extends)(BrowserRTC, _super);
|
|
11
|
+
function BrowserRTC(options) {
|
|
12
|
+
var _this = _super.call(this) || this;
|
|
13
|
+
_this.type = RTCProtocol_1.RTCType.realsee;
|
|
14
|
+
_this.joined = false;
|
|
15
|
+
_this.micro = false;
|
|
16
|
+
_this.voiceId = '';
|
|
17
|
+
_this._getVoiceSign = function () {
|
|
18
|
+
throw new Error('方法 getVoiceSign 未实现');
|
|
19
|
+
};
|
|
20
|
+
_this.$dom = document.createElement('div');
|
|
21
|
+
_this._trtc = {
|
|
22
|
+
client: null,
|
|
23
|
+
stream: null,
|
|
24
|
+
};
|
|
25
|
+
_this.join = function (options) { return (0, tslib_1.__awaiter)(_this, void 0, void 0, function () {
|
|
26
|
+
var createClientOptions, result;
|
|
27
|
+
var _this = this;
|
|
28
|
+
var _a;
|
|
29
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
30
|
+
switch (_b.label) {
|
|
31
|
+
case 0:
|
|
32
|
+
this.emit('joinWillStart');
|
|
33
|
+
return [4 /*yield*/, this._getVoiceSign({
|
|
34
|
+
voiceId: options.voiceId,
|
|
35
|
+
roomId: options.roomId,
|
|
36
|
+
userId: options.userId,
|
|
37
|
+
})
|
|
38
|
+
// 1. 创建client
|
|
39
|
+
];
|
|
40
|
+
case 1:
|
|
41
|
+
createClientOptions = _b.sent();
|
|
42
|
+
// 1. 创建client
|
|
43
|
+
this._trtc.client = trtc_js_sdk_1.default.createClient((0, tslib_1.__assign)({ mode: 'rtc' }, createClientOptions));
|
|
44
|
+
// @ts-expect-error
|
|
45
|
+
(_a = this._trtc.client) === null || _a === void 0 ? void 0 : _a.enableAudioVolumeEvaluation();
|
|
46
|
+
// 2. 订阅事件
|
|
47
|
+
this._registerRtcEvent();
|
|
48
|
+
return [4 /*yield*/, new Promise(function (resolve) {
|
|
49
|
+
var _a;
|
|
50
|
+
(_a = _this._trtc.client) === null || _a === void 0 ? void 0 : _a.join({ roomId: Number(options.voiceId) }).then(function () { return resolve(true); }).catch(function () { return resolve(false); });
|
|
51
|
+
})];
|
|
52
|
+
case 2:
|
|
53
|
+
result = _b.sent();
|
|
54
|
+
this.joined = result;
|
|
55
|
+
if (!result)
|
|
56
|
+
return [2 /*return*/, false
|
|
57
|
+
// 4. 创建本地流
|
|
58
|
+
]; // 进房失败
|
|
59
|
+
// 4. 创建本地流
|
|
60
|
+
this._trtc.stream = trtc_js_sdk_1.default.createStream({ userId: createClientOptions.userId, audio: true, video: false });
|
|
61
|
+
return [4 /*yield*/, new Promise(function (resolve) {
|
|
62
|
+
var _a;
|
|
63
|
+
(_a = _this._trtc.stream) === null || _a === void 0 ? void 0 : _a.initialize().then(function () { return resolve(true); }).catch(function () { return resolve(false); });
|
|
64
|
+
})
|
|
65
|
+
// 6. 发布本地流
|
|
66
|
+
];
|
|
67
|
+
case 3:
|
|
68
|
+
// 5. 初始化本地流
|
|
69
|
+
result = _b.sent();
|
|
70
|
+
return [4 /*yield*/, new Promise(function (resolve) {
|
|
71
|
+
var _a;
|
|
72
|
+
(_a = _this._trtc.client) === null || _a === void 0 ? void 0 : _a.publish(_this._trtc.stream).then(function () { return resolve(true); }).catch(function () { return resolve(false); });
|
|
73
|
+
})];
|
|
74
|
+
case 4:
|
|
75
|
+
// 6. 发布本地流
|
|
76
|
+
result = _b.sent();
|
|
77
|
+
this.joined = result;
|
|
78
|
+
if (this.joined)
|
|
79
|
+
this.emit('joined');
|
|
80
|
+
return [2 /*return*/, result];
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
}); };
|
|
84
|
+
_this._handleStreamAdded = function (event) {
|
|
85
|
+
var _a;
|
|
86
|
+
var remoteStream = event.stream;
|
|
87
|
+
console.log('远端流增加: ' + remoteStream.getId());
|
|
88
|
+
//订阅远端流
|
|
89
|
+
(_a = _this._trtc.client) === null || _a === void 0 ? void 0 : _a.subscribe(remoteStream);
|
|
90
|
+
};
|
|
91
|
+
_this._handleStreamSubscribed = function (event) {
|
|
92
|
+
var remoteStream = event.stream;
|
|
93
|
+
console.log('远端流订阅成功:' + remoteStream.getId());
|
|
94
|
+
var playId = remoteStream.getId();
|
|
95
|
+
var domId = "rs-rtc-remote_stream-" + playId;
|
|
96
|
+
var dom = document.createElement('div');
|
|
97
|
+
dom.id = domId;
|
|
98
|
+
_this.$dom.appendChild(dom);
|
|
99
|
+
// 播放远端流
|
|
100
|
+
remoteStream.play(domId);
|
|
101
|
+
};
|
|
102
|
+
_this._getVoiceSign = options.getVoiceSign;
|
|
103
|
+
_this._initParentDom();
|
|
104
|
+
return _this;
|
|
105
|
+
}
|
|
106
|
+
BrowserRTC.prototype._initParentDom = function () {
|
|
107
|
+
this.$dom.id = "rs-rtc-" + (0, uuid_1.uuid)();
|
|
108
|
+
this.$dom.style.display = 'none';
|
|
109
|
+
document.body.appendChild(this.$dom);
|
|
110
|
+
};
|
|
111
|
+
BrowserRTC.prototype.quit = function () {
|
|
112
|
+
var _this = this;
|
|
113
|
+
return new Promise(function (resolve) { return (0, tslib_1.__awaiter)(_this, void 0, void 0, function () {
|
|
114
|
+
var _this = this;
|
|
115
|
+
var _a, _b;
|
|
116
|
+
return (0, tslib_1.__generator)(this, function (_c) {
|
|
117
|
+
switch (_c.label) {
|
|
118
|
+
case 0:
|
|
119
|
+
this.joined = false;
|
|
120
|
+
if (!this._trtc.stream) return [3 /*break*/, 2];
|
|
121
|
+
return [4 /*yield*/, ((_a = this._trtc.client) === null || _a === void 0 ? void 0 : _a.unpublish(this._trtc.stream))];
|
|
122
|
+
case 1:
|
|
123
|
+
_c.sent();
|
|
124
|
+
this._trtc.stream.stop();
|
|
125
|
+
this._trtc.stream.close();
|
|
126
|
+
this._trtc.stream = null;
|
|
127
|
+
_c.label = 2;
|
|
128
|
+
case 2:
|
|
129
|
+
(_b = this._trtc.client) === null || _b === void 0 ? void 0 : _b.leave().then(function () { return _this._trtc.client = null; }).then(function () { return resolve(true); }).catch(function () { return resolve(false); });
|
|
130
|
+
return [2 /*return*/];
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
}); });
|
|
134
|
+
};
|
|
135
|
+
BrowserRTC.prototype.detectMicro = function () {
|
|
136
|
+
return new Promise(function (resolve) {
|
|
137
|
+
var rule = { audio: true, video: false };
|
|
138
|
+
try {
|
|
139
|
+
navigator.mediaDevices
|
|
140
|
+
.getUserMedia(rule)
|
|
141
|
+
.then(function () { return resolve(true); })
|
|
142
|
+
.catch(function () { return resolve(false); });
|
|
143
|
+
}
|
|
144
|
+
catch (e) {
|
|
145
|
+
console.error(e);
|
|
146
|
+
resolve(false);
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
};
|
|
150
|
+
BrowserRTC.prototype.toggleMicro = function (flag) {
|
|
151
|
+
var _a, _b, _c, _d;
|
|
152
|
+
return Promise.resolve((flag ? (_b = (_a = this._trtc) === null || _a === void 0 ? void 0 : _a.stream) === null || _b === void 0 ? void 0 : _b.unmuteAudio() : (_d = (_c = this._trtc) === null || _c === void 0 ? void 0 : _c.stream) === null || _d === void 0 ? void 0 : _d.muteAudio()) || false);
|
|
153
|
+
};
|
|
154
|
+
BrowserRTC.prototype.shock = function () {
|
|
155
|
+
throw new Error('Method not implemented.');
|
|
156
|
+
};
|
|
157
|
+
BrowserRTC.prototype._registerRtcEvent = function () {
|
|
158
|
+
var _this = this;
|
|
159
|
+
var _a, _b, _c, _d;
|
|
160
|
+
(_a = this._trtc.client) === null || _a === void 0 ? void 0 : _a.on('stream-added', this._handleStreamAdded);
|
|
161
|
+
(_b = this._trtc.client) === null || _b === void 0 ? void 0 : _b.on('stream-subscribed', this._handleStreamSubscribed);
|
|
162
|
+
// @ts-expect-error
|
|
163
|
+
(_c = this._trtc.client) === null || _c === void 0 ? void 0 : _c.on('audio-volume', function (event) { return _this.emit('userVolumes', event.result); });
|
|
164
|
+
(_d = this._trtc.client) === null || _d === void 0 ? void 0 : _d.on('error', function (event) { return _this.emit('error', event); });
|
|
165
|
+
};
|
|
166
|
+
return BrowserRTC;
|
|
167
|
+
}(Subscribe_1.Subscribe));
|
|
168
|
+
exports.BrowserRTC = BrowserRTC;
|
|
169
|
+
//# sourceMappingURL=BrowserRTC.js.map
|