trtc-electron-sdk 13.3.801-alpha.2 → 13.3.801
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/liteav/extensions/MediaMixingManager/MediaMixingManager.d.ts +9 -0
- package/liteav/extensions/MediaMixingManager/MediaMixingManager.js +85 -0
- package/liteav/extensions/MediaMixingManager/types.d.ts +8 -1
- package/liteav/extensions/MediaMixingManager/types.js +7 -0
- package/liteav/trtc.d.ts +0 -1
- package/liteav/trtc.js +0 -1
- package/liteav/trtc_define.d.ts +0 -82
- package/liteav/trtc_define.js +1 -74
- package/liteav/types.d.ts +2 -1
- package/liteav/vod_player.d.ts +92 -7
- package/liteav/vod_player.js +105 -22
- package/package.json +1 -1
|
@@ -128,6 +128,7 @@ export declare class TRTCMediaMixingManager implements ITRTCMediaMixingManager {
|
|
|
128
128
|
private autoControlServer;
|
|
129
129
|
private serverStatus;
|
|
130
130
|
private serverMode;
|
|
131
|
+
private addMediaSourceTimers;
|
|
131
132
|
private webRenderer;
|
|
132
133
|
private pixelFormat;
|
|
133
134
|
private pixelLength;
|
|
@@ -240,6 +241,14 @@ export declare class TRTCMediaMixingManager implements ITRTCMediaMixingManager {
|
|
|
240
241
|
* @returns {Promise<void>}
|
|
241
242
|
*/
|
|
242
243
|
addMediaSource(mediaSource: TRTCMediaSource): Promise<void>;
|
|
244
|
+
/**
|
|
245
|
+
* Returns the per-sourceType timeout (ms) used by addMediaSource. The
|
|
246
|
+
* defaults are intentionally larger than the cpp-layer timeout in
|
|
247
|
+
* SourceManagerProxy so that, in the normal case, the cpp side resolves the
|
|
248
|
+
* promise first. This JS timer is the last-resort safety net in case the
|
|
249
|
+
* cpp side itself fails to emit any callback (older builds, ipc lost, etc.).
|
|
250
|
+
*/
|
|
251
|
+
private getAddMediaSourceTimeoutMs;
|
|
243
252
|
/**
|
|
244
253
|
* 删除本地混流媒体源
|
|
245
254
|
* @param mediaSource {TRTCMediaSource} - 媒体源信息
|
|
@@ -304,6 +304,12 @@ class TRTCMediaMixingManager {
|
|
|
304
304
|
this.streamLayoutManager = null;
|
|
305
305
|
this.serverStatus = TRTCMediaMixingServerStatus.Idle;
|
|
306
306
|
this.serverMode = TRTCMediaMixingServerMode.Independent;
|
|
307
|
+
// Per-source timeout handles for addMediaSource. Keyed by the same promise
|
|
308
|
+
// key used in promiseStore. Used to guard against the case where the native
|
|
309
|
+
// cpp layer never emits SM_OnSourceInserted (e.g. internal OnlineVideoSource
|
|
310
|
+
// state machine stuck after a previous failure), which would otherwise leave
|
|
311
|
+
// the returned Promise pending forever and the UI stuck on "loading".
|
|
312
|
+
this.addMediaSourceTimers = new Map();
|
|
307
313
|
this.webRenderer = null;
|
|
308
314
|
this.pixelFormat = trtc_define_1.TRTCVideoPixelFormat.TRTCVideoPixelFormat_BGRA32;
|
|
309
315
|
this.pixelLength = 4;
|
|
@@ -386,6 +392,10 @@ class TRTCMediaMixingManager {
|
|
|
386
392
|
this.nodeMediaMixingPlugin = null;
|
|
387
393
|
this.eventEmitter = null;
|
|
388
394
|
this.promiseStore.destroy();
|
|
395
|
+
// Cancel any pending addMediaSource timeout timers to avoid late-firing
|
|
396
|
+
// callbacks touching a destroyed instance.
|
|
397
|
+
this.addMediaSourceTimers.forEach(timer => clearTimeout(timer));
|
|
398
|
+
this.addMediaSourceTimers.clear();
|
|
389
399
|
this.paramsStore = null;
|
|
390
400
|
this.trtcParamsStore = null;
|
|
391
401
|
});
|
|
@@ -536,6 +546,58 @@ class TRTCMediaMixingManager {
|
|
|
536
546
|
var _a;
|
|
537
547
|
const key = `${promiseKeys.addMediaSource}-${newMediaSource.sourceType}-${newMediaSource.sourceId}`;
|
|
538
548
|
this.promiseStore.addPromise(key, resolve, reject);
|
|
549
|
+
// Arm a timeout safety net. The underlying cpp layer should normally
|
|
550
|
+
// call back via SM_OnSourceInserted, but for OnlineVideo / VideoFile we
|
|
551
|
+
// have observed the native MediaPlayer state machine getting stuck on
|
|
552
|
+
// the 2nd attempt after a previous network failure, with no callback
|
|
553
|
+
// ever emitted. Without this timer the returned Promise stays pending
|
|
554
|
+
// forever, freezing upstream UI (e.g. the "child view" loading state).
|
|
555
|
+
const timeoutMs = this.getAddMediaSourceTimeoutMs(newMediaSource.sourceType);
|
|
556
|
+
const timer = setTimeout(() => {
|
|
557
|
+
try {
|
|
558
|
+
// Defensive guard: destroy() may have been invoked while this
|
|
559
|
+
// macrotask was already scheduled but before the clearTimeout()
|
|
560
|
+
// loop in destroy() ran. In that case promiseStore / sourceList
|
|
561
|
+
// are no longer in a consistent state, and any further side-
|
|
562
|
+
// effect (e.g. ms.control = {}) could throw on undefined.
|
|
563
|
+
if (!this.nodeMediaMixingPlugin || !this.promiseStore) {
|
|
564
|
+
return;
|
|
565
|
+
}
|
|
566
|
+
// If the promise was already settled by the real callback, this is
|
|
567
|
+
// a no-op because PromiseStore.rejectPromise returns false on
|
|
568
|
+
// missing key.
|
|
569
|
+
const rejected = this.promiseStore.rejectPromise(key, {
|
|
570
|
+
code: types_1.TRTCMediaMixingErrorCode.InsertTimeout,
|
|
571
|
+
message: 'addMediaSource timeout',
|
|
572
|
+
});
|
|
573
|
+
if (rejected) {
|
|
574
|
+
logger_1.default.warn(`${this.logPrefix}addMediaSource timeout for sourceType:${newMediaSource.sourceType} sourceId:${newMediaSource.sourceId} timeoutMs:${timeoutMs}`);
|
|
575
|
+
// Mark the source as failed so subsequent removeMediaSource can
|
|
576
|
+
// take the fast (sync) path without waiting for cpp callbacks
|
|
577
|
+
// again.
|
|
578
|
+
const idx = this.findMediaSourceIndex({
|
|
579
|
+
sourceId: newMediaSource.sourceId,
|
|
580
|
+
sourceType: newMediaSource.sourceType,
|
|
581
|
+
});
|
|
582
|
+
if (idx !== -1) {
|
|
583
|
+
const ms = this.sourceList[idx];
|
|
584
|
+
if (ms) {
|
|
585
|
+
if (!ms.control) {
|
|
586
|
+
ms.control = {};
|
|
587
|
+
}
|
|
588
|
+
ms.control.isAddFailed = true;
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
finally {
|
|
594
|
+
// Always clear our own timer slot, even if the rejection path
|
|
595
|
+
// throws upstream. Without this, the Map would keep stale handles
|
|
596
|
+
// alive until destroy().
|
|
597
|
+
this.addMediaSourceTimers.delete(key);
|
|
598
|
+
}
|
|
599
|
+
}, timeoutMs);
|
|
600
|
+
this.addMediaSourceTimers.set(key, timer);
|
|
539
601
|
this.nodeMediaMixingPlugin.addMediaSource(newMediaSource);
|
|
540
602
|
(_a = this.mediaMixingDesigner) === null || _a === void 0 ? void 0 : _a.addMedia({
|
|
541
603
|
id: `${newMediaSource.sourceType}__${newMediaSource.sourceId}`,
|
|
@@ -548,6 +610,23 @@ class TRTCMediaMixingManager {
|
|
|
548
610
|
});
|
|
549
611
|
});
|
|
550
612
|
}
|
|
613
|
+
/**
|
|
614
|
+
* Returns the per-sourceType timeout (ms) used by addMediaSource. The
|
|
615
|
+
* defaults are intentionally larger than the cpp-layer timeout in
|
|
616
|
+
* SourceManagerProxy so that, in the normal case, the cpp side resolves the
|
|
617
|
+
* promise first. This JS timer is the last-resort safety net in case the
|
|
618
|
+
* cpp side itself fails to emit any callback (older builds, ipc lost, etc.).
|
|
619
|
+
*/
|
|
620
|
+
getAddMediaSourceTimeoutMs(sourceType) {
|
|
621
|
+
switch (sourceType) {
|
|
622
|
+
case types_1.TRTCMediaSourceType.kOnlineVideo:
|
|
623
|
+
return 11000;
|
|
624
|
+
case types_1.TRTCMediaSourceType.kVideoFile:
|
|
625
|
+
return 6000;
|
|
626
|
+
default:
|
|
627
|
+
return 5000;
|
|
628
|
+
}
|
|
629
|
+
}
|
|
551
630
|
/**
|
|
552
631
|
* 删除本地混流媒体源
|
|
553
632
|
* @param mediaSource {TRTCMediaSource} - 媒体源信息
|
|
@@ -1207,6 +1286,12 @@ class TRTCMediaMixingManager {
|
|
|
1207
1286
|
onMediaSourceAdded(data) {
|
|
1208
1287
|
var _a;
|
|
1209
1288
|
const promiseKey = `${promiseKeys.addMediaSource}-${data.sourceType}-${data.sourceId}`;
|
|
1289
|
+
// Real callback arrived: cancel the JS-side timeout safety net.
|
|
1290
|
+
const timer = this.addMediaSourceTimers.get(promiseKey);
|
|
1291
|
+
if (timer) {
|
|
1292
|
+
clearTimeout(timer);
|
|
1293
|
+
this.addMediaSourceTimers.delete(promiseKey);
|
|
1294
|
+
}
|
|
1210
1295
|
let flag = false;
|
|
1211
1296
|
if (data.errCode === 0) {
|
|
1212
1297
|
flag = this.promiseStore.resolvePromise(promiseKey, undefined);
|
|
@@ -13,7 +13,14 @@ export declare enum TRTCMediaMixingErrorCode {
|
|
|
13
13
|
OnlineVideoConnectFailed = -10,
|
|
14
14
|
OnlineVideoConnectionLost = -11,
|
|
15
15
|
NoAvailableHevcDecoder = -12,
|
|
16
|
-
VideoFileNotExist = -13
|
|
16
|
+
VideoFileNotExist = -13,
|
|
17
|
+
/**
|
|
18
|
+
* SDK 兜底超时(addMediaSource 在 cpp / js 双层超时内未收到底层 onXxxStarted 回调)。
|
|
19
|
+
*
|
|
20
|
+
* 取一个远离 SDK 自然错误码区间(-1..-13)的值,便于上层稳定区分。
|
|
21
|
+
* 必须与 C++ 端 `kInsertTimeoutErrCode`(SourceManagerProxy)保持一致。
|
|
22
|
+
*/
|
|
23
|
+
InsertTimeout = -9001
|
|
17
24
|
}
|
|
18
25
|
export declare enum TRTCMediaSourceType {
|
|
19
26
|
kCamera = 0,
|
|
@@ -17,6 +17,13 @@ var TRTCMediaMixingErrorCode;
|
|
|
17
17
|
TRTCMediaMixingErrorCode[TRTCMediaMixingErrorCode["OnlineVideoConnectionLost"] = -11] = "OnlineVideoConnectionLost";
|
|
18
18
|
TRTCMediaMixingErrorCode[TRTCMediaMixingErrorCode["NoAvailableHevcDecoder"] = -12] = "NoAvailableHevcDecoder";
|
|
19
19
|
TRTCMediaMixingErrorCode[TRTCMediaMixingErrorCode["VideoFileNotExist"] = -13] = "VideoFileNotExist";
|
|
20
|
+
/**
|
|
21
|
+
* SDK 兜底超时(addMediaSource 在 cpp / js 双层超时内未收到底层 onXxxStarted 回调)。
|
|
22
|
+
*
|
|
23
|
+
* 取一个远离 SDK 自然错误码区间(-1..-13)的值,便于上层稳定区分。
|
|
24
|
+
* 必须与 C++ 端 `kInsertTimeoutErrCode`(SourceManagerProxy)保持一致。
|
|
25
|
+
*/
|
|
26
|
+
TRTCMediaMixingErrorCode[TRTCMediaMixingErrorCode["InsertTimeout"] = -9001] = "InsertTimeout";
|
|
20
27
|
})(TRTCMediaMixingErrorCode = exports.TRTCMediaMixingErrorCode || (exports.TRTCMediaMixingErrorCode = {}));
|
|
21
28
|
var TRTCMediaSourceType;
|
|
22
29
|
(function (TRTCMediaSourceType) {
|
package/liteav/trtc.d.ts
CHANGED
|
@@ -1167,7 +1167,6 @@ declare class TRTCCloud extends EventEmitter implements ITRTCCloud {
|
|
|
1167
1167
|
* 该接口跟 startPublishing() 类似,但 startPublishCDNStream() 支持向非腾讯云的直播 CDN 转推。
|
|
1168
1168
|
*
|
|
1169
1169
|
* 注意:
|
|
1170
|
-
* - 使用 startPublishing() 绑定腾讯云直播 CDN 不收取额外的费用。
|
|
1171
1170
|
* - 使用 startPublishCDNStream() 绑定非腾讯云直播 CDN 需要收取转推费用,且需要通过工单联系我们开通。
|
|
1172
1171
|
*
|
|
1173
1172
|
* @param {TRTCPublishCDNParam} param - 转推参数
|
package/liteav/trtc.js
CHANGED
|
@@ -2097,7 +2097,6 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
2097
2097
|
* 该接口跟 startPublishing() 类似,但 startPublishCDNStream() 支持向非腾讯云的直播 CDN 转推。
|
|
2098
2098
|
*
|
|
2099
2099
|
* 注意:
|
|
2100
|
-
* - 使用 startPublishing() 绑定腾讯云直播 CDN 不收取额外的费用。
|
|
2101
2100
|
* - 使用 startPublishCDNStream() 绑定非腾讯云直播 CDN 需要收取转推费用,且需要通过工单联系我们开通。
|
|
2102
2101
|
*
|
|
2103
2102
|
* @param {TRTCPublishCDNParam} param - 转推参数
|
package/liteav/trtc_define.d.ts
CHANGED
|
@@ -1125,85 +1125,3 @@ export interface TRTCInitConfig {
|
|
|
1125
1125
|
};
|
|
1126
1126
|
isIPCMode?: boolean;
|
|
1127
1127
|
}
|
|
1128
|
-
/**
|
|
1129
|
-
* @namespace TRTCVodPlayerEvent
|
|
1130
|
-
* @description 点播播放器(VOD Player)事件
|
|
1131
|
-
*/
|
|
1132
|
-
export declare enum TRTCVodPlayerEvent {
|
|
1133
|
-
/**
|
|
1134
|
-
* @description 多媒体文件开始播放事件
|
|
1135
|
-
*
|
|
1136
|
-
* @event TRTCVodPlayerEvent#onVodPlayerStarted
|
|
1137
|
-
* @param {Number} msLength 多媒体文件总长度,单位毫秒
|
|
1138
|
-
*/
|
|
1139
|
-
onVodPlayerStarted = "onVodPlayerStarted",
|
|
1140
|
-
/**
|
|
1141
|
-
* @description 播放器就绪事件
|
|
1142
|
-
*
|
|
1143
|
-
* 调用 `preload()` 完成后触发,或 `switchSource()` 切换成功后触发。
|
|
1144
|
-
*
|
|
1145
|
-
* @event TRTCVodPlayerEvent#onVodPlayerLoaded
|
|
1146
|
-
* @param {Number} durationMs 视频总时长,单位毫秒
|
|
1147
|
-
* @param {Number} width 视频宽度(像素),纯音频文件时为 0
|
|
1148
|
-
* @param {Number} height 视频高度(像素),纯音频文件时为 0
|
|
1149
|
-
*/
|
|
1150
|
-
onVodPlayerLoaded = "onVodPlayerLoaded",
|
|
1151
|
-
/**
|
|
1152
|
-
* @description 多媒体文件播放进度改变事件
|
|
1153
|
-
*
|
|
1154
|
-
* @event TRTCVodPlayerEvent#onVodPlayerProgress
|
|
1155
|
-
* @param {Number} msPos 多媒体文件当前播放进度,单位毫秒
|
|
1156
|
-
*/
|
|
1157
|
-
onVodPlayerProgress = "onVodPlayerProgress",
|
|
1158
|
-
/**
|
|
1159
|
-
* @description 多媒体文件播放暂停事件
|
|
1160
|
-
*
|
|
1161
|
-
* @event TRTCVodPlayerEvent#onVodPlayerPaused
|
|
1162
|
-
*/
|
|
1163
|
-
onVodPlayerPaused = "onVodPlayerPaused",
|
|
1164
|
-
/**
|
|
1165
|
-
* @description 多媒体文件播放恢复事件
|
|
1166
|
-
*
|
|
1167
|
-
* @event TRTCVodPlayerEvent#onVodPlayerResumed
|
|
1168
|
-
*/
|
|
1169
|
-
onVodPlayerResumed = "onVodPlayerResumed",
|
|
1170
|
-
/**
|
|
1171
|
-
* @description 多媒体文件播放停止事件
|
|
1172
|
-
*
|
|
1173
|
-
* @event TRTCVodPlayerEvent#onVodPlayerStopped
|
|
1174
|
-
* @param {Number} reason 停止原因
|
|
1175
|
-
* - 0:用户主动停止;
|
|
1176
|
-
* - 1:文件播放完;
|
|
1177
|
-
* - 2:视频断流。
|
|
1178
|
-
*/
|
|
1179
|
-
onVodPlayerStopped = "onVodPlayerStopped",
|
|
1180
|
-
/**
|
|
1181
|
-
* @description 多媒体文件播放出错事件
|
|
1182
|
-
*
|
|
1183
|
-
* @event TRTCVodPlayerEvent#onVodPlayerError
|
|
1184
|
-
* @param {Number} error 错误码
|
|
1185
|
-
* - -6001:未知错误;
|
|
1186
|
-
* - -6002:通用错误;
|
|
1187
|
-
* - -6003:解封装失败;
|
|
1188
|
-
* - -6005:解封装超时;
|
|
1189
|
-
* - -6006:视频解码错误;
|
|
1190
|
-
* - -6007:音频解码错误;
|
|
1191
|
-
* - -6009:视频渲染错误。
|
|
1192
|
-
*/
|
|
1193
|
-
onVodPlayerError = "onVodPlayerError"
|
|
1194
|
-
}
|
|
1195
|
-
/**
|
|
1196
|
-
* 点播播放器事件监听器类型定义
|
|
1197
|
-
*
|
|
1198
|
-
* key 为 {@link TRTCVodPlayerEvent},value 为该事件回调接收的参数元组。
|
|
1199
|
-
* 用于在 TS 层实现事件名到回调参数的精确类型映射,避免 any 滥用。
|
|
1200
|
-
*/
|
|
1201
|
-
export interface TRTCVodPlayerEventMap {
|
|
1202
|
-
[TRTCVodPlayerEvent.onVodPlayerStarted]: [msLength: number];
|
|
1203
|
-
[TRTCVodPlayerEvent.onVodPlayerLoaded]: [durationMs: number, width: number, height: number];
|
|
1204
|
-
[TRTCVodPlayerEvent.onVodPlayerProgress]: [msPos: number];
|
|
1205
|
-
[TRTCVodPlayerEvent.onVodPlayerPaused]: [];
|
|
1206
|
-
[TRTCVodPlayerEvent.onVodPlayerResumed]: [];
|
|
1207
|
-
[TRTCVodPlayerEvent.onVodPlayerStopped]: [reason: number];
|
|
1208
|
-
[TRTCVodPlayerEvent.onVodPlayerError]: [error: number];
|
|
1209
|
-
}
|
package/liteav/trtc_define.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.TRTCTranscodingConfig = exports.TRTCPluginType = exports.TRTCVoiceChangerType = exports.TRTCVoiceReverbType = exports.TRTCPublishMode = exports.TRTCAudioRecordingContent = exports.TRTCMixInputType = exports.TRTCTranscodingConfigMode = exports.TRTCMixUser = exports.Rect = exports.TRTCSpeedTestResult = exports.TRTCSpeedTestParams = exports.TRTCVolumeInfo = exports.TRTCQualityInfo = exports.TRTCNetworkQosParam = exports.TRTCRenderParams = exports.TRTCVideoEncParam = exports.TRTCParams = exports.TRTCWaterMarkSrcType = exports.TRTCVideoEncodeComplexity = exports.TRTCVideoColorSpace = exports.TRTCVideoColorRange = exports.TRTCCameraCaptureMode = exports.TRTCDeviceType = exports.TRTCDeviceState = exports.TRTCLogLevel = exports.TRTCAudioFrame = exports.TRTCVideoFrame = exports.TRTCDeviceInfo = exports.TRTCScreenCaptureProperty = exports.TRTCScreenCaptureSourceInfo = exports.TRTCImageBuffer = exports.TRTCAudioQuality = exports.TRTCScreenCaptureSourceType = exports.TRTCAudioFrameFormat = exports.TRTCVideoQosPreference = exports.TRTCQosControlMode = exports.TRTCRoleType = exports.TRTCAppScene = exports.TRTCRecordType = exports.TRTCVideoMirrorType = exports.TRTCVideoBufferType = exports.TRTCVideoPixelFormat = exports.TRTCBeautyStyle = exports.TRTCVideoRotation = exports.TRTCVideoFillMode = exports.TRTCQuality = exports.TRTCVideoStreamType = exports.TRTCVideoResolutionMode = exports.TRTCVideoResolution = void 0;
|
|
10
|
-
exports.
|
|
10
|
+
exports.VideoBufferInfo = exports.TRTCSwitchRoomParam = exports.AudioMusicParam = exports.TRTCStatistics = exports.TRTCRemoteStatistics = exports.TRTCLocalStatistics = exports.TRTCAudioEffectParam = exports.TRTCAudioRecordingParams = exports.TRTCPublishCDNParam = void 0;
|
|
11
11
|
const util_1 = require("./Renderer/util");
|
|
12
12
|
/////////////////////////////////////////////////////////////////////////////////
|
|
13
13
|
//
|
|
@@ -2032,76 +2032,3 @@ class VideoBufferInfo {
|
|
|
2032
2032
|
}
|
|
2033
2033
|
}
|
|
2034
2034
|
exports.VideoBufferInfo = VideoBufferInfo;
|
|
2035
|
-
/////////////////////////////////////////////////////////////////////////////////
|
|
2036
|
-
//
|
|
2037
|
-
// TRTCVodPlayer 相关类型定义
|
|
2038
|
-
//
|
|
2039
|
-
/////////////////////////////////////////////////////////////////////////////////
|
|
2040
|
-
/**
|
|
2041
|
-
* @namespace TRTCVodPlayerEvent
|
|
2042
|
-
* @description 点播播放器(VOD Player)事件
|
|
2043
|
-
*/
|
|
2044
|
-
var TRTCVodPlayerEvent;
|
|
2045
|
-
(function (TRTCVodPlayerEvent) {
|
|
2046
|
-
/**
|
|
2047
|
-
* @description 多媒体文件开始播放事件
|
|
2048
|
-
*
|
|
2049
|
-
* @event TRTCVodPlayerEvent#onVodPlayerStarted
|
|
2050
|
-
* @param {Number} msLength 多媒体文件总长度,单位毫秒
|
|
2051
|
-
*/
|
|
2052
|
-
TRTCVodPlayerEvent["onVodPlayerStarted"] = "onVodPlayerStarted";
|
|
2053
|
-
/**
|
|
2054
|
-
* @description 播放器就绪事件
|
|
2055
|
-
*
|
|
2056
|
-
* 调用 `preload()` 完成后触发,或 `switchSource()` 切换成功后触发。
|
|
2057
|
-
*
|
|
2058
|
-
* @event TRTCVodPlayerEvent#onVodPlayerLoaded
|
|
2059
|
-
* @param {Number} durationMs 视频总时长,单位毫秒
|
|
2060
|
-
* @param {Number} width 视频宽度(像素),纯音频文件时为 0
|
|
2061
|
-
* @param {Number} height 视频高度(像素),纯音频文件时为 0
|
|
2062
|
-
*/
|
|
2063
|
-
TRTCVodPlayerEvent["onVodPlayerLoaded"] = "onVodPlayerLoaded";
|
|
2064
|
-
/**
|
|
2065
|
-
* @description 多媒体文件播放进度改变事件
|
|
2066
|
-
*
|
|
2067
|
-
* @event TRTCVodPlayerEvent#onVodPlayerProgress
|
|
2068
|
-
* @param {Number} msPos 多媒体文件当前播放进度,单位毫秒
|
|
2069
|
-
*/
|
|
2070
|
-
TRTCVodPlayerEvent["onVodPlayerProgress"] = "onVodPlayerProgress";
|
|
2071
|
-
/**
|
|
2072
|
-
* @description 多媒体文件播放暂停事件
|
|
2073
|
-
*
|
|
2074
|
-
* @event TRTCVodPlayerEvent#onVodPlayerPaused
|
|
2075
|
-
*/
|
|
2076
|
-
TRTCVodPlayerEvent["onVodPlayerPaused"] = "onVodPlayerPaused";
|
|
2077
|
-
/**
|
|
2078
|
-
* @description 多媒体文件播放恢复事件
|
|
2079
|
-
*
|
|
2080
|
-
* @event TRTCVodPlayerEvent#onVodPlayerResumed
|
|
2081
|
-
*/
|
|
2082
|
-
TRTCVodPlayerEvent["onVodPlayerResumed"] = "onVodPlayerResumed";
|
|
2083
|
-
/**
|
|
2084
|
-
* @description 多媒体文件播放停止事件
|
|
2085
|
-
*
|
|
2086
|
-
* @event TRTCVodPlayerEvent#onVodPlayerStopped
|
|
2087
|
-
* @param {Number} reason 停止原因
|
|
2088
|
-
* - 0:用户主动停止;
|
|
2089
|
-
* - 1:文件播放完;
|
|
2090
|
-
* - 2:视频断流。
|
|
2091
|
-
*/
|
|
2092
|
-
TRTCVodPlayerEvent["onVodPlayerStopped"] = "onVodPlayerStopped";
|
|
2093
|
-
/**
|
|
2094
|
-
* @description 多媒体文件播放出错事件
|
|
2095
|
-
*
|
|
2096
|
-
* @event TRTCVodPlayerEvent#onVodPlayerError
|
|
2097
|
-
* @param {Number} error 错误码
|
|
2098
|
-
* - -6001:未知错误;
|
|
2099
|
-
* - -6002:通用错误;
|
|
2100
|
-
* - -6003:解封装失败;
|
|
2101
|
-
* - -6005:解封装超时;
|
|
2102
|
-
* - -6006:视频解码错误;
|
|
2103
|
-
* - -6007:音频解码错误;
|
|
2104
|
-
* - -6009:视频渲染错误。
|
|
2105
|
-
*/
|
|
2106
|
-
TRTCVodPlayerEvent["onVodPlayerError"] = "onVodPlayerError";
|
|
2107
|
-
})(TRTCVodPlayerEvent = exports.TRTCVodPlayerEvent || (exports.TRTCVodPlayerEvent = {}));
|
package/liteav/types.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import TRTCMediaMixingManager, { TRTCMediaMixingService } from './extensions/MediaMixingManager';
|
|
2
|
-
import { AudioMusicParam, Rect, TRTCAppScene, TRTCAudioQuality, TRTCBeautyStyle, TRTCDeviceType, TRTCLogLevel, TRTCAudioFrame, TRTCVideoFillMode, TRTCVideoRotation, TRTCVideoStreamType, TRTCWaterMarkSrcType, TRTCPluginType, TRTCPluginInfo, TRTCVideoProcessPluginOptions, TRTCMediaEncryptDecryptPluginOptions, TRTCAudioRecordingParams, TRTCScreenCaptureSourceInfo, TRTCScreenCaptureProperty, TRTCSpeedTestParams, TRTCRecordType, TRTCDeviceInfo, TRTCCameraCaptureParams, TRTCImageBuffer, TRTCInitConfig, TRTCAudioParallelParams, TRTCVoiceReverbType, TRTCVoiceChangerType, TRTCMusicPlayObserver, TRTCAudioFrameCallback, TRTCAudioProcessPluginOptions, TRTCPublishTarget, TRTCStreamEncoderParam, TRTCStreamMixingConfig, TRTCRenderParams, TRTCRoleType, TRTCSwitchRoomParam, TRTCVideoFrame, TRTCVideoPixelFormat, TRTCVideoBufferType
|
|
2
|
+
import { AudioMusicParam, Rect, TRTCAppScene, TRTCAudioQuality, TRTCBeautyStyle, TRTCDeviceType, TRTCLogLevel, TRTCAudioFrame, TRTCVideoFillMode, TRTCVideoRotation, TRTCVideoStreamType, TRTCWaterMarkSrcType, TRTCPluginType, TRTCPluginInfo, TRTCVideoProcessPluginOptions, TRTCMediaEncryptDecryptPluginOptions, TRTCAudioRecordingParams, TRTCScreenCaptureSourceInfo, TRTCScreenCaptureProperty, TRTCSpeedTestParams, TRTCRecordType, TRTCDeviceInfo, TRTCCameraCaptureParams, TRTCImageBuffer, TRTCInitConfig, TRTCAudioParallelParams, TRTCVoiceReverbType, TRTCVoiceChangerType, TRTCMusicPlayObserver, TRTCAudioFrameCallback, TRTCAudioProcessPluginOptions, TRTCPublishTarget, TRTCStreamEncoderParam, TRTCStreamMixingConfig, TRTCRenderParams, TRTCRoleType, TRTCSwitchRoomParam, TRTCVideoFrame, TRTCVideoPixelFormat, TRTCVideoBufferType } from './trtc_define';
|
|
3
|
+
import { TRTCVodPlayerEventMap } from './vod_player';
|
|
3
4
|
export interface TRTCVideoRenderCallback {
|
|
4
5
|
onRenderVideoFrame(userId: string, streamType: TRTCVideoStreamType, frame: TRTCVideoFrame): void;
|
|
5
6
|
}
|
package/liteav/vod_player.d.ts
CHANGED
|
@@ -1,5 +1,87 @@
|
|
|
1
|
-
import { TRTCVideoRotation, TRTCVideoFillMode
|
|
1
|
+
import { TRTCVideoRotation, TRTCVideoFillMode } from './trtc_define';
|
|
2
2
|
import { IVodPlayer } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* @namespace TRTCVodPlayerEvent
|
|
5
|
+
* @description 点播播放器(VOD Player)事件
|
|
6
|
+
*/
|
|
7
|
+
export declare enum TRTCVodPlayerEvent {
|
|
8
|
+
/**
|
|
9
|
+
* @description 多媒体文件开始播放事件
|
|
10
|
+
*
|
|
11
|
+
* @event TRTCVodPlayerEvent#onVodPlayerStarted
|
|
12
|
+
* @param {Number} msLength 多媒体文件总长度,单位毫秒
|
|
13
|
+
*/
|
|
14
|
+
onVodPlayerStarted = "onVodPlayerStarted",
|
|
15
|
+
/**
|
|
16
|
+
* @description 播放器就绪事件
|
|
17
|
+
*
|
|
18
|
+
* 调用 `preload()` 完成后触发,或 `switchSource()` 切换成功后触发。
|
|
19
|
+
*
|
|
20
|
+
* @event TRTCVodPlayerEvent#onVodPlayerLoaded
|
|
21
|
+
* @param {Number} durationMs 视频总时长,单位毫秒
|
|
22
|
+
* @param {Number} width 视频宽度(像素),纯音频文件时为 0
|
|
23
|
+
* @param {Number} height 视频高度(像素),纯音频文件时为 0
|
|
24
|
+
*/
|
|
25
|
+
onVodPlayerLoaded = "onVodPlayerLoaded",
|
|
26
|
+
/**
|
|
27
|
+
* @description 多媒体文件播放进度改变事件
|
|
28
|
+
*
|
|
29
|
+
* @event TRTCVodPlayerEvent#onVodPlayerProgress
|
|
30
|
+
* @param {Number} msPos 多媒体文件当前播放进度,单位毫秒
|
|
31
|
+
*/
|
|
32
|
+
onVodPlayerProgress = "onVodPlayerProgress",
|
|
33
|
+
/**
|
|
34
|
+
* @description 多媒体文件播放暂停事件
|
|
35
|
+
*
|
|
36
|
+
* @event TRTCVodPlayerEvent#onVodPlayerPaused
|
|
37
|
+
*/
|
|
38
|
+
onVodPlayerPaused = "onVodPlayerPaused",
|
|
39
|
+
/**
|
|
40
|
+
* @description 多媒体文件播放恢复事件
|
|
41
|
+
*
|
|
42
|
+
* @event TRTCVodPlayerEvent#onVodPlayerResumed
|
|
43
|
+
*/
|
|
44
|
+
onVodPlayerResumed = "onVodPlayerResumed",
|
|
45
|
+
/**
|
|
46
|
+
* @description 多媒体文件播放停止事件
|
|
47
|
+
*
|
|
48
|
+
* @event TRTCVodPlayerEvent#onVodPlayerStopped
|
|
49
|
+
* @param {Number} reason 停止原因
|
|
50
|
+
* - 0:用户主动停止;
|
|
51
|
+
* - 1:文件播放完;
|
|
52
|
+
* - 2:视频断流。
|
|
53
|
+
*/
|
|
54
|
+
onVodPlayerStopped = "onVodPlayerStopped",
|
|
55
|
+
/**
|
|
56
|
+
* @description 多媒体文件播放出错事件
|
|
57
|
+
*
|
|
58
|
+
* @event TRTCVodPlayerEvent#onVodPlayerError
|
|
59
|
+
* @param {Number} error 错误码
|
|
60
|
+
* - -6001:未知错误;
|
|
61
|
+
* - -6002:通用错误;
|
|
62
|
+
* - -6003:解封装失败;
|
|
63
|
+
* - -6005:解封装超时;
|
|
64
|
+
* - -6006:视频解码错误;
|
|
65
|
+
* - -6007:音频解码错误;
|
|
66
|
+
* - -6009:视频渲染错误。
|
|
67
|
+
*/
|
|
68
|
+
onVodPlayerError = "onVodPlayerError"
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* 点播播放器事件监听器类型定义
|
|
72
|
+
*
|
|
73
|
+
* key 为 {@link TRTCVodPlayerEvent},value 为该事件回调接收的参数元组。
|
|
74
|
+
* 用于在 TS 层实现事件名到回调参数的精确类型映射,避免 any 滥用。
|
|
75
|
+
*/
|
|
76
|
+
export interface TRTCVodPlayerEventMap {
|
|
77
|
+
[TRTCVodPlayerEvent.onVodPlayerStarted]: [msLength: number];
|
|
78
|
+
[TRTCVodPlayerEvent.onVodPlayerLoaded]: [durationMs: number, width: number, height: number];
|
|
79
|
+
[TRTCVodPlayerEvent.onVodPlayerProgress]: [msPos: number];
|
|
80
|
+
[TRTCVodPlayerEvent.onVodPlayerPaused]: [];
|
|
81
|
+
[TRTCVodPlayerEvent.onVodPlayerResumed]: [];
|
|
82
|
+
[TRTCVodPlayerEvent.onVodPlayerStopped]: [reason: number];
|
|
83
|
+
[TRTCVodPlayerEvent.onVodPlayerError]: [error: number];
|
|
84
|
+
}
|
|
3
85
|
/**
|
|
4
86
|
*
|
|
5
87
|
* 腾讯云点播播放器
|
|
@@ -125,8 +207,6 @@ export declare class TRTCVodPlayer implements IVodPlayer {
|
|
|
125
207
|
* 重复调用会被忽略。
|
|
126
208
|
*
|
|
127
209
|
* @note 可以先调用 {@link preload} 预加载完成后再调用 start,也可以跳过 preload 直接调用 start。
|
|
128
|
-
* @note 从 SDK 10.7 版本开始,需要通过 TXLiveBase#setLicence 设置 Licence 后方可成功播放,
|
|
129
|
-
* 否则将播放失败(黑屏),全局仅设置一次即可。
|
|
130
210
|
*/
|
|
131
211
|
start(): void;
|
|
132
212
|
/**
|
|
@@ -154,14 +234,19 @@ export declare class TRTCVodPlayer implements IVodPlayer {
|
|
|
154
234
|
*/
|
|
155
235
|
seek(msPos: number): void;
|
|
156
236
|
/**
|
|
157
|
-
*
|
|
237
|
+
* 切换当前播放的媒体文件
|
|
238
|
+
*
|
|
239
|
+
* 底层实现等价于 `stop + 加载新源`,**切换后是否自动播放取决于切换前的状态**:
|
|
240
|
+
* - 切换前在播放中:底层会自动 Started 新源,业务方无需再调 {@link start};
|
|
241
|
+
* - 切换前在暂停中:底层只 Loaded 新源不自动播放,业务方需在
|
|
242
|
+
* {@link TRTCVodPlayerEvent.onVodPlayerLoaded} 之后调 {@link start} 才会播。
|
|
158
243
|
*
|
|
159
|
-
*
|
|
160
|
-
*
|
|
244
|
+
* 切换过程中会按顺序触发:
|
|
245
|
+
* `onVodPlayerStopped` → `onVodPlayerLoaded`(新源信息) →
|
|
246
|
+
* `onVodPlayerStarted`(仅"切换前在播放中"路径才会有)。
|
|
161
247
|
*
|
|
162
248
|
* @param newMediaFile - 新的媒体文件路径或 URL
|
|
163
249
|
*
|
|
164
|
-
* @note 若当前处于暂停状态,切换后仍保持暂停并展示新文件第一帧。
|
|
165
250
|
* @note 切换过程中调用 {@link stop} 会取消切换并停止当前播放。
|
|
166
251
|
* @note 调用前必须先 {@link preload} 或 {@link start},否则会被忽略并打 warn 日志。
|
|
167
252
|
* @note 传入空串会被忽略并打 warn 日志(C++ 层亦有同等保护)。
|
package/liteav/vod_player.js
CHANGED
|
@@ -1,11 +1,84 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TRTCVodPlayer = void 0;
|
|
3
|
+
exports.TRTCVodPlayer = exports.TRTCVodPlayerEvent = void 0;
|
|
4
4
|
const events_1 = require("events");
|
|
5
5
|
const trtc_define_1 = require("./trtc_define");
|
|
6
6
|
const video_render_1 = require("./Live/video-render");
|
|
7
7
|
const logger_1 = require("./logger");
|
|
8
8
|
const NodeTRTCEngine = require('../build/Release/trtc_electron_sdk.node');
|
|
9
|
+
/////////////////////////////////////////////////////////////////////////////////
|
|
10
|
+
//
|
|
11
|
+
// TRTCVodPlayer 相关类型定义
|
|
12
|
+
//
|
|
13
|
+
/////////////////////////////////////////////////////////////////////////////////
|
|
14
|
+
/**
|
|
15
|
+
* @namespace TRTCVodPlayerEvent
|
|
16
|
+
* @description 点播播放器(VOD Player)事件
|
|
17
|
+
*/
|
|
18
|
+
var TRTCVodPlayerEvent;
|
|
19
|
+
(function (TRTCVodPlayerEvent) {
|
|
20
|
+
/**
|
|
21
|
+
* @description 多媒体文件开始播放事件
|
|
22
|
+
*
|
|
23
|
+
* @event TRTCVodPlayerEvent#onVodPlayerStarted
|
|
24
|
+
* @param {Number} msLength 多媒体文件总长度,单位毫秒
|
|
25
|
+
*/
|
|
26
|
+
TRTCVodPlayerEvent["onVodPlayerStarted"] = "onVodPlayerStarted";
|
|
27
|
+
/**
|
|
28
|
+
* @description 播放器就绪事件
|
|
29
|
+
*
|
|
30
|
+
* 调用 `preload()` 完成后触发,或 `switchSource()` 切换成功后触发。
|
|
31
|
+
*
|
|
32
|
+
* @event TRTCVodPlayerEvent#onVodPlayerLoaded
|
|
33
|
+
* @param {Number} durationMs 视频总时长,单位毫秒
|
|
34
|
+
* @param {Number} width 视频宽度(像素),纯音频文件时为 0
|
|
35
|
+
* @param {Number} height 视频高度(像素),纯音频文件时为 0
|
|
36
|
+
*/
|
|
37
|
+
TRTCVodPlayerEvent["onVodPlayerLoaded"] = "onVodPlayerLoaded";
|
|
38
|
+
/**
|
|
39
|
+
* @description 多媒体文件播放进度改变事件
|
|
40
|
+
*
|
|
41
|
+
* @event TRTCVodPlayerEvent#onVodPlayerProgress
|
|
42
|
+
* @param {Number} msPos 多媒体文件当前播放进度,单位毫秒
|
|
43
|
+
*/
|
|
44
|
+
TRTCVodPlayerEvent["onVodPlayerProgress"] = "onVodPlayerProgress";
|
|
45
|
+
/**
|
|
46
|
+
* @description 多媒体文件播放暂停事件
|
|
47
|
+
*
|
|
48
|
+
* @event TRTCVodPlayerEvent#onVodPlayerPaused
|
|
49
|
+
*/
|
|
50
|
+
TRTCVodPlayerEvent["onVodPlayerPaused"] = "onVodPlayerPaused";
|
|
51
|
+
/**
|
|
52
|
+
* @description 多媒体文件播放恢复事件
|
|
53
|
+
*
|
|
54
|
+
* @event TRTCVodPlayerEvent#onVodPlayerResumed
|
|
55
|
+
*/
|
|
56
|
+
TRTCVodPlayerEvent["onVodPlayerResumed"] = "onVodPlayerResumed";
|
|
57
|
+
/**
|
|
58
|
+
* @description 多媒体文件播放停止事件
|
|
59
|
+
*
|
|
60
|
+
* @event TRTCVodPlayerEvent#onVodPlayerStopped
|
|
61
|
+
* @param {Number} reason 停止原因
|
|
62
|
+
* - 0:用户主动停止;
|
|
63
|
+
* - 1:文件播放完;
|
|
64
|
+
* - 2:视频断流。
|
|
65
|
+
*/
|
|
66
|
+
TRTCVodPlayerEvent["onVodPlayerStopped"] = "onVodPlayerStopped";
|
|
67
|
+
/**
|
|
68
|
+
* @description 多媒体文件播放出错事件
|
|
69
|
+
*
|
|
70
|
+
* @event TRTCVodPlayerEvent#onVodPlayerError
|
|
71
|
+
* @param {Number} error 错误码
|
|
72
|
+
* - -6001:未知错误;
|
|
73
|
+
* - -6002:通用错误;
|
|
74
|
+
* - -6003:解封装失败;
|
|
75
|
+
* - -6005:解封装超时;
|
|
76
|
+
* - -6006:视频解码错误;
|
|
77
|
+
* - -6007:音频解码错误;
|
|
78
|
+
* - -6009:视频渲染错误。
|
|
79
|
+
*/
|
|
80
|
+
TRTCVodPlayerEvent["onVodPlayerError"] = "onVodPlayerError";
|
|
81
|
+
})(TRTCVodPlayerEvent = exports.TRTCVodPlayerEvent || (exports.TRTCVodPlayerEvent = {}));
|
|
9
82
|
/**
|
|
10
83
|
*
|
|
11
84
|
* 腾讯云点播播放器
|
|
@@ -176,8 +249,6 @@ class TRTCVodPlayer {
|
|
|
176
249
|
* 重复调用会被忽略。
|
|
177
250
|
*
|
|
178
251
|
* @note 可以先调用 {@link preload} 预加载完成后再调用 start,也可以跳过 preload 直接调用 start。
|
|
179
|
-
* @note 从 SDK 10.7 版本开始,需要通过 TXLiveBase#setLicence 设置 Licence 后方可成功播放,
|
|
180
|
-
* 否则将播放失败(黑屏),全局仅设置一次即可。
|
|
181
252
|
*/
|
|
182
253
|
start() {
|
|
183
254
|
var _a;
|
|
@@ -272,14 +343,19 @@ class TRTCVodPlayer {
|
|
|
272
343
|
(_a = this.nativeVodPlayer) === null || _a === void 0 ? void 0 : _a.seek(msPos);
|
|
273
344
|
}
|
|
274
345
|
/**
|
|
275
|
-
*
|
|
346
|
+
* 切换当前播放的媒体文件
|
|
347
|
+
*
|
|
348
|
+
* 底层实现等价于 `stop + 加载新源`,**切换后是否自动播放取决于切换前的状态**:
|
|
349
|
+
* - 切换前在播放中:底层会自动 Started 新源,业务方无需再调 {@link start};
|
|
350
|
+
* - 切换前在暂停中:底层只 Loaded 新源不自动播放,业务方需在
|
|
351
|
+
* {@link TRTCVodPlayerEvent.onVodPlayerLoaded} 之后调 {@link start} 才会播。
|
|
276
352
|
*
|
|
277
|
-
*
|
|
278
|
-
*
|
|
353
|
+
* 切换过程中会按顺序触发:
|
|
354
|
+
* `onVodPlayerStopped` → `onVodPlayerLoaded`(新源信息) →
|
|
355
|
+
* `onVodPlayerStarted`(仅"切换前在播放中"路径才会有)。
|
|
279
356
|
*
|
|
280
357
|
* @param newMediaFile - 新的媒体文件路径或 URL
|
|
281
358
|
*
|
|
282
|
-
* @note 若当前处于暂停状态,切换后仍保持暂停并展示新文件第一帧。
|
|
283
359
|
* @note 切换过程中调用 {@link stop} 会取消切换并停止当前播放。
|
|
284
360
|
* @note 调用前必须先 {@link preload} 或 {@link start},否则会被忽略并打 warn 日志。
|
|
285
361
|
* @note 传入空串会被忽略并打 warn 日志(C++ 层亦有同等保护)。
|
|
@@ -621,29 +697,36 @@ class TRTCVodPlayer {
|
|
|
621
697
|
_initEventCallback() {
|
|
622
698
|
var _a;
|
|
623
699
|
(_a = this.nativeVodPlayer) === null || _a === void 0 ? void 0 : _a.setEventCallback((args) => {
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
700
|
+
const event = args[0];
|
|
701
|
+
if ((event === TRTCVodPlayerEvent.onVodPlayerStopped || event === TRTCVodPlayerEvent.onVodPlayerError) && this.isStarted) {
|
|
702
|
+
this.isStarted = false;
|
|
703
|
+
}
|
|
704
|
+
switch (event) {
|
|
705
|
+
case TRTCVodPlayerEvent.onVodPlayerStarted:
|
|
706
|
+
if (!this.isStarted) {
|
|
707
|
+
this.isStarted = true;
|
|
708
|
+
}
|
|
709
|
+
this.fire(TRTCVodPlayerEvent.onVodPlayerStarted, args[1].msLength);
|
|
627
710
|
break;
|
|
628
|
-
case
|
|
711
|
+
case TRTCVodPlayerEvent.onVodPlayerLoaded: {
|
|
629
712
|
const data = args[1];
|
|
630
|
-
this.fire(
|
|
713
|
+
this.fire(TRTCVodPlayerEvent.onVodPlayerLoaded, data.durationMs, data.width, data.height);
|
|
631
714
|
break;
|
|
632
715
|
}
|
|
633
|
-
case
|
|
634
|
-
this.fire(
|
|
716
|
+
case TRTCVodPlayerEvent.onVodPlayerProgress:
|
|
717
|
+
this.fire(TRTCVodPlayerEvent.onVodPlayerProgress, args[1].msPos);
|
|
635
718
|
break;
|
|
636
|
-
case
|
|
637
|
-
this.fire(
|
|
719
|
+
case TRTCVodPlayerEvent.onVodPlayerPaused:
|
|
720
|
+
this.fire(TRTCVodPlayerEvent.onVodPlayerPaused);
|
|
638
721
|
break;
|
|
639
|
-
case
|
|
640
|
-
this.fire(
|
|
722
|
+
case TRTCVodPlayerEvent.onVodPlayerResumed:
|
|
723
|
+
this.fire(TRTCVodPlayerEvent.onVodPlayerResumed);
|
|
641
724
|
break;
|
|
642
|
-
case
|
|
643
|
-
this.fire(
|
|
725
|
+
case TRTCVodPlayerEvent.onVodPlayerStopped:
|
|
726
|
+
this.fire(TRTCVodPlayerEvent.onVodPlayerStopped, args[1].reason);
|
|
644
727
|
break;
|
|
645
|
-
case
|
|
646
|
-
this.fire(
|
|
728
|
+
case TRTCVodPlayerEvent.onVodPlayerError:
|
|
729
|
+
this.fire(TRTCVodPlayerEvent.onVodPlayerError, args[1].error);
|
|
647
730
|
break;
|
|
648
731
|
default: {
|
|
649
732
|
const exhaustiveCheck = args[0];
|