@hysc/meeting 10.0.4 → 10.0.6

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/dist/index.d.ts CHANGED
@@ -1,4 +1,6 @@
1
1
  import * as lodash_es from 'lodash-es';
2
+ import * as _hysc_brtc from '@hysc/brtc';
3
+ import { LocalStream, RemoteStream, Device, SubscribeOptions, VideoProfile, AudioHint } from '@hysc/brtc';
2
4
  import BCClient, { BCUser, ShareMediaOptions, Player, AudioPlayer } from '@hysc/core';
3
5
  import { BehaviorSubject, Subject } from 'rxjs';
4
6
  import { BoomError } from '@hysc/utils';
@@ -36,839 +38,6 @@ declare class BMMessageInfo {
36
38
  constructor(props: IMessageInfo);
37
39
  }
38
40
 
39
- /**
40
- * 内置 user id 类型
41
- */
42
- declare type UserId = number | string;
43
- /**
44
- * MediaStreamTrack 类型
45
- */
46
- declare type TrackType = 'audio' | 'video';
47
- /**
48
- * 视频 Profile 枚举
49
- */
50
- declare type VideoProfile = '120p' | '180p' | '240p' | '360p' | '480p' | '720p' | '1080p' | '1440p' | '4k';
51
- /**
52
- * 音频 Profile 枚举
53
- */
54
- declare type AudioProfile = 'standard' | 'standard-stereo' | 'high' | 'high-stereo';
55
- /**
56
- * 屏幕分享 Profile 枚举
57
- */
58
- declare type ScreenProfile = '480p' | '480p_2' | '720p' | '720p_2' | '1080p' | '1080p_2';
59
- /**
60
- * 视频自适应模式
61
- * motion 流畅模式
62
- * detail & text 清晰模式
63
- * ‘’ 平衡模式
64
- */
65
- declare type VideoHint = '' | 'motion' | 'detail' | 'text';
66
- /**
67
- * 音频自适应模式
68
- * speech 演讲模式
69
- * speech-recognition 语音识别模式
70
- * music 音乐模式
71
- * ‘’ 平衡模式
72
- */
73
- declare type AudioHint = '' | 'speech' | 'speech-recognition' | 'music';
74
- /**
75
- * 设备接口
76
- */
77
- declare interface Device {
78
- /**
79
- * 设备标识
80
- */
81
- deviceId: string;
82
- /**
83
- * 设备分组 id,来自同一个硬件的两个设备具有相同的 groupId
84
- */
85
- groupId: string;
86
- /**
87
- * 设备索引
88
- */
89
- index: number;
90
- /**
91
- * 设备名称
92
- */
93
- name: string;
94
- /**
95
- * 设备类型
96
- */
97
- kind: 'videoinput' | 'audioinput' | 'audiooutput';
98
- /**
99
- * 是否是系统默认设备
100
- */
101
- default: boolean;
102
- }
103
- /**
104
- * 大流还是小流
105
- */
106
- declare type StreamSimulcastType = 'small' | 'big';
107
- /**
108
- * 主流还是辅流
109
- */
110
- declare type StreamType$1 = 'main' | 'assist';
111
- /**
112
- * 创建本地流配置项
113
- */
114
- declare interface StreamDeviceOption {
115
- /**
116
- * 流类型,主流还是辅流,vloud 底层使用
117
- */
118
- type?: StreamType$1;
119
-
120
- /**
121
- * 流来源类型
122
- */
123
- sourceType: 'camera' | 'screen' | 'file'
124
- /**
125
- * 是否有视频
126
- */
127
- video?: boolean;
128
- /**
129
- * 是否有音频
130
- */
131
- audio?: boolean;
132
- /**
133
- * 是否是屏幕分享
134
- */
135
- screen?: boolean;
136
- /**
137
- * 麦克风设备标识
138
- */
139
- microphoneId?: string;
140
- /**
141
- * 摄像头设备标识
142
- */
143
- cameraId?: string;
144
- /**
145
- * 自定义音频源
146
- */
147
- audioSource?: MediaStreamTrack;
148
- /**
149
- * 自定义视频源
150
- */
151
- videoSource?: MediaStreamTrack;
152
- /**
153
- * 是否开启回声消除
154
- */
155
- echoCancellation?: boolean;
156
- /**
157
- * 是否开启自动增益
158
- */
159
- autoGainControl?: boolean;
160
- /**
161
- * 是否开启自动降噪
162
- */
163
- noiseSuppression?: boolean;
164
- /**
165
- * 自适应策略
166
- * https://www.w3.org/TR/mst-content-hint/#video-content-hints
167
- */
168
- videoHint?: VideoHint;
169
- /**
170
- * 自适应策略
171
- * https://www.w3.org/TR/mst-content-hint/#audio-content-hints
172
- */
173
- audioHint?: AudioHint;
174
- }
175
- declare interface StreamPlayOption {
176
- /**
177
- * video fit 类型
178
- */
179
- fit?: 'cover' | 'contain';
180
- /**
181
- * 静音播放
182
- */
183
- muted?: boolean;
184
- /**
185
- * 水平旋转
186
- */
187
- rotateX?: number;
188
- /**
189
- * 垂直旋转
190
- */
191
- rotateY?: number;
192
- /**
193
- * 背景颜色
194
- */
195
- backgroundColor?: string;
196
-
197
- audio?: boolean
198
- }
199
- /**
200
- * LocalStream stats 接口
201
- */
202
- declare interface LocalStreamStats {
203
- /**
204
- * 视频丢包数
205
- */
206
- videoPacketsLost?: number;
207
- /**
208
- * 音频丢包数
209
- */
210
- audioPacketsLost?: number;
211
- /**
212
- * 视频发送字节数
213
- */
214
- videoBytesSent?: number;
215
- /**
216
- * 视频包发送数
217
- */
218
- videoPacketsSent?: number;
219
- /**
220
- * 音频发送字节数
221
- */
222
- audioBytesSent?: number;
223
- /**
224
- * 音频包发送数
225
- */
226
- audioPacketsSent?: number;
227
- /**
228
- * 视频宽度
229
- */
230
- width?: number;
231
- /**
232
- * 视频高度
233
- */
234
- height?: number;
235
- /**
236
- * rtt 网络延时
237
- */
238
- rtt?: number;
239
- /**
240
- * 编码帧数
241
- */
242
- framesEncoded?: number;
243
- /**
244
- * 发送帧数
245
- */
246
- framesSent?: number;
247
- }
248
- /**
249
- * RemoteStream stats 接口
250
- */
251
- declare interface RemoteStreamStats {
252
- /**
253
- * 视频丢包数
254
- */
255
- videoPacketsLost?: number;
256
- /**
257
- * 音频丢包数
258
- */
259
- audioPacketsLost?: number;
260
- /**
261
- * 视频接收字节数
262
- */
263
- videoBytesReceived?: number;
264
- /**
265
- * 音频包接收数
266
- */
267
- videoPacketsReceived?: number;
268
- /**
269
- * 音频接收字节数
270
- */
271
- audioBytesReceived?: number;
272
- /**
273
- * 音频包接收数
274
- */
275
- audioPacketsReceived?: number;
276
- /**
277
- * 视频宽度
278
- */
279
- width?: number;
280
- /**
281
- * 视频高度
282
- */
283
- height?: number;
284
- /**
285
- * rtt 网络延时
286
- */
287
- rtt?: number;
288
- /**
289
- * 解码帧数
290
- */
291
- framesDecoded?: number;
292
- }
293
- declare interface StreamCodecOption {
294
- /**
295
- * 视频宽度
296
- */
297
- width?: number;
298
- /**
299
- * 视频高度
300
- */
301
- height?: number;
302
- /**
303
- * 视频帧率
304
- */
305
- frameRate?: number;
306
- /**
307
- * 音频码率
308
- */
309
- /**
310
- * 视频码率
311
- */
312
- bitrate?: number;
313
- /**
314
- * 设置 h264 profile,默认 42e01f
315
- */
316
- profile?: string;
317
- }
318
- declare abstract class Stream {
319
- /**
320
- * 本地流标识
321
- */
322
- static readonly STREAM_TYPE_LOCAL = 0;
323
- /**
324
- * 远端流标识
325
- */
326
- static readonly STREAM_TYPE_REMOTE = 1;
327
- /**
328
- * 创建流实例
329
- *
330
- * @param type 流类型
331
- * @param uid 用户 id
332
- * @param unumber 用户 number
333
- * @param webrtcType webrtc 底层类型
334
- * @param stream 底层流对象
335
- * @returns Stream
336
- */
337
- constructor(type: number, sid?: string, uid?: UserId, webrtcType?: number, stream?: any, subStream?: any);
338
- /**
339
- * 判断是否是本地流
340
- *
341
- * @returns boolean
342
- */
343
- isLocalStream(): boolean;
344
- /**
345
- * 是否是屏幕分享流
346
- *
347
- * @returns boolean
348
- */
349
- isScreenStream(): boolean;
350
- /**
351
- * 流是否正在播放
352
- *
353
- * @returns boolean
354
- */
355
- isPlaying(): boolean;
356
- /**
357
- * 获取 userId
358
- *
359
- * @returns number
360
- */
361
- getUserId(): UserId;
362
- /**
363
- * 获取 stream id
364
- *
365
- * @returns string
366
- */
367
- getStreamId(): string;
368
- /**
369
- * 是否有视频
370
- *
371
- * @returns boolean
372
- */
373
- hasVideo(): boolean;
374
- /**
375
- * 是否有音频
376
- *
377
- * @returns boolean
378
- */
379
- hasAudio(): boolean;
380
- /**
381
- * 获取流视频是否挂起
382
- *
383
- * @returns boolean
384
- */
385
- getVideoOn(): boolean;
386
- /**
387
- * 获取流音频是否挂起
388
- *
389
- * @returns boolean
390
- */
391
- getAudioOn(): boolean;
392
- /**
393
- * 音频轨道
394
- */
395
- get audioTrack(): MediaStreamTrack;
396
- /**
397
- * 视频轨道
398
- */
399
- get videoTrack(): MediaStreamTrack;
400
- /**
401
- * 获取音频轨道
402
- *
403
- * @returns MediaStreamTrack
404
- */
405
- getAudioTrack(): MediaStreamTrack;
406
- /**
407
- * 获取视频轨道
408
- *
409
- * @returns MediaStreamTrack
410
- */
411
- getVideoTrack(): MediaStreamTrack;
412
- /**
413
- * 获取 MediaStream 实例
414
- *
415
- * @returns MediaStream
416
- */
417
- getMediaStream(): MediaStream;
418
- /**
419
- * 禁用视频轨道
420
- *
421
- * - 对于本地流,调用该方法会停止发送视频,远端会触发 Client.on('mute-video') 事件
422
- * - 如果视频是从摄像头采集,此时摄像头灯仍然是亮着的。若想完全禁用视频轨道(即关闭摄像头)
423
- * - 可以使用 removeTrack() 删除视频轨道然后调用 MediaStreamTrack.stop() 关闭视频轨道(关闭摄像头)
424
- * - 对于远端流,调用该方法会停止播放视频,但是仍然接收视频数据。
425
- *
426
- * @returns boolean 是否成功
427
- */
428
- muteVideo(): Promise<boolean>;
429
- /**
430
- * 启用视频轨道
431
- *
432
- * - 对于本地流,调用该方法会触发远端 Client.on('unmute-video') 事件。
433
- * - 视频轨道默认是开启的,若你调用 muteVideo() 后可用该方法重新启用视频。
434
- *
435
- * @returns boolean 是否成功
436
- */
437
- unmuteVideo(): Promise<boolean>;
438
- /**
439
- * 禁用音频轨道
440
- *
441
- * - 对于本地流,调用该方法会停止发送音频,远端会触发 Client.on('mute-audio') 事件。
442
- * - 对于远端流,调用该方法会停止播放音频,但是仍然接收音频数据。
443
- *
444
- * @returns boolean 是否成功
445
- */
446
- muteAudio(): Promise<boolean>;
447
- /**
448
- * 启用音频轨道
449
- *
450
- * - 对于本地流,调用该方法会触发远端 Client.on('unmute-audio') 事件。
451
- * - 音频轨道默认是开启的,若你调用 muteAudio() 后可用该方法重新启用音频。
452
- *
453
- * @returns boolean 是否成功
454
- */
455
- unmuteAudio(): Promise<boolean>;
456
- /**
457
- * 播放流
458
- *
459
- * @param videoId 挂载 dom
460
- * @param options 播放选项
461
- *
462
- * @returns any
463
- */
464
- play(videoId: string | HTMLDivElement, options?: StreamPlayOption): Promise<any>;
465
- /**
466
- * 重新播放流
467
- *
468
- * @returns any
469
- */
470
- replay(): Promise<void>;
471
- /**
472
- * 恢复播放音视频
473
- *
474
- * - 在某些版本浏览器上移动传入 play() 的 div 容器可能会导致音视频播放器进入 ‘PAUSED’ 状态,此时 需要调用该接口恢复播放。
475
- * - 由于浏览器自动播放策略的限制,在 play() 返回 PLAY_NOT_ALLOWED 错误后需要引导用户通过手势 调用该接口恢复播放
476
- *
477
- * @returns any
478
- */
479
- resume(): Promise<any>;
480
- /**
481
- * 停止播放流
482
- *
483
- * @returns void
484
- */
485
- stop(): void;
486
- /**
487
- * 销毁音视频流
488
- *
489
- * @returns void
490
- */
491
- destroy(): void;
492
- /**
493
- * 获取流的麦克风音量
494
- *
495
- * @returns number
496
- */
497
- getAudioLevel(): number;
498
- /**
499
- * 提交事件
500
- *
501
- * @param type 事件类型
502
- * @param data 事件数据
503
- *
504
- * @returns void
505
- */
506
- fire(type: string, data?: any): void;
507
- /**
508
- * 设置事件监听
509
- * 支持链式调用
510
- * 支持命名空间 `type.namespace`,使用 `.` 来分隔 `type` 和 `namespace`
511
- *
512
- * @param type 事件类型
513
- * @param listener 监听函数
514
- *
515
- * @returns Stream
516
- */
517
- on(type: 'video-track-ended', listener: typeof stream_event_video_track_ended): this;
518
- on(type: 'video-track-mute', listener: typeof stream_event_video_track_mute): this;
519
- on(type: 'video-track-unmute', listener: typeof stream_event_video_track_unmute): this;
520
- on(type: 'audio-track-ended', listener: typeof stream_event_audio_track_ended): this;
521
- on(type: 'audio-track-mute', listener: typeof stream_event_audio_track_mute): this;
522
- on(type: 'audio-track-unmute', listener: typeof stream_event_audio_track_unmute): this;
523
- on(type: 'track-update', listener: typeof stream_event_track_update): this;
524
- on(type: 'player-state-changed', listener: typeof stream_event_player_state_changed): this;
525
- on(type: 'connect-error', listener: typeof stream_event_connect_error): this;
526
- on(type: string, listener: Function): this;
527
- /**
528
- * 设置一次事件监听
529
- * 支持链式调用
530
- * 支持命名空间 `type.namespace`,使用 `.` 来分隔 `type` 和 `namespace`
531
- *
532
- * @param type 事件类型
533
- * @param listener 监听函数
534
- *
535
- * @returns Stream
536
- */
537
- one(type: 'video-track-ended', listener: typeof stream_event_video_track_ended): this;
538
- one(type: 'video-track-mute', listener: typeof stream_event_video_track_mute): this;
539
- one(type: 'video-track-unmute', listener: typeof stream_event_video_track_unmute): this;
540
- one(type: 'audio-track-ended', listener: typeof stream_event_audio_track_ended): this;
541
- one(type: 'audio-track-mute', listener: typeof stream_event_audio_track_mute): this;
542
- one(type: 'audio-track-unmute', listener: typeof stream_event_audio_track_unmute): this;
543
- one(type: 'track-update', listener: typeof stream_event_track_update): this;
544
- one(type: 'player-state-changed', listener: typeof stream_event_player_state_changed): this;
545
- one(type: 'connect-error', listener: typeof stream_event_connect_error): this;
546
- one(type: string, listener: Function): this;
547
- /**
548
- * 取消事件监听
549
- * 支持链式调用
550
- *
551
- * @param type 事件类型或者命名空间
552
- * - 如果传入命名空间则解绑此命名空间的所有回调
553
- * - 如果不传则解绑所有设置过的回调
554
- * @param listener 绑定函数
555
- * - 如果不传则解绑指定 `type` 的所有回调,否则只解绑指定 `type` 和 `listener` 的回调
556
- *
557
- * @returns Stream
558
- */
559
- off(type?: string, listener?: Function): this;
560
- /**
561
- * 获取当前播放的扬声器设备 id
562
- *
563
- * @returns string
564
- */
565
- getAudioDeviceId(): string;
566
- /**
567
- * 获取当前播放音量
568
- *
569
- * @returns number
570
- */
571
- getAudioVolume(): number;
572
- /**
573
- * 截取当前流的一帧视频数据(base64 png),该方法需要在 play() 后调用,并且 Stream 中有视频流才有效
574
- *
575
- * @returns string
576
- */
577
- getVideoFrame(): string;
578
- /**
579
- * 获取流的传输信息
580
- */
581
- abstract getStats(): Promise<LocalStreamStats | RemoteStreamStats>;
582
- }
583
- /**
584
- * 本地流对象
585
- */
586
- declare class LocalStream extends Stream {
587
- /**
588
- * 创建本地流实例
589
- *
590
- * @param options 配置项
591
- *
592
- * @returns 本地流实例
593
- */
594
- constructor(options: StreamDeviceOption, id?: string);
595
- /**
596
- * 是否是屏幕分享流
597
- *
598
- * @returns boolean
599
- */
600
- isScreenStream(): boolean;
601
- /**
602
- * 设置视频 profile
603
- *
604
- * - 该方法需要在调用 init() 之前调用。
605
- *
606
- * @param profile
607
- *
608
- * @returns void
609
- */
610
- setVideoProfile(profile: VideoProfile): void;
611
- /**
612
- * 设置屏幕分享 profile
613
- *
614
- * - 该方法需要在调用 init() 之前调用。
615
- *
616
- * @param profile
617
- *
618
- * @returns void
619
- */
620
- setScreenProfile(profile: ScreenProfile): void;
621
- /**
622
- * 设置音频 profile
623
- *
624
- * @description 该方法需要在调用 init() 之前调用。
625
- *
626
- * @param profile
627
- *
628
- * @returns void
629
- */
630
- setAudioProfile(profile: AudioProfile): void;
631
- /**
632
- * 设置自定义视频编码配置
633
- *
634
- * - 该方法可以根据需要灵活设置本地流的视频分辨率、帧率和码率。
635
- * - 该方法需要在调用 init() 之前调用。
636
- *
637
- * @param options 配置项
638
- *
639
- * @returns void
640
- */
641
- setVideoEncoderConfiguration(options: StreamCodecOption): void;
642
- /**
643
- * 初始化 LocalStream 实例
644
- *
645
- * @returns any
646
- */
647
- init(): Promise<any>;
648
- /**
649
- * 添加音频或视频轨道
650
- *
651
- * - 调用该方法将音频或视频轨道添加到本地流,若该本地流已经被发布,则会自动更新发往远端的音视频流,此时远端会收到 Client.on('stream-updated') 事件通知。
652
- * - 请注意,一个 Stream 对象中最多只能同时包含一路音频轨道和一路视频轨道。如果你想要更换同类型的轨道,请使用 replaceTrack()。
653
- * - 新的音视频轨道可以通过 createStream()/getAudioTrack()|getVideoTrack() 获取, 或者直接通过 getUserMedia()、captureStream() 获取。
654
- *
655
- * @param track 媒体轨道
656
- *
657
- * @returns any
658
- */
659
- addTrack(track: MediaStreamTrack): Promise<any>;
660
- /**
661
- * 移除视频轨道
662
- *
663
- * - 调用该方法会移除本地流中的视频轨道,若本地流已经被发布,则会自动更新发往远端的视频流,此时远端会收到 Client.on('stream-updated') 事件通知。
664
- * - 请注意,一个已经发布的 Stream 对象中至少要有一个媒体轨道,如果你想完全删除本地流中的音视频轨道,请直接通过 unpublish() 取消发布, 然后再通过 close() 关闭本地流。
665
- *
666
- * @param track 媒体轨道
667
- *
668
- * @returns any
669
- */
670
- removeTrack(track: MediaStreamTrack): Promise<any>;
671
- /**
672
- * 更换音频或视频轨道
673
- *
674
- * - 调用该方法更换本地流中的同类型轨道,若本地流已经被发布,该方法会自动更新发往远端的音视频流,此时远端会收到 Client.on('stream-updated') 事件通知。
675
- * - 新的音视频轨道可以通过 createStream()/getAudioTrack()|getVideoTrack() 获取, 或者直接通过 getUserMedia()、captureStream() 获取。
676
- * - 如果需要更换媒体输入设备,推荐使用 switchDevice()。
677
- * - 在更换视频轨道时,要求视频分辨率跟 setVideoProfile() 设置保持一致,否则会抛出异常
678
- * - 支持 Chrome 65+、Safari 浏览器
679
- *
680
- * @param track 媒体轨道
681
- *
682
- * @returns any
683
- */
684
- replaceTrack(track: MediaStreamTrack): Promise<any>;
685
- /**
686
- * 切换媒体输入设备
687
- *
688
- * - 调用该方法可更换本地流的媒体输入设备
689
- *
690
- * @param type 切换类型
691
- * @param deviceId
692
- *
693
- * @returns any
694
- */
695
- switchDevice(type: TrackType, deviceId: string): Promise<any>;
696
- /**
697
- * 播放本地流
698
- *
699
- * @param videoId 挂载 dom
700
- * @param options 播放选项
701
- *
702
- * @returns any
703
- */
704
- play(videoId: string | HTMLDivElement, options?: StreamPlayOption): Promise<any>;
705
- /**
706
- * 获取流的传输信息
707
- *
708
- * @returns LocalStreamStats
709
- */
710
- getStats(): Promise<LocalStreamStats>;
711
- /**
712
- * 发送 sei 消息
713
- * - 单次最大发送 1KB(Byte),每秒最大调用次数 30 次,每秒最多发送 8KB。
714
- * - 目前仅支持 Chrome 86+, Edge 86+, Opera 72+ 浏览器。
715
- * - 由于 SEI 跟随视频帧一起发送,视频帧有丢失的可能,因此 SEI 也可能丢失。
716
- * 可在使用频次限制范围内,增加发送次数,业务侧需要在接收端做消息去重。
717
- * - 没有推视频流时,无法发送 SEI;没有订阅视频流时,无法接收 SEI。
718
- * - 仅支持 H264 编码器发送 SEI。
719
- * - 小流暂不支持 SEI 收发。
720
- * - 设置 SEI payload type。SDK 默认使用自定义 payloadType 243,业务侧可使用该参数将 payloadType 设置为标准的 5
721
- * 当业务侧使用 5 payloadType 时,需按照规范确保 buffer 的前 16 字节是业务侧自定义的 uuid。
722
- *
723
- * @param buffer
724
- * @param options
725
- */
726
- sendSEIMessage(buffer: ArrayBuffer, options: {
727
- payloadType?: number;
728
- }): void;
729
- }
730
- /**
731
- * 远端流对象
732
- */
733
- declare class RemoteStream extends Stream {
734
- /**
735
- * 创建远端流
736
- *
737
- * @param uid 用户 id
738
- * @param unumber 用户 number
739
- * @param webrtcType 底层类型
740
- * @param stream 底层流
741
- *
742
- * @returns RemoteStream
743
- */
744
- constructor(uid: number, webrtcType?: number, stream?: any, subStream?: any, sid?: string);
745
- /**
746
- * 是否已订阅流
747
- *
748
- * @returns boolean
749
- */
750
- isSubscribed(): boolean;
751
- /**
752
- * 设置输出扬声器设备
753
- *
754
- * @param deviceId 扬声器标识
755
- *
756
- * @returns any
757
- */
758
- setAudioOutput(deviceId: string): Promise<any>;
759
- /**
760
- * 设置播放音量
761
- *
762
- * @param volume 播放音量
763
- * - 取值范围:[0, 1]
764
- * - 默认 1
765
- * @returns any
766
- */
767
- setAudioVolume(volume: number): void;
768
-
769
- getType(): string;
770
- /**
771
- * 播放远端流
772
- *
773
- * @param videoId 挂载 dom
774
- * @param options 播放选项
775
- *
776
- * @returns any
777
- */
778
- play(videoId: string | HTMLDivElement, options?: StreamPlayOption): Promise<any>;
779
- /**
780
- * 获取流的传输信息
781
- *
782
- * @returns RemoteStreamStats
783
- */
784
- getStats(): Promise<RemoteStreamStats>;
785
- }
786
- /**
787
- *
788
- * @returns void
789
- */
790
- declare function stream_event_video_track_ended(): void;
791
- /**
792
- *
793
- * @returns void
794
- */
795
- declare function stream_event_audio_track_ended(): void;
796
- /**
797
- *
798
- * @returns void
799
- */
800
- declare function stream_event_video_track_mute(): void;
801
- /**
802
- *
803
- * @returns void
804
- */
805
- declare function stream_event_audio_track_mute(): void;
806
- /**
807
- *
808
- * @returns void
809
- */
810
- declare function stream_event_video_track_unmute(): void;
811
- /**
812
- *
813
- * @returns void
814
- */
815
- declare function stream_event_audio_track_unmute(): void;
816
- /**
817
- * track 更新
818
- *
819
- * @param event Object
820
- * - type track 类型
821
- * - track 更新 track
822
- *
823
- * @returns void
824
- */
825
- declare function stream_event_track_update(event: {
826
- type: TrackType;
827
- track: MediaStreamTrack;
828
- }): void;
829
- /**
830
- * 播放状态改变
831
- *
832
- * @param event Object
833
- * - type track 类型
834
- * - state 播放状态
835
- * - reason 原因
836
- *
837
- * @returns void
838
- */
839
- declare function stream_event_player_state_changed(event: {
840
- type: TrackType;
841
- state: 'PAUSE' | 'PLAYING' | 'STOPPED';
842
- reason: string;
843
- }): void;
844
- /**
845
- * pc 连接失败
846
- *
847
- * @returns void
848
- */
849
- declare function stream_event_connect_error(): void;
850
- /**
851
- * 订阅流参数
852
- */
853
- declare interface SubscribeOptions {
854
- /**
855
- * 是否订阅视频
856
- */
857
- video: boolean;
858
- /**
859
- * 是否订阅音频
860
- */
861
- audio: boolean;
862
- /**
863
- * 订阅流类型,大流还是小流,默认大流
864
- */
865
- streamType?: StreamSimulcastType;
866
-
867
- videoEnable?: boolean
868
-
869
- audioEnable?: boolean
870
- }
871
-
872
41
  /**
873
42
  * @name: stream
874
43
  * @author: yangliye
@@ -1620,7 +789,7 @@ declare class BMStreamModel {
1620
789
  /**
1621
790
  * 获取流的传输信息
1622
791
  */
1623
- getStats(): Promise<RemoteStreamStats> | Promise<LocalStreamStats> | undefined;
792
+ getStats(): Promise<_hysc_brtc.RemoteStreamStats> | Promise<_hysc_brtc.LocalStreamStats> | undefined;
1624
793
  /**
1625
794
  * BIND_ELEMENT 事件
1626
795
  * @param eleId
@@ -2658,7 +1827,7 @@ declare class BMRoom {
2658
1827
  * @param {String} props.userinfo.nickname 用户昵称
2659
1828
  * @param {String} props.userinfo.avatar 用户头像
2660
1829
  * @param {String} props.userinfo.pos 客户端类型
2661
- * @param {Number} props.type //1:单一模式, 2:混合模式
1830
+ * @param {Number} props.types //1:单一模式, 2:混合模式
2662
1831
  * @param {String} props.name //房间名
2663
1832
  * @example
2664
1833
  * {
@@ -2666,7 +1835,7 @@ declare class BMRoom {
2666
1835
  host: 'https://v3test.boom.cn',//会议内的请求地址
2667
1836
  getProxiesUrl: '/api/conference/v1/auth/token',//获取ws地址的路径
2668
1837
  secret: '',//房间密码
2669
- type: 1,
1838
+ types: 1,
2670
1839
  nickname: 'zzy',
2671
1840
  collection: '',//数据上报地址
2672
1841
  token: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJsb2dpbiIsImlhdCI6MTY1MDA5ODkwMSwibmJmIjoxNjUwMDk4OTAxLCJqdGkiOiIiLCJzdWIiOjk4NSwicHJ2IjoiODdlN2UxYmVlMjcyMmJmMzk4NjQxN2IzMzUxZTVmMjYzODQwY2ExYyIsImF0dHIiOjAsImJkIjowfQ.b-J9TnmjOzaVUJeY83tY_d1rdu_ELAWx8iH3odBN5kE',//用户token
@@ -2761,31 +1930,31 @@ declare class BMRoom {
2761
1930
  createPBSingleLocalStream(options?: {
2762
1931
  video: boolean;
2763
1932
  audio: boolean;
2764
- }, sid?: string): Promise<LocalStream>;
1933
+ }, sid?: string): Promise<_hysc_brtc.LocalStream>;
2765
1934
  /**
2766
1935
  * 枚举视频输入设备
2767
1936
  *
2768
1937
  * @returns 设备列表
2769
1938
  */
2770
- enumVideoDevices: typeof undefined;
1939
+ enumVideoDevices: typeof _hysc_brtc.enumVideoDevices;
2771
1940
  /**
2772
1941
  * 枚举音频输入设备
2773
1942
  *
2774
1943
  * @returns 设备列表
2775
1944
  */
2776
- enumAudioInputDevices: typeof undefined;
1945
+ enumAudioInputDevices: typeof _hysc_brtc.enumAudioInputDevices;
2777
1946
  /**
2778
1947
  * 枚举音频输出设备
2779
1948
  *
2780
1949
  * @returns 设备列表
2781
1950
  */
2782
- enumAudioOutputDevices: typeof undefined;
1951
+ enumAudioOutputDevices: typeof _hysc_brtc.enumAudioOutputDevices;
2783
1952
  /**
2784
1953
  * 检查音视频权限
2785
1954
  */
2786
- getPermissions: typeof undefined;
2787
- checkSystemSupport: typeof undefined;
2788
- createStream: typeof undefined;
1955
+ getPermissions: typeof _hysc_brtc.getPermissions;
1956
+ checkSystemSupport: typeof _hysc_brtc.checkSystemSupport;
1957
+ createStream: typeof _hysc_brtc.createStream;
2789
1958
  participantNotice: boolean;
2790
1959
  /**
2791
1960
  * 订阅远端流
@@ -3140,7 +2309,7 @@ declare class BMRoom {
3140
2309
  addUser2Queue(pullItem: PullItem): Promise<void>;
3141
2310
  processUser: (uIds: Map<string, PullItem>) => Promise<void>;
3142
2311
  queueProcessor: lodash_es.DebouncedFunc<(uIds: Map<string, PullItem>) => Promise<void>>;
3143
- queryBrtcStreams(uids: string[]): Promise<RemoteStream[]>;
2312
+ queryBrtcStreams(uids: string[]): Promise<_hysc_brtc.RemoteStream[]>;
3144
2313
  handleAddStreams(streams: SingleRemoteStream[]): void;
3145
2314
  getForceUser(forceId: string): Promise<void>;
3146
2315
  getVersion(): string;