@rongcloud/plugin-rtc 5.4.4-alpha.1 → 5.4.4-alpha.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/dist/core/Store.d.ts +3 -3
- package/dist/core/command/ParseRemoteResCommand.d.ts +3 -3
- package/dist/core/enums/RCRTCCode.d.ts +4 -2
- package/dist/core/tracks/RCRemoteTrack.d.ts +6 -0
- package/dist/core/tracks/RCTrack.d.ts +0 -1
- package/dist/index.d.ts +15 -8
- package/dist/index.esm.js +53 -47
- package/dist/index.js +53 -47
- package/dist/index.umd.js +53 -47
- package/package.json +2 -2
package/dist/core/Store.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import PolarisReporter from './PolarisReporter';
|
|
|
4
4
|
import { RCMediaService } from './service';
|
|
5
5
|
import { ICDNUris } from './service/interface';
|
|
6
6
|
import { RCLocalTrack } from './tracks/RCLocalTrack';
|
|
7
|
-
import { RCRemoteTrack } from './tracks/RCRemoteTrack';
|
|
7
|
+
import { RCRemoteAudioTrack, RCRemoteTrack, RCRemoteVideoTrack } from './tracks/RCRemoteTrack';
|
|
8
8
|
import RCRTCPeerCManager from './webrtc/RCRTCPeerCManager';
|
|
9
9
|
export declare const StoreEvent: {};
|
|
10
10
|
export declare abstract class ReadableStore {
|
|
@@ -25,7 +25,7 @@ export declare abstract class ReadableStore {
|
|
|
25
25
|
* 远端 track
|
|
26
26
|
*/
|
|
27
27
|
protected _remoteTracks: {
|
|
28
|
-
[trackId: string]:
|
|
28
|
+
[trackId: string]: RCRemoteAudioTrack | RCRemoteVideoTrack;
|
|
29
29
|
};
|
|
30
30
|
/**
|
|
31
31
|
* 已订阅参数
|
|
@@ -51,7 +51,7 @@ export declare abstract class ReadableStore {
|
|
|
51
51
|
getRemoteTrack(trackId: string): RCRemoteTrack | undefined;
|
|
52
52
|
getRemoteTracksByUserId(userId: string): RCRemoteTrack[];
|
|
53
53
|
getRemoteTracks(): {
|
|
54
|
-
[trackId: string]:
|
|
54
|
+
[trackId: string]: RCRemoteAudioTrack | RCRemoteVideoTrack;
|
|
55
55
|
};
|
|
56
56
|
getSessionId(): string;
|
|
57
57
|
getAllUserIds(): string[];
|
|
@@ -3,7 +3,7 @@ import { IPublishedResource } from '../interfaces';
|
|
|
3
3
|
import { Invoker } from '../Invoker';
|
|
4
4
|
import { ICDNUris } from '../service';
|
|
5
5
|
import { Store } from '../Store';
|
|
6
|
-
import { RCRemoteTrack } from '../tracks/RCRemoteTrack';
|
|
6
|
+
import { RCRemoteAudioTrack, RCRemoteTrack, RCRemoteVideoTrack } from '../tracks/RCRemoteTrack';
|
|
7
7
|
import { BaseCommand, CommandPriority } from './BaseCommand';
|
|
8
8
|
import { Subhook } from './UpdateSubListCommand';
|
|
9
9
|
export declare type ResourceMsgContent = {
|
|
@@ -28,8 +28,8 @@ export declare class ParseRemoteResCommand extends BaseCommand<void> {
|
|
|
28
28
|
constructor(msgContent: ResourceMsgContent, messageType: RCRTCMessageType.PUBLISH | RCRTCMessageType.UNPUBLISH | RCRTCMessageType.MODIFY | RCRTCMessageType.TOTAL_CONTENT_RESOURCE, senderId: string, subhook: Subhook, callback: {
|
|
29
29
|
onTrackPublish: (tracks: RCRemoteTrack[]) => void;
|
|
30
30
|
onTrackUnublish: (tracks: RCRemoteTrack[]) => void;
|
|
31
|
-
onAudioMute: (track:
|
|
32
|
-
onVideoMute: (track:
|
|
31
|
+
onAudioMute: (track: RCRemoteAudioTrack) => void;
|
|
32
|
+
onVideoMute: (track: RCRemoteVideoTrack) => void;
|
|
33
33
|
onCDNEnableChange: (bool: boolean) => void;
|
|
34
34
|
});
|
|
35
35
|
get priority(): CommandPriority;
|
|
@@ -41,7 +41,7 @@ export declare enum RCRTCCode {
|
|
|
41
41
|
/** 获取屏幕共享流失败 */
|
|
42
42
|
GET_DISPLAY_MEDIA_FAILED = 53011,
|
|
43
43
|
/** 权限问题导致获取媒体流被拒绝 */
|
|
44
|
-
|
|
44
|
+
BROWSER_PERMISSION_DENIED = 53012,
|
|
45
45
|
/** 创建自定义流失败 */
|
|
46
46
|
CREATE_CUSTOM_TRACK_FAILED = 53013,
|
|
47
47
|
/** 无效的 TAG 定义 */
|
|
@@ -81,6 +81,8 @@ export declare enum RCRTCCode {
|
|
|
81
81
|
/** 资源没有全部发成功 */
|
|
82
82
|
SOME_TRACKS_PUBLISH_FAILED = 53031,
|
|
83
83
|
/** electron 中 mac 系统暂不支持屏幕共享采集声音 */
|
|
84
|
-
MAC_IN_ELECTRON_NOT_SUPPORT_SCREEN_SHARE_WITH_AUDIO = 53032
|
|
84
|
+
MAC_IN_ELECTRON_NOT_SUPPORT_SCREEN_SHARE_WITH_AUDIO = 53032,
|
|
85
|
+
/** 获取媒体资源时,无系统权限 */
|
|
86
|
+
SYSTEM_PERMISSION_DENIED = 53033
|
|
85
87
|
}
|
|
86
88
|
//# sourceMappingURL=RCRTCCode.d.ts.map
|
|
@@ -19,5 +19,11 @@ export declare class RCRemoteAudioTrack extends RCRemoteTrack {
|
|
|
19
19
|
}
|
|
20
20
|
export declare class RCRemoteVideoTrack extends RCRemoteTrack {
|
|
21
21
|
constructor(tag: string, userId: string, roomId?: string);
|
|
22
|
+
private _isSubTiny;
|
|
23
|
+
__innerSetIsTinyTrack(bool: boolean): void;
|
|
24
|
+
/**
|
|
25
|
+
* 是否订阅的小流
|
|
26
|
+
*/
|
|
27
|
+
isSubTiny(): boolean;
|
|
22
28
|
}
|
|
23
29
|
//# sourceMappingURL=RCRemoteTrack.d.ts.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* RCRTC - v5.4.4-alpha.
|
|
3
|
-
* CommitId -
|
|
4
|
-
*
|
|
2
|
+
* RCRTC - v5.4.4-alpha.2
|
|
3
|
+
* CommitId - d4522cc8f360c18bd7c52c4ee73731d9845ffb89
|
|
4
|
+
* Wed Aug 03 2022 17:46:00 GMT+0800 (China Standard Time)
|
|
5
5
|
* ©2020 RongCloud, Inc. All rights reserved.
|
|
6
6
|
*/
|
|
7
7
|
import { EventEmitter, RTCMode, IRuntime, RTCPluginContext, IJoinRTCRoomData, IReceivedMessage, ErrorCode, RTCJoinType, IRTCUserData, KVString, IServerRTCRoomEntry, LogLevel, IRTCJoinedInfo, IPluginGenerator } from '@rongcloud/engine';
|
|
@@ -50,7 +50,7 @@ declare enum RCRTCCode {
|
|
|
50
50
|
/** 获取屏幕共享流失败 */
|
|
51
51
|
GET_DISPLAY_MEDIA_FAILED = 53011,
|
|
52
52
|
/** 权限问题导致获取媒体流被拒绝 */
|
|
53
|
-
|
|
53
|
+
BROWSER_PERMISSION_DENIED = 53012,
|
|
54
54
|
/** 创建自定义流失败 */
|
|
55
55
|
CREATE_CUSTOM_TRACK_FAILED = 53013,
|
|
56
56
|
/** 无效的 TAG 定义 */
|
|
@@ -90,7 +90,9 @@ declare enum RCRTCCode {
|
|
|
90
90
|
/** 资源没有全部发成功 */
|
|
91
91
|
SOME_TRACKS_PUBLISH_FAILED = 53031,
|
|
92
92
|
/** electron 中 mac 系统暂不支持屏幕共享采集声音 */
|
|
93
|
-
MAC_IN_ELECTRON_NOT_SUPPORT_SCREEN_SHARE_WITH_AUDIO = 53032
|
|
93
|
+
MAC_IN_ELECTRON_NOT_SUPPORT_SCREEN_SHARE_WITH_AUDIO = 53032,
|
|
94
|
+
/** 获取媒体资源时,无系统权限 */
|
|
95
|
+
SYSTEM_PERMISSION_DENIED = 53033
|
|
94
96
|
}
|
|
95
97
|
|
|
96
98
|
/**
|
|
@@ -216,7 +218,6 @@ declare abstract class RCTrack extends EventEmitter {
|
|
|
216
218
|
play(element?: HTMLVideoElement, options?: {
|
|
217
219
|
volume?: number;
|
|
218
220
|
audioDeviceId?: string;
|
|
219
|
-
autoplay: boolean;
|
|
220
221
|
}): Promise<{
|
|
221
222
|
code: RCRTCCode;
|
|
222
223
|
}>;
|
|
@@ -411,6 +412,12 @@ declare class RCRemoteAudioTrack extends RCRemoteTrack {
|
|
|
411
412
|
}
|
|
412
413
|
declare class RCRemoteVideoTrack extends RCRemoteTrack {
|
|
413
414
|
constructor(tag: string, userId: string, roomId?: string);
|
|
415
|
+
private _isSubTiny;
|
|
416
|
+
__innerSetIsTinyTrack(bool: boolean): void;
|
|
417
|
+
/**
|
|
418
|
+
* 是否订阅的小流
|
|
419
|
+
*/
|
|
420
|
+
isSubTiny(): boolean;
|
|
414
421
|
}
|
|
415
422
|
|
|
416
423
|
/**
|
|
@@ -1422,7 +1429,7 @@ declare abstract class ReadableStore {
|
|
|
1422
1429
|
* 远端 track
|
|
1423
1430
|
*/
|
|
1424
1431
|
protected _remoteTracks: {
|
|
1425
|
-
[trackId: string]:
|
|
1432
|
+
[trackId: string]: RCRemoteAudioTrack | RCRemoteVideoTrack;
|
|
1426
1433
|
};
|
|
1427
1434
|
/**
|
|
1428
1435
|
* 已订阅参数
|
|
@@ -1448,7 +1455,7 @@ declare abstract class ReadableStore {
|
|
|
1448
1455
|
getRemoteTrack(trackId: string): RCRemoteTrack | undefined;
|
|
1449
1456
|
getRemoteTracksByUserId(userId: string): RCRemoteTrack[];
|
|
1450
1457
|
getRemoteTracks(): {
|
|
1451
|
-
[trackId: string]:
|
|
1458
|
+
[trackId: string]: RCRemoteAudioTrack | RCRemoteVideoTrack;
|
|
1452
1459
|
};
|
|
1453
1460
|
getSessionId(): string;
|
|
1454
1461
|
getAllUserIds(): string[];
|
package/dist/index.esm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* RCRTC - v5.4.4-alpha.
|
|
3
|
-
* CommitId -
|
|
4
|
-
*
|
|
2
|
+
* RCRTC - v5.4.4-alpha.2
|
|
3
|
+
* CommitId - d4522cc8f360c18bd7c52c4ee73731d9845ffb89
|
|
4
|
+
* Wed Aug 03 2022 17:46:00 GMT+0800 (China Standard Time)
|
|
5
5
|
* ©2020 RongCloud, Inc. All rights reserved.
|
|
6
6
|
*/
|
|
7
7
|
import { Logger, EventEmitter, logger as logger$1, LogSource, isNumber, validate, ErrorCode, HttpMethod, ConnectionStatus, RTCMode, notEmptyString, isObject as isObject$1, isString, RTCJoinType, RTCApiType, isArray, assert, ConversationType, isHttpUrl, isBoolean, isUndefined, RTCIdentityChangeType, VersionManage } from '@rongcloud/engine';
|
|
@@ -78,7 +78,7 @@ var RCRTCCode;
|
|
|
78
78
|
/** 获取屏幕共享流失败 */
|
|
79
79
|
RCRTCCode[RCRTCCode["GET_DISPLAY_MEDIA_FAILED"] = 53011] = "GET_DISPLAY_MEDIA_FAILED";
|
|
80
80
|
/** 权限问题导致获取媒体流被拒绝 */
|
|
81
|
-
RCRTCCode[RCRTCCode["
|
|
81
|
+
RCRTCCode[RCRTCCode["BROWSER_PERMISSION_DENIED"] = 53012] = "BROWSER_PERMISSION_DENIED";
|
|
82
82
|
/** 创建自定义流失败 */
|
|
83
83
|
RCRTCCode[RCRTCCode["CREATE_CUSTOM_TRACK_FAILED"] = 53013] = "CREATE_CUSTOM_TRACK_FAILED";
|
|
84
84
|
/** 无效的 TAG 定义 */
|
|
@@ -119,6 +119,8 @@ var RCRTCCode;
|
|
|
119
119
|
RCRTCCode[RCRTCCode["SOME_TRACKS_PUBLISH_FAILED"] = 53031] = "SOME_TRACKS_PUBLISH_FAILED";
|
|
120
120
|
/** electron 中 mac 系统暂不支持屏幕共享采集声音 */
|
|
121
121
|
RCRTCCode[RCRTCCode["MAC_IN_ELECTRON_NOT_SUPPORT_SCREEN_SHARE_WITH_AUDIO"] = 53032] = "MAC_IN_ELECTRON_NOT_SUPPORT_SCREEN_SHARE_WITH_AUDIO";
|
|
122
|
+
/** 获取媒体资源时,无系统权限 */
|
|
123
|
+
RCRTCCode[RCRTCCode["SYSTEM_PERMISSION_DENIED"] = 53033] = "SYSTEM_PERMISSION_DENIED";
|
|
122
124
|
})(RCRTCCode || (RCRTCCode = {}));
|
|
123
125
|
|
|
124
126
|
var RCLoggerTag;
|
|
@@ -6421,8 +6423,7 @@ class RCTrack extends EventEmitter {
|
|
|
6421
6423
|
* @param element 用于承载媒体流的元素标签,音频流可传空
|
|
6422
6424
|
* @param volume 有效值为 0-100
|
|
6423
6425
|
*/
|
|
6424
|
-
play(element, options
|
|
6425
|
-
var _a, _b;
|
|
6426
|
+
play(element, options) {
|
|
6426
6427
|
return __awaiter(this, void 0, void 0, function* () {
|
|
6427
6428
|
logger$1.info(RCLoggerTag.L_TRACK_PLAY_T, {
|
|
6428
6429
|
element,
|
|
@@ -6580,46 +6581,42 @@ class RCTrack extends EventEmitter {
|
|
|
6580
6581
|
logSource: LogSource.RTC
|
|
6581
6582
|
});
|
|
6582
6583
|
};
|
|
6583
|
-
// 用户在 Video 标签上 设置的优化级最高,其次是选项中设置的 autoplay
|
|
6584
|
-
const autoplay = ((_a = this._element) === null || _a === void 0 ? void 0 : _a.getAttribute('autoplay')) === null ? options.autoplay : (_b = this._element) === null || _b === void 0 ? void 0 : _b.autoplay;
|
|
6585
6584
|
this._element.oncanplay = (evt) => __awaiter(this, void 0, void 0, function* () {
|
|
6586
|
-
var
|
|
6585
|
+
var _a, _b, _c;
|
|
6587
6586
|
// 可以播放
|
|
6588
|
-
logger.info(`HTMLMediaElement oncanplay -> id: ${(
|
|
6587
|
+
logger.info(`HTMLMediaElement oncanplay -> id: ${(_a = evt.target) === null || _a === void 0 ? void 0 : _a.id}, trackId: ${this._id}`);
|
|
6589
6588
|
logger$1.info(RCLoggerTag.L_TRACK_PLAY_R, {
|
|
6590
6589
|
status: RCLoggerStatus.INFO,
|
|
6591
|
-
msg: `HTMLMediaElement oncanplay -> id: ${(
|
|
6590
|
+
msg: `HTMLMediaElement oncanplay -> id: ${(_b = evt.target) === null || _b === void 0 ? void 0 : _b.id}, trackId: ${this._id}`
|
|
6592
6591
|
}, {
|
|
6593
6592
|
logSource: LogSource.RTC
|
|
6594
6593
|
});
|
|
6595
|
-
|
|
6596
|
-
|
|
6597
|
-
|
|
6598
|
-
|
|
6599
|
-
|
|
6600
|
-
|
|
6601
|
-
|
|
6602
|
-
|
|
6603
|
-
|
|
6604
|
-
logger.error(`setSinkId failed -> ${error.message}`);
|
|
6605
|
-
logger$1.error(RCLoggerTag.L_TRACK_PLAY_R, {
|
|
6606
|
-
status: RCLoggerStatus.FAILED,
|
|
6607
|
-
code: RCRTCCode.NO_PERMISSION_TO_USE_REQUESTED_DEVICE,
|
|
6608
|
-
msg: 'No permission'
|
|
6609
|
-
}, {
|
|
6610
|
-
logSource: LogSource.RTC
|
|
6611
|
-
});
|
|
6612
|
-
return;
|
|
6613
|
-
}
|
|
6614
|
-
logger.error(error);
|
|
6594
|
+
try {
|
|
6595
|
+
(_c = this._element) === null || _c === void 0 ? void 0 : _c.play();
|
|
6596
|
+
}
|
|
6597
|
+
catch (error) {
|
|
6598
|
+
/**
|
|
6599
|
+
* 检测是否有设置音频输出设备的权限
|
|
6600
|
+
*/
|
|
6601
|
+
if (error.message === 'No permission to use requested device') {
|
|
6602
|
+
logger.error(`setSinkId failed -> ${error.message}`);
|
|
6615
6603
|
logger$1.error(RCLoggerTag.L_TRACK_PLAY_R, {
|
|
6616
6604
|
status: RCLoggerStatus.FAILED,
|
|
6617
|
-
code: RCRTCCode.
|
|
6618
|
-
msg: '
|
|
6605
|
+
code: RCRTCCode.NO_PERMISSION_TO_USE_REQUESTED_DEVICE,
|
|
6606
|
+
msg: 'No permission'
|
|
6619
6607
|
}, {
|
|
6620
6608
|
logSource: LogSource.RTC
|
|
6621
6609
|
});
|
|
6610
|
+
return;
|
|
6622
6611
|
}
|
|
6612
|
+
logger.error(error);
|
|
6613
|
+
logger$1.error(RCLoggerTag.L_TRACK_PLAY_R, {
|
|
6614
|
+
status: RCLoggerStatus.FAILED,
|
|
6615
|
+
code: RCRTCCode.TRACK_PLAY_ERROR,
|
|
6616
|
+
msg: 'play error'
|
|
6617
|
+
}, {
|
|
6618
|
+
logSource: LogSource.RTC
|
|
6619
|
+
});
|
|
6623
6620
|
}
|
|
6624
6621
|
});
|
|
6625
6622
|
this._element.onvolumechange = evt => {
|
|
@@ -6635,7 +6632,7 @@ class RCTrack extends EventEmitter {
|
|
|
6635
6632
|
});
|
|
6636
6633
|
};
|
|
6637
6634
|
this._element.srcObject = this._msStream;
|
|
6638
|
-
this._element.autoplay =
|
|
6635
|
+
this._element.autoplay = true;
|
|
6639
6636
|
// video 标签页面内播放
|
|
6640
6637
|
if (isVideoTrack) {
|
|
6641
6638
|
this._element.playsInline = true;
|
|
@@ -7045,6 +7042,16 @@ class RCRemoteAudioTrack extends RCRemoteTrack {
|
|
|
7045
7042
|
class RCRemoteVideoTrack extends RCRemoteTrack {
|
|
7046
7043
|
constructor(tag, userId, roomId) {
|
|
7047
7044
|
super(tag, userId, 'video', roomId);
|
|
7045
|
+
this._isSubTiny = false;
|
|
7046
|
+
}
|
|
7047
|
+
__innerSetIsTinyTrack(bool) {
|
|
7048
|
+
this._isSubTiny = bool;
|
|
7049
|
+
}
|
|
7050
|
+
/**
|
|
7051
|
+
* 是否订阅的小流
|
|
7052
|
+
*/
|
|
7053
|
+
isSubTiny() {
|
|
7054
|
+
return this._isSubTiny;
|
|
7048
7055
|
}
|
|
7049
7056
|
}
|
|
7050
7057
|
|
|
@@ -7674,7 +7681,7 @@ const getCommonHeader = () => ({
|
|
|
7674
7681
|
'Content-Type': 'application/json;charset=UTF-8',
|
|
7675
7682
|
'Cache-Control': 'no-cache',
|
|
7676
7683
|
ClientType: `web|${browserInfo.browser}|${browserInfo.version}`,
|
|
7677
|
-
ClientVersion: "5.4.4-alpha.
|
|
7684
|
+
ClientVersion: "5.4.4-alpha.2",
|
|
7678
7685
|
'Client-Session-Id': getUUID(),
|
|
7679
7686
|
'Request-Id': Date.now().toString()
|
|
7680
7687
|
});
|
|
@@ -7996,7 +8003,7 @@ const handleAudioLevel = (audioLevel, factor = 2) => {
|
|
|
7996
8003
|
audioLevel = audioLevel / 32767;
|
|
7997
8004
|
}
|
|
7998
8005
|
const rate = 10 ** factor;
|
|
7999
|
-
return Math.
|
|
8006
|
+
return Math.round(audioLevel * rate);
|
|
8000
8007
|
};
|
|
8001
8008
|
/**
|
|
8002
8009
|
* 计算丢包率
|
|
@@ -9967,12 +9974,6 @@ class RCRTCPeerConnection extends EventEmitter {
|
|
|
9967
9974
|
* 获取 report 中的 iceCandidatePair、senders、receivers 中的所有字段
|
|
9968
9975
|
*/
|
|
9969
9976
|
const formatData = (_b = this.reportParser) === null || _b === void 0 ? void 0 : _b.formatRCRTCStateReport(data);
|
|
9970
|
-
logger$1.info(RCLoggerTag.L_RTC_PEER_CONNECTION_GET_STATS_DATA_O, {
|
|
9971
|
-
status: RCLoggerStatus.SUCCESSED,
|
|
9972
|
-
formatData
|
|
9973
|
-
}, {
|
|
9974
|
-
logSource: LogSource.RTC
|
|
9975
|
-
});
|
|
9976
9977
|
return formatData;
|
|
9977
9978
|
});
|
|
9978
9979
|
}
|
|
@@ -10272,7 +10273,7 @@ class PolarisReporter {
|
|
|
10272
10273
|
* 加入房间
|
|
10273
10274
|
*/
|
|
10274
10275
|
sendR1() {
|
|
10275
|
-
const rtcVersion = "5.4.4-alpha.
|
|
10276
|
+
const rtcVersion = "5.4.4-alpha.2";
|
|
10276
10277
|
const imVersion = this._context.getCoreVersion();
|
|
10277
10278
|
const platform = 'web';
|
|
10278
10279
|
const pcName = navigator.platform;
|
|
@@ -11232,11 +11233,13 @@ class UpdateSubListCommand extends BaseCommand {
|
|
|
11232
11233
|
const subSuccessTrackIds = subscribedList === null || subscribedList === void 0 ? void 0 : subscribedList.map(item => `${item.msid}_${item.mediaType}`);
|
|
11233
11234
|
const subSuccessList = attrs.filter(item => subSuccessTrackIds === null || subSuccessTrackIds === void 0 ? void 0 : subSuccessTrackIds.includes(item.track.getTrackId()));
|
|
11234
11235
|
const failedList = attrs.filter(item => !(subSuccessTrackIds === null || subSuccessTrackIds === void 0 ? void 0 : subSuccessTrackIds.includes(item.track.getTrackId())));
|
|
11235
|
-
// 更新 remoteTrack.isSubscribed
|
|
11236
|
+
// 更新 remoteTrack.isSubscribed、remoteTrack.isTinyTrack
|
|
11236
11237
|
const remoteTracks = store.getRemoteTracks();
|
|
11237
11238
|
for (const trackId in remoteTracks) {
|
|
11238
11239
|
const subed = subSuccessList.some(item => item.track.getTrackId() === trackId);
|
|
11239
11240
|
remoteTracks[trackId].__innerSetSubscribed(subed);
|
|
11241
|
+
const isTinyTrack = subSuccessList.some(item => (item.track.getTrackId() === trackId && item.subTiny));
|
|
11242
|
+
remoteTracks[trackId].isVideoTrack() && (remoteTracks[trackId].__innerSetIsTinyTrack(isTinyTrack));
|
|
11240
11243
|
}
|
|
11241
11244
|
// 更新本地订阅关系
|
|
11242
11245
|
const sublist = store.getSubscribedList();
|
|
@@ -16980,7 +16983,10 @@ class RCMediaStreamCapture {
|
|
|
16980
16983
|
}
|
|
16981
16984
|
catch (error) {
|
|
16982
16985
|
if (error.message === 'Permission denied') {
|
|
16983
|
-
return { code: RCRTCCode.
|
|
16986
|
+
return { code: RCRTCCode.BROWSER_PERMISSION_DENIED };
|
|
16987
|
+
}
|
|
16988
|
+
if (error.message === 'Permission denied by system') {
|
|
16989
|
+
return { code: RCRTCCode.SYSTEM_PERMISSION_DENIED };
|
|
16984
16990
|
}
|
|
16985
16991
|
logger.error(`get user media failed -> ${error.message}`);
|
|
16986
16992
|
}
|
|
@@ -18189,7 +18195,7 @@ const installer = {
|
|
|
18189
18195
|
logger.error('Please use the https protocol or use `http://localhost` to open the page!');
|
|
18190
18196
|
return false;
|
|
18191
18197
|
}
|
|
18192
|
-
VersionManage.add('plugin-rtc', "5.4.4-alpha.
|
|
18198
|
+
VersionManage.add('plugin-rtc', "5.4.4-alpha.2");
|
|
18193
18199
|
if (!VersionManage.validEngine(">=5.3.3-beem-alpha.2 || >=5.3.4")) {
|
|
18194
18200
|
logger.error(`The current engine version '${VersionManage.getInfo().engine}' error, plugin-rtc required engine version at least '${">=5.3.3-beem-alpha.2 || >=5.3.4"}'.`);
|
|
18195
18201
|
return false;
|
|
@@ -18199,7 +18205,7 @@ const installer = {
|
|
|
18199
18205
|
setup(context, runtime, options = {}) {
|
|
18200
18206
|
logger.setLogLevel(options.logLevel);
|
|
18201
18207
|
logger.setLogStdout(options.logStdout);
|
|
18202
|
-
logger.warn(`RCRTC Version: ${"5.4.4-alpha.
|
|
18208
|
+
logger.warn(`RCRTC Version: ${"5.4.4-alpha.2"}, Commit: ${"d4522cc8f360c18bd7c52c4ee73731d9845ffb89"}`);
|
|
18203
18209
|
logger.warn(`browserInfo.browser -> ${browserInfo.browser}`);
|
|
18204
18210
|
logger.warn(`browserInfo.supportsUnifiedPlan -> ${browserInfo.supportsUnifiedPlan}`);
|
|
18205
18211
|
logger.warn(`browserInfo.version -> ${browserInfo.version}`);
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* RCRTC - v5.4.4-alpha.
|
|
3
|
-
* CommitId -
|
|
4
|
-
*
|
|
2
|
+
* RCRTC - v5.4.4-alpha.2
|
|
3
|
+
* CommitId - d4522cc8f360c18bd7c52c4ee73731d9845ffb89
|
|
4
|
+
* Wed Aug 03 2022 17:46:00 GMT+0800 (China Standard Time)
|
|
5
5
|
* ©2020 RongCloud, Inc. All rights reserved.
|
|
6
6
|
*/
|
|
7
7
|
'use strict';
|
|
@@ -81,7 +81,7 @@ exports.RCRTCCode = void 0;
|
|
|
81
81
|
/** 获取屏幕共享流失败 */
|
|
82
82
|
RCRTCCode[RCRTCCode["GET_DISPLAY_MEDIA_FAILED"] = 53011] = "GET_DISPLAY_MEDIA_FAILED";
|
|
83
83
|
/** 权限问题导致获取媒体流被拒绝 */
|
|
84
|
-
RCRTCCode[RCRTCCode["
|
|
84
|
+
RCRTCCode[RCRTCCode["BROWSER_PERMISSION_DENIED"] = 53012] = "BROWSER_PERMISSION_DENIED";
|
|
85
85
|
/** 创建自定义流失败 */
|
|
86
86
|
RCRTCCode[RCRTCCode["CREATE_CUSTOM_TRACK_FAILED"] = 53013] = "CREATE_CUSTOM_TRACK_FAILED";
|
|
87
87
|
/** 无效的 TAG 定义 */
|
|
@@ -122,6 +122,8 @@ exports.RCRTCCode = void 0;
|
|
|
122
122
|
RCRTCCode[RCRTCCode["SOME_TRACKS_PUBLISH_FAILED"] = 53031] = "SOME_TRACKS_PUBLISH_FAILED";
|
|
123
123
|
/** electron 中 mac 系统暂不支持屏幕共享采集声音 */
|
|
124
124
|
RCRTCCode[RCRTCCode["MAC_IN_ELECTRON_NOT_SUPPORT_SCREEN_SHARE_WITH_AUDIO"] = 53032] = "MAC_IN_ELECTRON_NOT_SUPPORT_SCREEN_SHARE_WITH_AUDIO";
|
|
125
|
+
/** 获取媒体资源时,无系统权限 */
|
|
126
|
+
RCRTCCode[RCRTCCode["SYSTEM_PERMISSION_DENIED"] = 53033] = "SYSTEM_PERMISSION_DENIED";
|
|
125
127
|
})(exports.RCRTCCode || (exports.RCRTCCode = {}));
|
|
126
128
|
|
|
127
129
|
var RCLoggerTag;
|
|
@@ -6424,8 +6426,7 @@ class RCTrack extends engine.EventEmitter {
|
|
|
6424
6426
|
* @param element 用于承载媒体流的元素标签,音频流可传空
|
|
6425
6427
|
* @param volume 有效值为 0-100
|
|
6426
6428
|
*/
|
|
6427
|
-
play(element, options
|
|
6428
|
-
var _a, _b;
|
|
6429
|
+
play(element, options) {
|
|
6429
6430
|
return __awaiter(this, void 0, void 0, function* () {
|
|
6430
6431
|
engine.logger.info(RCLoggerTag.L_TRACK_PLAY_T, {
|
|
6431
6432
|
element,
|
|
@@ -6583,46 +6584,42 @@ class RCTrack extends engine.EventEmitter {
|
|
|
6583
6584
|
logSource: engine.LogSource.RTC
|
|
6584
6585
|
});
|
|
6585
6586
|
};
|
|
6586
|
-
// 用户在 Video 标签上 设置的优化级最高,其次是选项中设置的 autoplay
|
|
6587
|
-
const autoplay = ((_a = this._element) === null || _a === void 0 ? void 0 : _a.getAttribute('autoplay')) === null ? options.autoplay : (_b = this._element) === null || _b === void 0 ? void 0 : _b.autoplay;
|
|
6588
6587
|
this._element.oncanplay = (evt) => __awaiter(this, void 0, void 0, function* () {
|
|
6589
|
-
var
|
|
6588
|
+
var _a, _b, _c;
|
|
6590
6589
|
// 可以播放
|
|
6591
|
-
logger.info(`HTMLMediaElement oncanplay -> id: ${(
|
|
6590
|
+
logger.info(`HTMLMediaElement oncanplay -> id: ${(_a = evt.target) === null || _a === void 0 ? void 0 : _a.id}, trackId: ${this._id}`);
|
|
6592
6591
|
engine.logger.info(RCLoggerTag.L_TRACK_PLAY_R, {
|
|
6593
6592
|
status: RCLoggerStatus.INFO,
|
|
6594
|
-
msg: `HTMLMediaElement oncanplay -> id: ${(
|
|
6593
|
+
msg: `HTMLMediaElement oncanplay -> id: ${(_b = evt.target) === null || _b === void 0 ? void 0 : _b.id}, trackId: ${this._id}`
|
|
6595
6594
|
}, {
|
|
6596
6595
|
logSource: engine.LogSource.RTC
|
|
6597
6596
|
});
|
|
6598
|
-
|
|
6599
|
-
|
|
6600
|
-
|
|
6601
|
-
|
|
6602
|
-
|
|
6603
|
-
|
|
6604
|
-
|
|
6605
|
-
|
|
6606
|
-
|
|
6607
|
-
logger.error(`setSinkId failed -> ${error.message}`);
|
|
6608
|
-
engine.logger.error(RCLoggerTag.L_TRACK_PLAY_R, {
|
|
6609
|
-
status: RCLoggerStatus.FAILED,
|
|
6610
|
-
code: exports.RCRTCCode.NO_PERMISSION_TO_USE_REQUESTED_DEVICE,
|
|
6611
|
-
msg: 'No permission'
|
|
6612
|
-
}, {
|
|
6613
|
-
logSource: engine.LogSource.RTC
|
|
6614
|
-
});
|
|
6615
|
-
return;
|
|
6616
|
-
}
|
|
6617
|
-
logger.error(error);
|
|
6597
|
+
try {
|
|
6598
|
+
(_c = this._element) === null || _c === void 0 ? void 0 : _c.play();
|
|
6599
|
+
}
|
|
6600
|
+
catch (error) {
|
|
6601
|
+
/**
|
|
6602
|
+
* 检测是否有设置音频输出设备的权限
|
|
6603
|
+
*/
|
|
6604
|
+
if (error.message === 'No permission to use requested device') {
|
|
6605
|
+
logger.error(`setSinkId failed -> ${error.message}`);
|
|
6618
6606
|
engine.logger.error(RCLoggerTag.L_TRACK_PLAY_R, {
|
|
6619
6607
|
status: RCLoggerStatus.FAILED,
|
|
6620
|
-
code: exports.RCRTCCode.
|
|
6621
|
-
msg: '
|
|
6608
|
+
code: exports.RCRTCCode.NO_PERMISSION_TO_USE_REQUESTED_DEVICE,
|
|
6609
|
+
msg: 'No permission'
|
|
6622
6610
|
}, {
|
|
6623
6611
|
logSource: engine.LogSource.RTC
|
|
6624
6612
|
});
|
|
6613
|
+
return;
|
|
6625
6614
|
}
|
|
6615
|
+
logger.error(error);
|
|
6616
|
+
engine.logger.error(RCLoggerTag.L_TRACK_PLAY_R, {
|
|
6617
|
+
status: RCLoggerStatus.FAILED,
|
|
6618
|
+
code: exports.RCRTCCode.TRACK_PLAY_ERROR,
|
|
6619
|
+
msg: 'play error'
|
|
6620
|
+
}, {
|
|
6621
|
+
logSource: engine.LogSource.RTC
|
|
6622
|
+
});
|
|
6626
6623
|
}
|
|
6627
6624
|
});
|
|
6628
6625
|
this._element.onvolumechange = evt => {
|
|
@@ -6638,7 +6635,7 @@ class RCTrack extends engine.EventEmitter {
|
|
|
6638
6635
|
});
|
|
6639
6636
|
};
|
|
6640
6637
|
this._element.srcObject = this._msStream;
|
|
6641
|
-
this._element.autoplay =
|
|
6638
|
+
this._element.autoplay = true;
|
|
6642
6639
|
// video 标签页面内播放
|
|
6643
6640
|
if (isVideoTrack) {
|
|
6644
6641
|
this._element.playsInline = true;
|
|
@@ -7048,6 +7045,16 @@ class RCRemoteAudioTrack extends RCRemoteTrack {
|
|
|
7048
7045
|
class RCRemoteVideoTrack extends RCRemoteTrack {
|
|
7049
7046
|
constructor(tag, userId, roomId) {
|
|
7050
7047
|
super(tag, userId, 'video', roomId);
|
|
7048
|
+
this._isSubTiny = false;
|
|
7049
|
+
}
|
|
7050
|
+
__innerSetIsTinyTrack(bool) {
|
|
7051
|
+
this._isSubTiny = bool;
|
|
7052
|
+
}
|
|
7053
|
+
/**
|
|
7054
|
+
* 是否订阅的小流
|
|
7055
|
+
*/
|
|
7056
|
+
isSubTiny() {
|
|
7057
|
+
return this._isSubTiny;
|
|
7051
7058
|
}
|
|
7052
7059
|
}
|
|
7053
7060
|
|
|
@@ -7677,7 +7684,7 @@ const getCommonHeader = () => ({
|
|
|
7677
7684
|
'Content-Type': 'application/json;charset=UTF-8',
|
|
7678
7685
|
'Cache-Control': 'no-cache',
|
|
7679
7686
|
ClientType: `web|${browserInfo.browser}|${browserInfo.version}`,
|
|
7680
|
-
ClientVersion: "5.4.4-alpha.
|
|
7687
|
+
ClientVersion: "5.4.4-alpha.2",
|
|
7681
7688
|
'Client-Session-Id': getUUID(),
|
|
7682
7689
|
'Request-Id': Date.now().toString()
|
|
7683
7690
|
});
|
|
@@ -7999,7 +8006,7 @@ const handleAudioLevel = (audioLevel, factor = 2) => {
|
|
|
7999
8006
|
audioLevel = audioLevel / 32767;
|
|
8000
8007
|
}
|
|
8001
8008
|
const rate = 10 ** factor;
|
|
8002
|
-
return Math.
|
|
8009
|
+
return Math.round(audioLevel * rate);
|
|
8003
8010
|
};
|
|
8004
8011
|
/**
|
|
8005
8012
|
* 计算丢包率
|
|
@@ -9970,12 +9977,6 @@ class RCRTCPeerConnection extends engine.EventEmitter {
|
|
|
9970
9977
|
* 获取 report 中的 iceCandidatePair、senders、receivers 中的所有字段
|
|
9971
9978
|
*/
|
|
9972
9979
|
const formatData = (_b = this.reportParser) === null || _b === void 0 ? void 0 : _b.formatRCRTCStateReport(data);
|
|
9973
|
-
engine.logger.info(RCLoggerTag.L_RTC_PEER_CONNECTION_GET_STATS_DATA_O, {
|
|
9974
|
-
status: RCLoggerStatus.SUCCESSED,
|
|
9975
|
-
formatData
|
|
9976
|
-
}, {
|
|
9977
|
-
logSource: engine.LogSource.RTC
|
|
9978
|
-
});
|
|
9979
9980
|
return formatData;
|
|
9980
9981
|
});
|
|
9981
9982
|
}
|
|
@@ -10275,7 +10276,7 @@ class PolarisReporter {
|
|
|
10275
10276
|
* 加入房间
|
|
10276
10277
|
*/
|
|
10277
10278
|
sendR1() {
|
|
10278
|
-
const rtcVersion = "5.4.4-alpha.
|
|
10279
|
+
const rtcVersion = "5.4.4-alpha.2";
|
|
10279
10280
|
const imVersion = this._context.getCoreVersion();
|
|
10280
10281
|
const platform = 'web';
|
|
10281
10282
|
const pcName = navigator.platform;
|
|
@@ -11235,11 +11236,13 @@ class UpdateSubListCommand extends BaseCommand {
|
|
|
11235
11236
|
const subSuccessTrackIds = subscribedList === null || subscribedList === void 0 ? void 0 : subscribedList.map(item => `${item.msid}_${item.mediaType}`);
|
|
11236
11237
|
const subSuccessList = attrs.filter(item => subSuccessTrackIds === null || subSuccessTrackIds === void 0 ? void 0 : subSuccessTrackIds.includes(item.track.getTrackId()));
|
|
11237
11238
|
const failedList = attrs.filter(item => !(subSuccessTrackIds === null || subSuccessTrackIds === void 0 ? void 0 : subSuccessTrackIds.includes(item.track.getTrackId())));
|
|
11238
|
-
// 更新 remoteTrack.isSubscribed
|
|
11239
|
+
// 更新 remoteTrack.isSubscribed、remoteTrack.isTinyTrack
|
|
11239
11240
|
const remoteTracks = store.getRemoteTracks();
|
|
11240
11241
|
for (const trackId in remoteTracks) {
|
|
11241
11242
|
const subed = subSuccessList.some(item => item.track.getTrackId() === trackId);
|
|
11242
11243
|
remoteTracks[trackId].__innerSetSubscribed(subed);
|
|
11244
|
+
const isTinyTrack = subSuccessList.some(item => (item.track.getTrackId() === trackId && item.subTiny));
|
|
11245
|
+
remoteTracks[trackId].isVideoTrack() && (remoteTracks[trackId].__innerSetIsTinyTrack(isTinyTrack));
|
|
11243
11246
|
}
|
|
11244
11247
|
// 更新本地订阅关系
|
|
11245
11248
|
const sublist = store.getSubscribedList();
|
|
@@ -16983,7 +16986,10 @@ class RCMediaStreamCapture {
|
|
|
16983
16986
|
}
|
|
16984
16987
|
catch (error) {
|
|
16985
16988
|
if (error.message === 'Permission denied') {
|
|
16986
|
-
return { code: exports.RCRTCCode.
|
|
16989
|
+
return { code: exports.RCRTCCode.BROWSER_PERMISSION_DENIED };
|
|
16990
|
+
}
|
|
16991
|
+
if (error.message === 'Permission denied by system') {
|
|
16992
|
+
return { code: exports.RCRTCCode.SYSTEM_PERMISSION_DENIED };
|
|
16987
16993
|
}
|
|
16988
16994
|
logger.error(`get user media failed -> ${error.message}`);
|
|
16989
16995
|
}
|
|
@@ -18192,7 +18198,7 @@ const installer = {
|
|
|
18192
18198
|
logger.error('Please use the https protocol or use `http://localhost` to open the page!');
|
|
18193
18199
|
return false;
|
|
18194
18200
|
}
|
|
18195
|
-
engine.VersionManage.add('plugin-rtc', "5.4.4-alpha.
|
|
18201
|
+
engine.VersionManage.add('plugin-rtc', "5.4.4-alpha.2");
|
|
18196
18202
|
if (!engine.VersionManage.validEngine(">=5.3.3-beem-alpha.2 || >=5.3.4")) {
|
|
18197
18203
|
logger.error(`The current engine version '${engine.VersionManage.getInfo().engine}' error, plugin-rtc required engine version at least '${">=5.3.3-beem-alpha.2 || >=5.3.4"}'.`);
|
|
18198
18204
|
return false;
|
|
@@ -18202,7 +18208,7 @@ const installer = {
|
|
|
18202
18208
|
setup(context, runtime, options = {}) {
|
|
18203
18209
|
logger.setLogLevel(options.logLevel);
|
|
18204
18210
|
logger.setLogStdout(options.logStdout);
|
|
18205
|
-
logger.warn(`RCRTC Version: ${"5.4.4-alpha.
|
|
18211
|
+
logger.warn(`RCRTC Version: ${"5.4.4-alpha.2"}, Commit: ${"d4522cc8f360c18bd7c52c4ee73731d9845ffb89"}`);
|
|
18206
18212
|
logger.warn(`browserInfo.browser -> ${browserInfo.browser}`);
|
|
18207
18213
|
logger.warn(`browserInfo.supportsUnifiedPlan -> ${browserInfo.supportsUnifiedPlan}`);
|
|
18208
18214
|
logger.warn(`browserInfo.version -> ${browserInfo.version}`);
|
package/dist/index.umd.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* RCRTC - v5.4.4-alpha.
|
|
3
|
-
* CommitId -
|
|
4
|
-
*
|
|
2
|
+
* RCRTC - v5.4.4-alpha.2
|
|
3
|
+
* CommitId - d4522cc8f360c18bd7c52c4ee73731d9845ffb89
|
|
4
|
+
* Wed Aug 03 2022 17:46:00 GMT+0800 (China Standard Time)
|
|
5
5
|
* ©2020 RongCloud, Inc. All rights reserved.
|
|
6
6
|
*/
|
|
7
7
|
(function (global, factory) {
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
/** 获取屏幕共享流失败 */
|
|
82
82
|
RCRTCCode[RCRTCCode["GET_DISPLAY_MEDIA_FAILED"] = 53011] = "GET_DISPLAY_MEDIA_FAILED";
|
|
83
83
|
/** 权限问题导致获取媒体流被拒绝 */
|
|
84
|
-
RCRTCCode[RCRTCCode["
|
|
84
|
+
RCRTCCode[RCRTCCode["BROWSER_PERMISSION_DENIED"] = 53012] = "BROWSER_PERMISSION_DENIED";
|
|
85
85
|
/** 创建自定义流失败 */
|
|
86
86
|
RCRTCCode[RCRTCCode["CREATE_CUSTOM_TRACK_FAILED"] = 53013] = "CREATE_CUSTOM_TRACK_FAILED";
|
|
87
87
|
/** 无效的 TAG 定义 */
|
|
@@ -122,6 +122,8 @@
|
|
|
122
122
|
RCRTCCode[RCRTCCode["SOME_TRACKS_PUBLISH_FAILED"] = 53031] = "SOME_TRACKS_PUBLISH_FAILED";
|
|
123
123
|
/** electron 中 mac 系统暂不支持屏幕共享采集声音 */
|
|
124
124
|
RCRTCCode[RCRTCCode["MAC_IN_ELECTRON_NOT_SUPPORT_SCREEN_SHARE_WITH_AUDIO"] = 53032] = "MAC_IN_ELECTRON_NOT_SUPPORT_SCREEN_SHARE_WITH_AUDIO";
|
|
125
|
+
/** 获取媒体资源时,无系统权限 */
|
|
126
|
+
RCRTCCode[RCRTCCode["SYSTEM_PERMISSION_DENIED"] = 53033] = "SYSTEM_PERMISSION_DENIED";
|
|
125
127
|
})(exports.RCRTCCode || (exports.RCRTCCode = {}));
|
|
126
128
|
|
|
127
129
|
var RCLoggerTag;
|
|
@@ -6424,8 +6426,7 @@
|
|
|
6424
6426
|
* @param element 用于承载媒体流的元素标签,音频流可传空
|
|
6425
6427
|
* @param volume 有效值为 0-100
|
|
6426
6428
|
*/
|
|
6427
|
-
play(element, options
|
|
6428
|
-
var _a, _b;
|
|
6429
|
+
play(element, options) {
|
|
6429
6430
|
return __awaiter(this, void 0, void 0, function* () {
|
|
6430
6431
|
engine.logger.info(RCLoggerTag.L_TRACK_PLAY_T, {
|
|
6431
6432
|
element,
|
|
@@ -6583,46 +6584,42 @@
|
|
|
6583
6584
|
logSource: engine.LogSource.RTC
|
|
6584
6585
|
});
|
|
6585
6586
|
};
|
|
6586
|
-
// 用户在 Video 标签上 设置的优化级最高,其次是选项中设置的 autoplay
|
|
6587
|
-
const autoplay = ((_a = this._element) === null || _a === void 0 ? void 0 : _a.getAttribute('autoplay')) === null ? options.autoplay : (_b = this._element) === null || _b === void 0 ? void 0 : _b.autoplay;
|
|
6588
6587
|
this._element.oncanplay = (evt) => __awaiter(this, void 0, void 0, function* () {
|
|
6589
|
-
var
|
|
6588
|
+
var _a, _b, _c;
|
|
6590
6589
|
// 可以播放
|
|
6591
|
-
logger.info(`HTMLMediaElement oncanplay -> id: ${(
|
|
6590
|
+
logger.info(`HTMLMediaElement oncanplay -> id: ${(_a = evt.target) === null || _a === void 0 ? void 0 : _a.id}, trackId: ${this._id}`);
|
|
6592
6591
|
engine.logger.info(RCLoggerTag.L_TRACK_PLAY_R, {
|
|
6593
6592
|
status: RCLoggerStatus.INFO,
|
|
6594
|
-
msg: `HTMLMediaElement oncanplay -> id: ${(
|
|
6593
|
+
msg: `HTMLMediaElement oncanplay -> id: ${(_b = evt.target) === null || _b === void 0 ? void 0 : _b.id}, trackId: ${this._id}`
|
|
6595
6594
|
}, {
|
|
6596
6595
|
logSource: engine.LogSource.RTC
|
|
6597
6596
|
});
|
|
6598
|
-
|
|
6599
|
-
|
|
6600
|
-
|
|
6601
|
-
|
|
6602
|
-
|
|
6603
|
-
|
|
6604
|
-
|
|
6605
|
-
|
|
6606
|
-
|
|
6607
|
-
logger.error(`setSinkId failed -> ${error.message}`);
|
|
6608
|
-
engine.logger.error(RCLoggerTag.L_TRACK_PLAY_R, {
|
|
6609
|
-
status: RCLoggerStatus.FAILED,
|
|
6610
|
-
code: exports.RCRTCCode.NO_PERMISSION_TO_USE_REQUESTED_DEVICE,
|
|
6611
|
-
msg: 'No permission'
|
|
6612
|
-
}, {
|
|
6613
|
-
logSource: engine.LogSource.RTC
|
|
6614
|
-
});
|
|
6615
|
-
return;
|
|
6616
|
-
}
|
|
6617
|
-
logger.error(error);
|
|
6597
|
+
try {
|
|
6598
|
+
(_c = this._element) === null || _c === void 0 ? void 0 : _c.play();
|
|
6599
|
+
}
|
|
6600
|
+
catch (error) {
|
|
6601
|
+
/**
|
|
6602
|
+
* 检测是否有设置音频输出设备的权限
|
|
6603
|
+
*/
|
|
6604
|
+
if (error.message === 'No permission to use requested device') {
|
|
6605
|
+
logger.error(`setSinkId failed -> ${error.message}`);
|
|
6618
6606
|
engine.logger.error(RCLoggerTag.L_TRACK_PLAY_R, {
|
|
6619
6607
|
status: RCLoggerStatus.FAILED,
|
|
6620
|
-
code: exports.RCRTCCode.
|
|
6621
|
-
msg: '
|
|
6608
|
+
code: exports.RCRTCCode.NO_PERMISSION_TO_USE_REQUESTED_DEVICE,
|
|
6609
|
+
msg: 'No permission'
|
|
6622
6610
|
}, {
|
|
6623
6611
|
logSource: engine.LogSource.RTC
|
|
6624
6612
|
});
|
|
6613
|
+
return;
|
|
6625
6614
|
}
|
|
6615
|
+
logger.error(error);
|
|
6616
|
+
engine.logger.error(RCLoggerTag.L_TRACK_PLAY_R, {
|
|
6617
|
+
status: RCLoggerStatus.FAILED,
|
|
6618
|
+
code: exports.RCRTCCode.TRACK_PLAY_ERROR,
|
|
6619
|
+
msg: 'play error'
|
|
6620
|
+
}, {
|
|
6621
|
+
logSource: engine.LogSource.RTC
|
|
6622
|
+
});
|
|
6626
6623
|
}
|
|
6627
6624
|
});
|
|
6628
6625
|
this._element.onvolumechange = evt => {
|
|
@@ -6638,7 +6635,7 @@
|
|
|
6638
6635
|
});
|
|
6639
6636
|
};
|
|
6640
6637
|
this._element.srcObject = this._msStream;
|
|
6641
|
-
this._element.autoplay =
|
|
6638
|
+
this._element.autoplay = true;
|
|
6642
6639
|
// video 标签页面内播放
|
|
6643
6640
|
if (isVideoTrack) {
|
|
6644
6641
|
this._element.playsInline = true;
|
|
@@ -7048,6 +7045,16 @@
|
|
|
7048
7045
|
class RCRemoteVideoTrack extends RCRemoteTrack {
|
|
7049
7046
|
constructor(tag, userId, roomId) {
|
|
7050
7047
|
super(tag, userId, 'video', roomId);
|
|
7048
|
+
this._isSubTiny = false;
|
|
7049
|
+
}
|
|
7050
|
+
__innerSetIsTinyTrack(bool) {
|
|
7051
|
+
this._isSubTiny = bool;
|
|
7052
|
+
}
|
|
7053
|
+
/**
|
|
7054
|
+
* 是否订阅的小流
|
|
7055
|
+
*/
|
|
7056
|
+
isSubTiny() {
|
|
7057
|
+
return this._isSubTiny;
|
|
7051
7058
|
}
|
|
7052
7059
|
}
|
|
7053
7060
|
|
|
@@ -7677,7 +7684,7 @@
|
|
|
7677
7684
|
'Content-Type': 'application/json;charset=UTF-8',
|
|
7678
7685
|
'Cache-Control': 'no-cache',
|
|
7679
7686
|
ClientType: `web|${browserInfo.browser}|${browserInfo.version}`,
|
|
7680
|
-
ClientVersion: "5.4.4-alpha.
|
|
7687
|
+
ClientVersion: "5.4.4-alpha.2",
|
|
7681
7688
|
'Client-Session-Id': getUUID(),
|
|
7682
7689
|
'Request-Id': Date.now().toString()
|
|
7683
7690
|
});
|
|
@@ -7999,7 +8006,7 @@
|
|
|
7999
8006
|
audioLevel = audioLevel / 32767;
|
|
8000
8007
|
}
|
|
8001
8008
|
const rate = 10 ** factor;
|
|
8002
|
-
return Math.
|
|
8009
|
+
return Math.round(audioLevel * rate);
|
|
8003
8010
|
};
|
|
8004
8011
|
/**
|
|
8005
8012
|
* 计算丢包率
|
|
@@ -9970,12 +9977,6 @@
|
|
|
9970
9977
|
* 获取 report 中的 iceCandidatePair、senders、receivers 中的所有字段
|
|
9971
9978
|
*/
|
|
9972
9979
|
const formatData = (_b = this.reportParser) === null || _b === void 0 ? void 0 : _b.formatRCRTCStateReport(data);
|
|
9973
|
-
engine.logger.info(RCLoggerTag.L_RTC_PEER_CONNECTION_GET_STATS_DATA_O, {
|
|
9974
|
-
status: RCLoggerStatus.SUCCESSED,
|
|
9975
|
-
formatData
|
|
9976
|
-
}, {
|
|
9977
|
-
logSource: engine.LogSource.RTC
|
|
9978
|
-
});
|
|
9979
9980
|
return formatData;
|
|
9980
9981
|
});
|
|
9981
9982
|
}
|
|
@@ -10275,7 +10276,7 @@
|
|
|
10275
10276
|
* 加入房间
|
|
10276
10277
|
*/
|
|
10277
10278
|
sendR1() {
|
|
10278
|
-
const rtcVersion = "5.4.4-alpha.
|
|
10279
|
+
const rtcVersion = "5.4.4-alpha.2";
|
|
10279
10280
|
const imVersion = this._context.getCoreVersion();
|
|
10280
10281
|
const platform = 'web';
|
|
10281
10282
|
const pcName = navigator.platform;
|
|
@@ -11235,11 +11236,13 @@
|
|
|
11235
11236
|
const subSuccessTrackIds = subscribedList === null || subscribedList === void 0 ? void 0 : subscribedList.map(item => `${item.msid}_${item.mediaType}`);
|
|
11236
11237
|
const subSuccessList = attrs.filter(item => subSuccessTrackIds === null || subSuccessTrackIds === void 0 ? void 0 : subSuccessTrackIds.includes(item.track.getTrackId()));
|
|
11237
11238
|
const failedList = attrs.filter(item => !(subSuccessTrackIds === null || subSuccessTrackIds === void 0 ? void 0 : subSuccessTrackIds.includes(item.track.getTrackId())));
|
|
11238
|
-
// 更新 remoteTrack.isSubscribed
|
|
11239
|
+
// 更新 remoteTrack.isSubscribed、remoteTrack.isTinyTrack
|
|
11239
11240
|
const remoteTracks = store.getRemoteTracks();
|
|
11240
11241
|
for (const trackId in remoteTracks) {
|
|
11241
11242
|
const subed = subSuccessList.some(item => item.track.getTrackId() === trackId);
|
|
11242
11243
|
remoteTracks[trackId].__innerSetSubscribed(subed);
|
|
11244
|
+
const isTinyTrack = subSuccessList.some(item => (item.track.getTrackId() === trackId && item.subTiny));
|
|
11245
|
+
remoteTracks[trackId].isVideoTrack() && (remoteTracks[trackId].__innerSetIsTinyTrack(isTinyTrack));
|
|
11243
11246
|
}
|
|
11244
11247
|
// 更新本地订阅关系
|
|
11245
11248
|
const sublist = store.getSubscribedList();
|
|
@@ -16983,7 +16986,10 @@
|
|
|
16983
16986
|
}
|
|
16984
16987
|
catch (error) {
|
|
16985
16988
|
if (error.message === 'Permission denied') {
|
|
16986
|
-
return { code: exports.RCRTCCode.
|
|
16989
|
+
return { code: exports.RCRTCCode.BROWSER_PERMISSION_DENIED };
|
|
16990
|
+
}
|
|
16991
|
+
if (error.message === 'Permission denied by system') {
|
|
16992
|
+
return { code: exports.RCRTCCode.SYSTEM_PERMISSION_DENIED };
|
|
16987
16993
|
}
|
|
16988
16994
|
logger.error(`get user media failed -> ${error.message}`);
|
|
16989
16995
|
}
|
|
@@ -18192,7 +18198,7 @@
|
|
|
18192
18198
|
logger.error('Please use the https protocol or use `http://localhost` to open the page!');
|
|
18193
18199
|
return false;
|
|
18194
18200
|
}
|
|
18195
|
-
engine.VersionManage.add('plugin-rtc', "5.4.4-alpha.
|
|
18201
|
+
engine.VersionManage.add('plugin-rtc', "5.4.4-alpha.2");
|
|
18196
18202
|
if (!engine.VersionManage.validEngine(">=5.3.3-beem-alpha.2 || >=5.3.4")) {
|
|
18197
18203
|
logger.error(`The current engine version '${engine.VersionManage.getInfo().engine}' error, plugin-rtc required engine version at least '${">=5.3.3-beem-alpha.2 || >=5.3.4"}'.`);
|
|
18198
18204
|
return false;
|
|
@@ -18202,7 +18208,7 @@
|
|
|
18202
18208
|
setup(context, runtime, options = {}) {
|
|
18203
18209
|
logger.setLogLevel(options.logLevel);
|
|
18204
18210
|
logger.setLogStdout(options.logStdout);
|
|
18205
|
-
logger.warn(`RCRTC Version: ${"5.4.4-alpha.
|
|
18211
|
+
logger.warn(`RCRTC Version: ${"5.4.4-alpha.2"}, Commit: ${"d4522cc8f360c18bd7c52c4ee73731d9845ffb89"}`);
|
|
18206
18212
|
logger.warn(`browserInfo.browser -> ${browserInfo.browser}`);
|
|
18207
18213
|
logger.warn(`browserInfo.supportsUnifiedPlan -> ${browserInfo.supportsUnifiedPlan}`);
|
|
18208
18214
|
logger.warn(`browserInfo.version -> ${browserInfo.version}`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rongcloud/plugin-rtc",
|
|
3
|
-
"version": "5.4.4-alpha.
|
|
3
|
+
"version": "5.4.4-alpha.2",
|
|
4
4
|
"description": "@rongcloud/plugin-rtc",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"__attrs__": {
|
|
@@ -33,5 +33,5 @@
|
|
|
33
33
|
"peerDependencies": {
|
|
34
34
|
"@rongcloud/engine": ">=5.3.3-beem-alpha.2 || >=5.3.4"
|
|
35
35
|
},
|
|
36
|
-
"__commit__": "
|
|
36
|
+
"__commit__": "d4522cc8f360c18bd7c52c4ee73731d9845ffb89"
|
|
37
37
|
}
|