@seastart/srtc-web-sdk 0.4.0 → 0.4.2
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/package.json +1 -1
- package/srtc.d.mts +116 -1
- package/srtc.d.ts +116 -1
- package/srtc.js +1 -1
- package/srtc.mjs +1 -1
package/package.json
CHANGED
package/srtc.d.mts
CHANGED
|
@@ -242,6 +242,14 @@ export declare class ChannelEventType extends CommonChannelEventType {
|
|
|
242
242
|
static readonly DEVICE_REMOVE = "device_remove";
|
|
243
243
|
/** 轨道自动播放失败,对应data为BaseTrack */
|
|
244
244
|
static readonly TRACK_AUTOPLAY_FAIL = "track_autoplay_fail";
|
|
245
|
+
/** 轨道进入画中画模式,对应data为BaseTrack */
|
|
246
|
+
static readonly TRACK_PIP_ENTER = "track_pip_enter";
|
|
247
|
+
/** 轨道退出画中画模式,对应data为BaseTrack */
|
|
248
|
+
static readonly TRACK_PIP_EXIT = "track_pip_exit";
|
|
249
|
+
/** 轨道弹出独立窗口,对应data为BaseTrack */
|
|
250
|
+
static readonly TRACK_POPOUT_OPEN = "track_popout_open";
|
|
251
|
+
/** 轨道关闭独立窗口,对应data为BaseTrack */
|
|
252
|
+
static readonly TRACK_POPOUT_CLOSE = "track_popout_close";
|
|
245
253
|
}
|
|
246
254
|
/** 频道外事件通知 */
|
|
247
255
|
export declare class ImEvent {
|
|
@@ -378,6 +386,38 @@ export declare class LocalVideoTrack extends BaseWebrtcTrack {
|
|
|
378
386
|
* 移除所有播放窗口
|
|
379
387
|
*/
|
|
380
388
|
removeAllPlayViews(): void;
|
|
389
|
+
/**
|
|
390
|
+
* 将指定容器的视频进入画中画模式
|
|
391
|
+
* @param container 播放容器
|
|
392
|
+
* @param options 画中画配置
|
|
393
|
+
*/
|
|
394
|
+
enterPictureInPicture(container: HTMLElement, options?: PipOptions): Promise<PipHandle>;
|
|
395
|
+
/**
|
|
396
|
+
* 退出指定容器的画中画
|
|
397
|
+
* @param container 播放容器
|
|
398
|
+
*/
|
|
399
|
+
exitPictureInPicture(container: HTMLElement): Promise<void>;
|
|
400
|
+
/**
|
|
401
|
+
* 指定容器是否处于画中画模式
|
|
402
|
+
* @param container 播放容器
|
|
403
|
+
*/
|
|
404
|
+
isPictureInPicture(container: HTMLElement): boolean;
|
|
405
|
+
/**
|
|
406
|
+
* 将指定容器的视频弹出到独立窗口(可拖到第二个显示器)
|
|
407
|
+
* @param container 播放容器
|
|
408
|
+
* @param options 弹出窗口配置
|
|
409
|
+
*/
|
|
410
|
+
popOutToWindow(container: HTMLElement, options?: PopOutOptions): PopOutHandle;
|
|
411
|
+
/**
|
|
412
|
+
* 关闭指定容器的弹出窗口
|
|
413
|
+
* @param container 原始播放容器
|
|
414
|
+
*/
|
|
415
|
+
closePopOutWindow(container: HTMLElement): void;
|
|
416
|
+
/**
|
|
417
|
+
* 指定容器是否已弹出到独立窗口
|
|
418
|
+
* @param container 播放容器
|
|
419
|
+
*/
|
|
420
|
+
isPopOut(container: HTMLElement): boolean;
|
|
381
421
|
}
|
|
382
422
|
/**
|
|
383
423
|
* 远端混音流
|
|
@@ -429,6 +469,38 @@ export declare class RemoteVideoTrack extends BaseWebrtcTrack {
|
|
|
429
469
|
* 移除所有播放窗口
|
|
430
470
|
*/
|
|
431
471
|
removeAllPlayViews(): void;
|
|
472
|
+
/**
|
|
473
|
+
* 将指定容器的视频进入画中画模式
|
|
474
|
+
* @param container 播放容器
|
|
475
|
+
* @param options 画中画配置
|
|
476
|
+
*/
|
|
477
|
+
enterPictureInPicture(container: HTMLElement, options?: PipOptions): Promise<PipHandle>;
|
|
478
|
+
/**
|
|
479
|
+
* 退出指定容器的画中画
|
|
480
|
+
* @param container 播放容器
|
|
481
|
+
*/
|
|
482
|
+
exitPictureInPicture(container: HTMLElement): Promise<void>;
|
|
483
|
+
/**
|
|
484
|
+
* 指定容器是否处于画中画模式
|
|
485
|
+
* @param container 播放容器
|
|
486
|
+
*/
|
|
487
|
+
isPictureInPicture(container: HTMLElement): boolean;
|
|
488
|
+
/**
|
|
489
|
+
* 将指定容器的视频弹出到独立窗口(可拖到第二个显示器)
|
|
490
|
+
* @param container 播放容器
|
|
491
|
+
* @param options 弹出窗口配置
|
|
492
|
+
*/
|
|
493
|
+
popOutToWindow(container: HTMLElement, options?: PopOutOptions): PopOutHandle;
|
|
494
|
+
/**
|
|
495
|
+
* 关闭指定容器的弹出窗口
|
|
496
|
+
* @param container 原始播放容器
|
|
497
|
+
*/
|
|
498
|
+
closePopOutWindow(container: HTMLElement): void;
|
|
499
|
+
/**
|
|
500
|
+
* 指定容器是否已弹出到独立窗口
|
|
501
|
+
* @param container 播放容器
|
|
502
|
+
*/
|
|
503
|
+
isPopOut(container: HTMLElement): boolean;
|
|
432
504
|
}
|
|
433
505
|
export declare class SRTC extends BaseSRTC {
|
|
434
506
|
buildInfo(): BuildInfo;
|
|
@@ -472,7 +544,7 @@ export declare class SRTC extends BaseSRTC {
|
|
|
472
544
|
/**
|
|
473
545
|
* 临时enable本地流轨道,如取消静音麦克风
|
|
474
546
|
*/
|
|
475
|
-
enableLocalTrack(track: LocalAudioTrack | LocalVideoTrack): void
|
|
547
|
+
enableLocalTrack(track: LocalAudioTrack | LocalVideoTrack): Promise<void>;
|
|
476
548
|
/**
|
|
477
549
|
* 临时disable本地流轨道,如临时静音麦克风
|
|
478
550
|
* 比unpublishLocalTrack取消发布轨道轻
|
|
@@ -1003,6 +1075,49 @@ export interface MixedAudioMediaStreamTrack extends MediaStreamTrack {
|
|
|
1003
1075
|
removeTrack(track: MediaStreamTrack): void;
|
|
1004
1076
|
trackCount: number;
|
|
1005
1077
|
}
|
|
1078
|
+
/** 画中画句柄,用于控制画中画状态 */
|
|
1079
|
+
export interface PipHandle {
|
|
1080
|
+
/** 画中画类型:document-pip 支持自定义UI,video-pip 为传统模式 */
|
|
1081
|
+
type: "document-pip" | "video-pip";
|
|
1082
|
+
/** Document PiP 模式下的 window 引用,可用于添加自定义控件 */
|
|
1083
|
+
pipWindow?: Window;
|
|
1084
|
+
/** 退出画中画 */
|
|
1085
|
+
exit(): Promise<void>;
|
|
1086
|
+
}
|
|
1087
|
+
/** 画中画配置选项 */
|
|
1088
|
+
export interface PipOptions {
|
|
1089
|
+
/** 画中画窗口宽度 */
|
|
1090
|
+
width?: number;
|
|
1091
|
+
/** 画中画窗口高度 */
|
|
1092
|
+
height?: number;
|
|
1093
|
+
/** 是否优先使用 Document PiP(支持自定义UI),默认true */
|
|
1094
|
+
preferDocumentPip?: boolean;
|
|
1095
|
+
/**
|
|
1096
|
+
* 是否隐藏原始播放视图,默认true
|
|
1097
|
+
* 仅在 Document PiP 生效,传统 video PiP 使用的就是原 video 元素,不能隐藏
|
|
1098
|
+
*/
|
|
1099
|
+
hideOriginView?: boolean;
|
|
1100
|
+
}
|
|
1101
|
+
/** 弹出窗口句柄,用于控制弹出窗口 */
|
|
1102
|
+
export interface PopOutHandle {
|
|
1103
|
+
/** 弹出窗口的 window 引用 */
|
|
1104
|
+
window: Window;
|
|
1105
|
+
/** 将视频回收到主页面指定容器 */
|
|
1106
|
+
moveBack(container: HTMLElement): void;
|
|
1107
|
+
/** 关闭弹出窗口 */
|
|
1108
|
+
close(): void;
|
|
1109
|
+
}
|
|
1110
|
+
/** 弹出窗口配置选项 */
|
|
1111
|
+
export interface PopOutOptions {
|
|
1112
|
+
/** 弹出窗口宽度,默认640 */
|
|
1113
|
+
width?: number;
|
|
1114
|
+
/** 弹出窗口高度,默认480 */
|
|
1115
|
+
height?: number;
|
|
1116
|
+
/** 弹出窗口标题 */
|
|
1117
|
+
title?: string;
|
|
1118
|
+
/** 是否隐藏原始播放视图,默认true */
|
|
1119
|
+
hideOriginView?: boolean;
|
|
1120
|
+
}
|
|
1006
1121
|
/**
|
|
1007
1122
|
* 属性更改项
|
|
1008
1123
|
*/
|
package/srtc.d.ts
CHANGED
|
@@ -242,6 +242,14 @@ export declare class ChannelEventType extends CommonChannelEventType {
|
|
|
242
242
|
static readonly DEVICE_REMOVE = "device_remove";
|
|
243
243
|
/** 轨道自动播放失败,对应data为BaseTrack */
|
|
244
244
|
static readonly TRACK_AUTOPLAY_FAIL = "track_autoplay_fail";
|
|
245
|
+
/** 轨道进入画中画模式,对应data为BaseTrack */
|
|
246
|
+
static readonly TRACK_PIP_ENTER = "track_pip_enter";
|
|
247
|
+
/** 轨道退出画中画模式,对应data为BaseTrack */
|
|
248
|
+
static readonly TRACK_PIP_EXIT = "track_pip_exit";
|
|
249
|
+
/** 轨道弹出独立窗口,对应data为BaseTrack */
|
|
250
|
+
static readonly TRACK_POPOUT_OPEN = "track_popout_open";
|
|
251
|
+
/** 轨道关闭独立窗口,对应data为BaseTrack */
|
|
252
|
+
static readonly TRACK_POPOUT_CLOSE = "track_popout_close";
|
|
245
253
|
}
|
|
246
254
|
/** 频道外事件通知 */
|
|
247
255
|
export declare class ImEvent {
|
|
@@ -378,6 +386,38 @@ export declare class LocalVideoTrack extends BaseWebrtcTrack {
|
|
|
378
386
|
* 移除所有播放窗口
|
|
379
387
|
*/
|
|
380
388
|
removeAllPlayViews(): void;
|
|
389
|
+
/**
|
|
390
|
+
* 将指定容器的视频进入画中画模式
|
|
391
|
+
* @param container 播放容器
|
|
392
|
+
* @param options 画中画配置
|
|
393
|
+
*/
|
|
394
|
+
enterPictureInPicture(container: HTMLElement, options?: PipOptions): Promise<PipHandle>;
|
|
395
|
+
/**
|
|
396
|
+
* 退出指定容器的画中画
|
|
397
|
+
* @param container 播放容器
|
|
398
|
+
*/
|
|
399
|
+
exitPictureInPicture(container: HTMLElement): Promise<void>;
|
|
400
|
+
/**
|
|
401
|
+
* 指定容器是否处于画中画模式
|
|
402
|
+
* @param container 播放容器
|
|
403
|
+
*/
|
|
404
|
+
isPictureInPicture(container: HTMLElement): boolean;
|
|
405
|
+
/**
|
|
406
|
+
* 将指定容器的视频弹出到独立窗口(可拖到第二个显示器)
|
|
407
|
+
* @param container 播放容器
|
|
408
|
+
* @param options 弹出窗口配置
|
|
409
|
+
*/
|
|
410
|
+
popOutToWindow(container: HTMLElement, options?: PopOutOptions): PopOutHandle;
|
|
411
|
+
/**
|
|
412
|
+
* 关闭指定容器的弹出窗口
|
|
413
|
+
* @param container 原始播放容器
|
|
414
|
+
*/
|
|
415
|
+
closePopOutWindow(container: HTMLElement): void;
|
|
416
|
+
/**
|
|
417
|
+
* 指定容器是否已弹出到独立窗口
|
|
418
|
+
* @param container 播放容器
|
|
419
|
+
*/
|
|
420
|
+
isPopOut(container: HTMLElement): boolean;
|
|
381
421
|
}
|
|
382
422
|
/**
|
|
383
423
|
* 远端混音流
|
|
@@ -429,6 +469,38 @@ export declare class RemoteVideoTrack extends BaseWebrtcTrack {
|
|
|
429
469
|
* 移除所有播放窗口
|
|
430
470
|
*/
|
|
431
471
|
removeAllPlayViews(): void;
|
|
472
|
+
/**
|
|
473
|
+
* 将指定容器的视频进入画中画模式
|
|
474
|
+
* @param container 播放容器
|
|
475
|
+
* @param options 画中画配置
|
|
476
|
+
*/
|
|
477
|
+
enterPictureInPicture(container: HTMLElement, options?: PipOptions): Promise<PipHandle>;
|
|
478
|
+
/**
|
|
479
|
+
* 退出指定容器的画中画
|
|
480
|
+
* @param container 播放容器
|
|
481
|
+
*/
|
|
482
|
+
exitPictureInPicture(container: HTMLElement): Promise<void>;
|
|
483
|
+
/**
|
|
484
|
+
* 指定容器是否处于画中画模式
|
|
485
|
+
* @param container 播放容器
|
|
486
|
+
*/
|
|
487
|
+
isPictureInPicture(container: HTMLElement): boolean;
|
|
488
|
+
/**
|
|
489
|
+
* 将指定容器的视频弹出到独立窗口(可拖到第二个显示器)
|
|
490
|
+
* @param container 播放容器
|
|
491
|
+
* @param options 弹出窗口配置
|
|
492
|
+
*/
|
|
493
|
+
popOutToWindow(container: HTMLElement, options?: PopOutOptions): PopOutHandle;
|
|
494
|
+
/**
|
|
495
|
+
* 关闭指定容器的弹出窗口
|
|
496
|
+
* @param container 原始播放容器
|
|
497
|
+
*/
|
|
498
|
+
closePopOutWindow(container: HTMLElement): void;
|
|
499
|
+
/**
|
|
500
|
+
* 指定容器是否已弹出到独立窗口
|
|
501
|
+
* @param container 播放容器
|
|
502
|
+
*/
|
|
503
|
+
isPopOut(container: HTMLElement): boolean;
|
|
432
504
|
}
|
|
433
505
|
export declare class SRTC extends BaseSRTC {
|
|
434
506
|
buildInfo(): BuildInfo;
|
|
@@ -472,7 +544,7 @@ export declare class SRTC extends BaseSRTC {
|
|
|
472
544
|
/**
|
|
473
545
|
* 临时enable本地流轨道,如取消静音麦克风
|
|
474
546
|
*/
|
|
475
|
-
enableLocalTrack(track: LocalAudioTrack | LocalVideoTrack): void
|
|
547
|
+
enableLocalTrack(track: LocalAudioTrack | LocalVideoTrack): Promise<void>;
|
|
476
548
|
/**
|
|
477
549
|
* 临时disable本地流轨道,如临时静音麦克风
|
|
478
550
|
* 比unpublishLocalTrack取消发布轨道轻
|
|
@@ -1003,6 +1075,49 @@ export interface MixedAudioMediaStreamTrack extends MediaStreamTrack {
|
|
|
1003
1075
|
removeTrack(track: MediaStreamTrack): void;
|
|
1004
1076
|
trackCount: number;
|
|
1005
1077
|
}
|
|
1078
|
+
/** 画中画句柄,用于控制画中画状态 */
|
|
1079
|
+
export interface PipHandle {
|
|
1080
|
+
/** 画中画类型:document-pip 支持自定义UI,video-pip 为传统模式 */
|
|
1081
|
+
type: "document-pip" | "video-pip";
|
|
1082
|
+
/** Document PiP 模式下的 window 引用,可用于添加自定义控件 */
|
|
1083
|
+
pipWindow?: Window;
|
|
1084
|
+
/** 退出画中画 */
|
|
1085
|
+
exit(): Promise<void>;
|
|
1086
|
+
}
|
|
1087
|
+
/** 画中画配置选项 */
|
|
1088
|
+
export interface PipOptions {
|
|
1089
|
+
/** 画中画窗口宽度 */
|
|
1090
|
+
width?: number;
|
|
1091
|
+
/** 画中画窗口高度 */
|
|
1092
|
+
height?: number;
|
|
1093
|
+
/** 是否优先使用 Document PiP(支持自定义UI),默认true */
|
|
1094
|
+
preferDocumentPip?: boolean;
|
|
1095
|
+
/**
|
|
1096
|
+
* 是否隐藏原始播放视图,默认true
|
|
1097
|
+
* 仅在 Document PiP 生效,传统 video PiP 使用的就是原 video 元素,不能隐藏
|
|
1098
|
+
*/
|
|
1099
|
+
hideOriginView?: boolean;
|
|
1100
|
+
}
|
|
1101
|
+
/** 弹出窗口句柄,用于控制弹出窗口 */
|
|
1102
|
+
export interface PopOutHandle {
|
|
1103
|
+
/** 弹出窗口的 window 引用 */
|
|
1104
|
+
window: Window;
|
|
1105
|
+
/** 将视频回收到主页面指定容器 */
|
|
1106
|
+
moveBack(container: HTMLElement): void;
|
|
1107
|
+
/** 关闭弹出窗口 */
|
|
1108
|
+
close(): void;
|
|
1109
|
+
}
|
|
1110
|
+
/** 弹出窗口配置选项 */
|
|
1111
|
+
export interface PopOutOptions {
|
|
1112
|
+
/** 弹出窗口宽度,默认640 */
|
|
1113
|
+
width?: number;
|
|
1114
|
+
/** 弹出窗口高度,默认480 */
|
|
1115
|
+
height?: number;
|
|
1116
|
+
/** 弹出窗口标题 */
|
|
1117
|
+
title?: string;
|
|
1118
|
+
/** 是否隐藏原始播放视图,默认true */
|
|
1119
|
+
hideOriginView?: boolean;
|
|
1120
|
+
}
|
|
1006
1121
|
/**
|
|
1007
1122
|
* 属性更改项
|
|
1008
1123
|
*/
|