@rongcloud/plugin-rtc 5.1.10-enterprise.2 → 5.1.10-enterprise.3
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 +4 -3
- package/dist/index.esm.js +20 -16
- package/dist/index.js +20 -16
- package/dist/index.umd.js +20 -16
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* RCRTC - v5.1.10-enterprise.
|
|
3
|
-
* CommitId -
|
|
4
|
-
*
|
|
2
|
+
* RCRTC - v5.1.10-enterprise.3
|
|
3
|
+
* CommitId - 9409ef61818cd46a57e67dcba7e66eaba0dc05a6
|
|
4
|
+
* Mon Jul 25 2022 18:28:32 GMT+0800 (China Standard Time)
|
|
5
5
|
* ©2020 RongCloud, Inc. All rights reserved.
|
|
6
6
|
*/
|
|
7
7
|
import { EventEmitter, LogLevel, RTCMode, IRuntime, RTCPluginContext, IServerRTCRoomEntry, IJoinRTCRoomData, IReceivedMessage, KVString, ErrorCode, IPluginGenerator } from '@rongcloud/engine';
|
|
@@ -218,6 +218,7 @@ declare abstract class RCTrack extends EventEmitter {
|
|
|
218
218
|
*/
|
|
219
219
|
play(element?: HTMLVideoElement, options?: {
|
|
220
220
|
volume?: number;
|
|
221
|
+
autoplay: boolean;
|
|
221
222
|
}): Promise<{
|
|
222
223
|
code: RCRTCCode;
|
|
223
224
|
}>;
|
package/dist/index.esm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* RCRTC - v5.1.10-enterprise.
|
|
3
|
-
* CommitId -
|
|
4
|
-
*
|
|
2
|
+
* RCRTC - v5.1.10-enterprise.3
|
|
3
|
+
* CommitId - 9409ef61818cd46a57e67dcba7e66eaba0dc05a6
|
|
4
|
+
* Mon Jul 25 2022 18:28:32 GMT+0800 (China Standard Time)
|
|
5
5
|
* ©2020 RongCloud, Inc. All rights reserved.
|
|
6
6
|
*/
|
|
7
7
|
import { Logger, EventEmitter, isNumber, ErrorCode, ConnectionStatus, assert, ConversationType, RTCApiType, validate, isArray, RTCMode, isHttpUrl, isBoolean, HttpMethod, isString, notEmptyString, RTCIdentityChangeType } from '@rongcloud/engine';
|
|
@@ -5756,7 +5756,8 @@ class RCTrack extends EventEmitter {
|
|
|
5756
5756
|
* @param element 用于承载媒体流的元素标签,音频流可传空
|
|
5757
5757
|
* @param volume 有效值为 0-100
|
|
5758
5758
|
*/
|
|
5759
|
-
play(element, options) {
|
|
5759
|
+
play(element, options = { autoplay: true }) {
|
|
5760
|
+
var _a;
|
|
5760
5761
|
return __awaiter(this, void 0, void 0, function* () {
|
|
5761
5762
|
if (!this._msTrack) {
|
|
5762
5763
|
logger.warn(`the track is not ready to play -> id: ${this._id}`);
|
|
@@ -5818,10 +5819,20 @@ class RCTrack extends EventEmitter {
|
|
|
5818
5819
|
// 中止
|
|
5819
5820
|
logger.info(`HTMLMediaElement onabort -> id: ${(_a = evt.target) === null || _a === void 0 ? void 0 : _a.id}, trackId: ${this._id}`);
|
|
5820
5821
|
};
|
|
5822
|
+
// 用户在 Video 标签上 设置的优化级最高,其次是选项中设置的 autoplay
|
|
5823
|
+
const autoplay = ((_a = this._element) === null || _a === void 0 ? void 0 : _a.autoplay) || options.autoplay;
|
|
5821
5824
|
this._element.oncanplay = evt => {
|
|
5822
|
-
var _a;
|
|
5825
|
+
var _a, _b;
|
|
5823
5826
|
// 可以播放
|
|
5824
5827
|
logger.info(`HTMLMediaElement oncanplay -> id: ${(_a = evt.target) === null || _a === void 0 ? void 0 : _a.id}, trackId: ${this._id}`);
|
|
5828
|
+
if (autoplay) {
|
|
5829
|
+
try {
|
|
5830
|
+
(_b = this._element) === null || _b === void 0 ? void 0 : _b.play();
|
|
5831
|
+
}
|
|
5832
|
+
catch (error) {
|
|
5833
|
+
logger.error(error);
|
|
5834
|
+
}
|
|
5835
|
+
}
|
|
5825
5836
|
};
|
|
5826
5837
|
this._element.onvolumechange = evt => {
|
|
5827
5838
|
var _a;
|
|
@@ -5830,7 +5841,7 @@ class RCTrack extends EventEmitter {
|
|
|
5830
5841
|
logger.info(`HTMLMediaElement onvolumechange -> volume: ${volume}, trackId: ${this._id}`);
|
|
5831
5842
|
};
|
|
5832
5843
|
this._element.srcObject = this._msStream;
|
|
5833
|
-
this._element.autoplay =
|
|
5844
|
+
this._element.autoplay = autoplay;
|
|
5834
5845
|
// video 标签页面内播放
|
|
5835
5846
|
if (isVideoTrack) {
|
|
5836
5847
|
this._element.playsInline = true;
|
|
@@ -5841,13 +5852,6 @@ class RCTrack extends EventEmitter {
|
|
|
5841
5852
|
if (!isVideoTrack && ((options === null || options === void 0 ? void 0 : options.volume) || (options === null || options === void 0 ? void 0 : options.volume) === 0)) {
|
|
5842
5853
|
this._element.volume = (options === null || options === void 0 ? void 0 : options.volume) / 100;
|
|
5843
5854
|
}
|
|
5844
|
-
try {
|
|
5845
|
-
this._element.play();
|
|
5846
|
-
}
|
|
5847
|
-
catch (error) {
|
|
5848
|
-
logger.error(error);
|
|
5849
|
-
return { code: RCRTCCode.TRACK_PLAY_ERROR };
|
|
5850
|
-
}
|
|
5851
5855
|
return { code: RCRTCCode.SUCCESS };
|
|
5852
5856
|
});
|
|
5853
5857
|
}
|
|
@@ -8237,7 +8241,7 @@ class PolarisReporter {
|
|
|
8237
8241
|
* 加入房间
|
|
8238
8242
|
*/
|
|
8239
8243
|
sendR1() {
|
|
8240
|
-
const rtcVersion = "5.1.10-enterprise.
|
|
8244
|
+
const rtcVersion = "5.1.10-enterprise.3";
|
|
8241
8245
|
const imVersion = this._context.getCoreVersion();
|
|
8242
8246
|
const platform = 'web';
|
|
8243
8247
|
const pcName = navigator.platform;
|
|
@@ -10457,7 +10461,7 @@ const getCommonHeader = () => ({
|
|
|
10457
10461
|
'Content-Type': 'application/json;charset=UTF-8',
|
|
10458
10462
|
'Cache-Control': 'no-cache',
|
|
10459
10463
|
ClientType: `web|${browserInfo.browser}|${browserInfo.version}`,
|
|
10460
|
-
ClientVersion: "5.1.10-enterprise.
|
|
10464
|
+
ClientVersion: "5.1.10-enterprise.3",
|
|
10461
10465
|
'Client-Session-Id': getUUID(),
|
|
10462
10466
|
'Request-Id': Date.now().toString()
|
|
10463
10467
|
});
|
|
@@ -12375,7 +12379,7 @@ const installer = {
|
|
|
12375
12379
|
setup(context, runtime, options = {}) {
|
|
12376
12380
|
logger.setLogLevel(options.logLevel);
|
|
12377
12381
|
logger.setLogStdout(options.logStdout);
|
|
12378
|
-
logger.warn(`RCRTC Version: ${"5.1.10-enterprise.
|
|
12382
|
+
logger.warn(`RCRTC Version: ${"5.1.10-enterprise.3"}, Commit: ${"9409ef61818cd46a57e67dcba7e66eaba0dc05a6"}`);
|
|
12379
12383
|
logger.warn(`browserInfo.browser -> ${browserInfo.browser}`);
|
|
12380
12384
|
logger.warn(`browserInfo.supportsUnifiedPlan -> ${browserInfo.supportsUnifiedPlan}`);
|
|
12381
12385
|
logger.warn(`browserInfo.version -> ${browserInfo.version}`);
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* RCRTC - v5.1.10-enterprise.
|
|
3
|
-
* CommitId -
|
|
4
|
-
*
|
|
2
|
+
* RCRTC - v5.1.10-enterprise.3
|
|
3
|
+
* CommitId - 9409ef61818cd46a57e67dcba7e66eaba0dc05a6
|
|
4
|
+
* Mon Jul 25 2022 18:28:32 GMT+0800 (China Standard Time)
|
|
5
5
|
* ©2020 RongCloud, Inc. All rights reserved.
|
|
6
6
|
*/
|
|
7
7
|
'use strict';
|
|
@@ -5760,7 +5760,8 @@ class RCTrack extends engine.EventEmitter {
|
|
|
5760
5760
|
* @param element 用于承载媒体流的元素标签,音频流可传空
|
|
5761
5761
|
* @param volume 有效值为 0-100
|
|
5762
5762
|
*/
|
|
5763
|
-
play(element, options) {
|
|
5763
|
+
play(element, options = { autoplay: true }) {
|
|
5764
|
+
var _a;
|
|
5764
5765
|
return __awaiter(this, void 0, void 0, function* () {
|
|
5765
5766
|
if (!this._msTrack) {
|
|
5766
5767
|
logger.warn(`the track is not ready to play -> id: ${this._id}`);
|
|
@@ -5822,10 +5823,20 @@ class RCTrack extends engine.EventEmitter {
|
|
|
5822
5823
|
// 中止
|
|
5823
5824
|
logger.info(`HTMLMediaElement onabort -> id: ${(_a = evt.target) === null || _a === void 0 ? void 0 : _a.id}, trackId: ${this._id}`);
|
|
5824
5825
|
};
|
|
5826
|
+
// 用户在 Video 标签上 设置的优化级最高,其次是选项中设置的 autoplay
|
|
5827
|
+
const autoplay = ((_a = this._element) === null || _a === void 0 ? void 0 : _a.autoplay) || options.autoplay;
|
|
5825
5828
|
this._element.oncanplay = evt => {
|
|
5826
|
-
var _a;
|
|
5829
|
+
var _a, _b;
|
|
5827
5830
|
// 可以播放
|
|
5828
5831
|
logger.info(`HTMLMediaElement oncanplay -> id: ${(_a = evt.target) === null || _a === void 0 ? void 0 : _a.id}, trackId: ${this._id}`);
|
|
5832
|
+
if (autoplay) {
|
|
5833
|
+
try {
|
|
5834
|
+
(_b = this._element) === null || _b === void 0 ? void 0 : _b.play();
|
|
5835
|
+
}
|
|
5836
|
+
catch (error) {
|
|
5837
|
+
logger.error(error);
|
|
5838
|
+
}
|
|
5839
|
+
}
|
|
5829
5840
|
};
|
|
5830
5841
|
this._element.onvolumechange = evt => {
|
|
5831
5842
|
var _a;
|
|
@@ -5834,7 +5845,7 @@ class RCTrack extends engine.EventEmitter {
|
|
|
5834
5845
|
logger.info(`HTMLMediaElement onvolumechange -> volume: ${volume}, trackId: ${this._id}`);
|
|
5835
5846
|
};
|
|
5836
5847
|
this._element.srcObject = this._msStream;
|
|
5837
|
-
this._element.autoplay =
|
|
5848
|
+
this._element.autoplay = autoplay;
|
|
5838
5849
|
// video 标签页面内播放
|
|
5839
5850
|
if (isVideoTrack) {
|
|
5840
5851
|
this._element.playsInline = true;
|
|
@@ -5845,13 +5856,6 @@ class RCTrack extends engine.EventEmitter {
|
|
|
5845
5856
|
if (!isVideoTrack && ((options === null || options === void 0 ? void 0 : options.volume) || (options === null || options === void 0 ? void 0 : options.volume) === 0)) {
|
|
5846
5857
|
this._element.volume = (options === null || options === void 0 ? void 0 : options.volume) / 100;
|
|
5847
5858
|
}
|
|
5848
|
-
try {
|
|
5849
|
-
this._element.play();
|
|
5850
|
-
}
|
|
5851
|
-
catch (error) {
|
|
5852
|
-
logger.error(error);
|
|
5853
|
-
return { code: exports.RCRTCCode.TRACK_PLAY_ERROR };
|
|
5854
|
-
}
|
|
5855
5859
|
return { code: exports.RCRTCCode.SUCCESS };
|
|
5856
5860
|
});
|
|
5857
5861
|
}
|
|
@@ -8241,7 +8245,7 @@ class PolarisReporter {
|
|
|
8241
8245
|
* 加入房间
|
|
8242
8246
|
*/
|
|
8243
8247
|
sendR1() {
|
|
8244
|
-
const rtcVersion = "5.1.10-enterprise.
|
|
8248
|
+
const rtcVersion = "5.1.10-enterprise.3";
|
|
8245
8249
|
const imVersion = this._context.getCoreVersion();
|
|
8246
8250
|
const platform = 'web';
|
|
8247
8251
|
const pcName = navigator.platform;
|
|
@@ -10461,7 +10465,7 @@ const getCommonHeader = () => ({
|
|
|
10461
10465
|
'Content-Type': 'application/json;charset=UTF-8',
|
|
10462
10466
|
'Cache-Control': 'no-cache',
|
|
10463
10467
|
ClientType: `web|${browserInfo.browser}|${browserInfo.version}`,
|
|
10464
|
-
ClientVersion: "5.1.10-enterprise.
|
|
10468
|
+
ClientVersion: "5.1.10-enterprise.3",
|
|
10465
10469
|
'Client-Session-Id': getUUID(),
|
|
10466
10470
|
'Request-Id': Date.now().toString()
|
|
10467
10471
|
});
|
|
@@ -12379,7 +12383,7 @@ const installer = {
|
|
|
12379
12383
|
setup(context, runtime, options = {}) {
|
|
12380
12384
|
logger.setLogLevel(options.logLevel);
|
|
12381
12385
|
logger.setLogStdout(options.logStdout);
|
|
12382
|
-
logger.warn(`RCRTC Version: ${"5.1.10-enterprise.
|
|
12386
|
+
logger.warn(`RCRTC Version: ${"5.1.10-enterprise.3"}, Commit: ${"9409ef61818cd46a57e67dcba7e66eaba0dc05a6"}`);
|
|
12383
12387
|
logger.warn(`browserInfo.browser -> ${browserInfo.browser}`);
|
|
12384
12388
|
logger.warn(`browserInfo.supportsUnifiedPlan -> ${browserInfo.supportsUnifiedPlan}`);
|
|
12385
12389
|
logger.warn(`browserInfo.version -> ${browserInfo.version}`);
|
package/dist/index.umd.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* RCRTC - v5.1.10-enterprise.
|
|
3
|
-
* CommitId -
|
|
4
|
-
*
|
|
2
|
+
* RCRTC - v5.1.10-enterprise.3
|
|
3
|
+
* CommitId - 9409ef61818cd46a57e67dcba7e66eaba0dc05a6
|
|
4
|
+
* Mon Jul 25 2022 18:28:32 GMT+0800 (China Standard Time)
|
|
5
5
|
* ©2020 RongCloud, Inc. All rights reserved.
|
|
6
6
|
*/
|
|
7
7
|
(function (global, factory) {
|
|
@@ -5760,7 +5760,8 @@
|
|
|
5760
5760
|
* @param element 用于承载媒体流的元素标签,音频流可传空
|
|
5761
5761
|
* @param volume 有效值为 0-100
|
|
5762
5762
|
*/
|
|
5763
|
-
play(element, options) {
|
|
5763
|
+
play(element, options = { autoplay: true }) {
|
|
5764
|
+
var _a;
|
|
5764
5765
|
return __awaiter(this, void 0, void 0, function* () {
|
|
5765
5766
|
if (!this._msTrack) {
|
|
5766
5767
|
logger.warn(`the track is not ready to play -> id: ${this._id}`);
|
|
@@ -5822,10 +5823,20 @@
|
|
|
5822
5823
|
// 中止
|
|
5823
5824
|
logger.info(`HTMLMediaElement onabort -> id: ${(_a = evt.target) === null || _a === void 0 ? void 0 : _a.id}, trackId: ${this._id}`);
|
|
5824
5825
|
};
|
|
5826
|
+
// 用户在 Video 标签上 设置的优化级最高,其次是选项中设置的 autoplay
|
|
5827
|
+
const autoplay = ((_a = this._element) === null || _a === void 0 ? void 0 : _a.autoplay) || options.autoplay;
|
|
5825
5828
|
this._element.oncanplay = evt => {
|
|
5826
|
-
var _a;
|
|
5829
|
+
var _a, _b;
|
|
5827
5830
|
// 可以播放
|
|
5828
5831
|
logger.info(`HTMLMediaElement oncanplay -> id: ${(_a = evt.target) === null || _a === void 0 ? void 0 : _a.id}, trackId: ${this._id}`);
|
|
5832
|
+
if (autoplay) {
|
|
5833
|
+
try {
|
|
5834
|
+
(_b = this._element) === null || _b === void 0 ? void 0 : _b.play();
|
|
5835
|
+
}
|
|
5836
|
+
catch (error) {
|
|
5837
|
+
logger.error(error);
|
|
5838
|
+
}
|
|
5839
|
+
}
|
|
5829
5840
|
};
|
|
5830
5841
|
this._element.onvolumechange = evt => {
|
|
5831
5842
|
var _a;
|
|
@@ -5834,7 +5845,7 @@
|
|
|
5834
5845
|
logger.info(`HTMLMediaElement onvolumechange -> volume: ${volume}, trackId: ${this._id}`);
|
|
5835
5846
|
};
|
|
5836
5847
|
this._element.srcObject = this._msStream;
|
|
5837
|
-
this._element.autoplay =
|
|
5848
|
+
this._element.autoplay = autoplay;
|
|
5838
5849
|
// video 标签页面内播放
|
|
5839
5850
|
if (isVideoTrack) {
|
|
5840
5851
|
this._element.playsInline = true;
|
|
@@ -5845,13 +5856,6 @@
|
|
|
5845
5856
|
if (!isVideoTrack && ((options === null || options === void 0 ? void 0 : options.volume) || (options === null || options === void 0 ? void 0 : options.volume) === 0)) {
|
|
5846
5857
|
this._element.volume = (options === null || options === void 0 ? void 0 : options.volume) / 100;
|
|
5847
5858
|
}
|
|
5848
|
-
try {
|
|
5849
|
-
this._element.play();
|
|
5850
|
-
}
|
|
5851
|
-
catch (error) {
|
|
5852
|
-
logger.error(error);
|
|
5853
|
-
return { code: exports.RCRTCCode.TRACK_PLAY_ERROR };
|
|
5854
|
-
}
|
|
5855
5859
|
return { code: exports.RCRTCCode.SUCCESS };
|
|
5856
5860
|
});
|
|
5857
5861
|
}
|
|
@@ -8241,7 +8245,7 @@
|
|
|
8241
8245
|
* 加入房间
|
|
8242
8246
|
*/
|
|
8243
8247
|
sendR1() {
|
|
8244
|
-
const rtcVersion = "5.1.10-enterprise.
|
|
8248
|
+
const rtcVersion = "5.1.10-enterprise.3";
|
|
8245
8249
|
const imVersion = this._context.getCoreVersion();
|
|
8246
8250
|
const platform = 'web';
|
|
8247
8251
|
const pcName = navigator.platform;
|
|
@@ -10461,7 +10465,7 @@
|
|
|
10461
10465
|
'Content-Type': 'application/json;charset=UTF-8',
|
|
10462
10466
|
'Cache-Control': 'no-cache',
|
|
10463
10467
|
ClientType: `web|${browserInfo.browser}|${browserInfo.version}`,
|
|
10464
|
-
ClientVersion: "5.1.10-enterprise.
|
|
10468
|
+
ClientVersion: "5.1.10-enterprise.3",
|
|
10465
10469
|
'Client-Session-Id': getUUID(),
|
|
10466
10470
|
'Request-Id': Date.now().toString()
|
|
10467
10471
|
});
|
|
@@ -12379,7 +12383,7 @@
|
|
|
12379
12383
|
setup(context, runtime, options = {}) {
|
|
12380
12384
|
logger.setLogLevel(options.logLevel);
|
|
12381
12385
|
logger.setLogStdout(options.logStdout);
|
|
12382
|
-
logger.warn(`RCRTC Version: ${"5.1.10-enterprise.
|
|
12386
|
+
logger.warn(`RCRTC Version: ${"5.1.10-enterprise.3"}, Commit: ${"9409ef61818cd46a57e67dcba7e66eaba0dc05a6"}`);
|
|
12383
12387
|
logger.warn(`browserInfo.browser -> ${browserInfo.browser}`);
|
|
12384
12388
|
logger.warn(`browserInfo.supportsUnifiedPlan -> ${browserInfo.supportsUnifiedPlan}`);
|
|
12385
12389
|
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.1.10-enterprise.
|
|
3
|
+
"version": "5.1.10-enterprise.3",
|
|
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": "4.5.5-enterprise.1"
|
|
35
35
|
},
|
|
36
|
-
"__commit__": "
|
|
36
|
+
"__commit__": "9409ef61818cd46a57e67dcba7e66eaba0dc05a6"
|
|
37
37
|
}
|