@tencentcloud/trtc-cloud-wx 0.0.9 → 0.0.11
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/trtc-cloud-wx.js +91 -16
package/package.json
CHANGED
package/trtc-cloud-wx.js
CHANGED
|
@@ -700,9 +700,10 @@ var aegis = new Aegis({
|
|
|
700
700
|
var LOGLEVEL = {
|
|
701
701
|
LOG: 0,
|
|
702
702
|
INFO: 1,
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
703
|
+
DEBUG: 2,
|
|
704
|
+
WARN: 3,
|
|
705
|
+
ERROR: 4,
|
|
706
|
+
NON_LOGGING: 5 // 无日志记录级别,sdk将不打印任何日志
|
|
706
707
|
};
|
|
707
708
|
|
|
708
709
|
var Logger = /*#__PURE__*/function () {
|
|
@@ -715,6 +716,7 @@ var Logger = /*#__PURE__*/function () {
|
|
|
715
716
|
_createClass(Logger, [{
|
|
716
717
|
key: "loggerInfo",
|
|
717
718
|
value: function loggerInfo() {
|
|
719
|
+
if (Number(this.sdkAppId) !== 1400188366 && Number(this.sdkAppId) !== 1400704311) return;
|
|
718
720
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
719
721
|
args[_key] = arguments[_key];
|
|
720
722
|
}
|
|
@@ -793,13 +795,26 @@ var Logger = /*#__PURE__*/function () {
|
|
|
793
795
|
this.loggerInfo.apply(this, [this.TAG_NAME, formatTime()].concat(args));
|
|
794
796
|
}
|
|
795
797
|
}
|
|
798
|
+
}, {
|
|
799
|
+
key: "debug",
|
|
800
|
+
value: function debug() {
|
|
801
|
+
// 状态机内部错误信息
|
|
802
|
+
if (this.logLevel <= LOGLEVEL.DEBUG) {
|
|
803
|
+
var _console5;
|
|
804
|
+
for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
|
|
805
|
+
args[_key6] = arguments[_key6];
|
|
806
|
+
}
|
|
807
|
+
(_console5 = console).debug.apply(_console5, [this.TAG_NAME, formatTime()].concat(args));
|
|
808
|
+
this.loggerInfo.apply(this, [this.TAG_NAME, formatTime()].concat(args));
|
|
809
|
+
}
|
|
810
|
+
}
|
|
796
811
|
}]);
|
|
797
812
|
return Logger;
|
|
798
813
|
}();
|
|
799
814
|
var logger = new Logger();
|
|
800
815
|
|
|
801
816
|
var name = "@tencentcloud/trtc-cloud-wx";
|
|
802
|
-
var version = "0.0.
|
|
817
|
+
var version = "0.0.10";
|
|
803
818
|
var description = "";
|
|
804
819
|
var main = "dist/trtc-cloud-wx.js";
|
|
805
820
|
var module$1 = "dist/trtc-cloud-wx.js";
|
|
@@ -1155,12 +1170,17 @@ var TRTCCloud = /*#__PURE__*/function () {
|
|
|
1155
1170
|
callback: function callback() {
|
|
1156
1171
|
_this5.trtc.getPusherInstance().start({
|
|
1157
1172
|
success: function success() {
|
|
1173
|
+
logger.info('enterRoom success');
|
|
1158
1174
|
_this5.scene = scene;
|
|
1159
1175
|
_this5.isEnterRoom = true;
|
|
1160
1176
|
var endTime = new Date().getTime();
|
|
1161
1177
|
_this5.emit('onEnterRoom', endTime - startTime);
|
|
1178
|
+
if (_this5.trtc.getPusherAttributes().enableCamera === true) {
|
|
1179
|
+
_this5.emit('onSendFirstLocalVideoFrame', exports.TRTCVideoStreamType.TRTCVideoStreamTypeBig);
|
|
1180
|
+
}
|
|
1162
1181
|
},
|
|
1163
1182
|
fail: function fail() {
|
|
1183
|
+
logger.info('enterRoom fail');
|
|
1164
1184
|
_this5.emit('onEnterRoom', -1);
|
|
1165
1185
|
}
|
|
1166
1186
|
});
|
|
@@ -1180,6 +1200,7 @@ var TRTCCloud = /*#__PURE__*/function () {
|
|
|
1180
1200
|
this.InterfaceEventEmitter.emit('pusherAttributesChange', {
|
|
1181
1201
|
pusher: pusher,
|
|
1182
1202
|
callback: function callback() {
|
|
1203
|
+
logger.info('exitRoom success');
|
|
1183
1204
|
_this6.reset();
|
|
1184
1205
|
_this6.emit('onExitRoom', 0);
|
|
1185
1206
|
}
|
|
@@ -1213,6 +1234,7 @@ var TRTCCloud = /*#__PURE__*/function () {
|
|
|
1213
1234
|
this.InterfaceEventEmitter.emit('pusherAttributesChange', {
|
|
1214
1235
|
pusher: pusher,
|
|
1215
1236
|
callback: function callback() {
|
|
1237
|
+
logger.info('switchRole success');
|
|
1216
1238
|
_this7.emit('onSwitchRole', 0, '');
|
|
1217
1239
|
}
|
|
1218
1240
|
});
|
|
@@ -1253,13 +1275,14 @@ var TRTCCloud = /*#__PURE__*/function () {
|
|
|
1253
1275
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
1254
1276
|
while (1) switch (_context.prev = _context.next) {
|
|
1255
1277
|
case 0:
|
|
1278
|
+
logger.info('startLocalPreview success');
|
|
1256
1279
|
this.emit('onFirstVideoFrame', '', exports.TRTCVideoStreamType.TRTCVideoStreamTypeBig, pusher.videoWidth, pusher.videoHeight);
|
|
1257
1280
|
if (this.isEnterRoom) {
|
|
1258
1281
|
this.emit('onSendFirstLocalVideoFrame', exports.TRTCVideoStreamType.TRTCVideoStreamTypeBig);
|
|
1259
1282
|
}
|
|
1260
1283
|
resolve(null);
|
|
1261
1284
|
this.isOpenCamera = true;
|
|
1262
|
-
case
|
|
1285
|
+
case 5:
|
|
1263
1286
|
case "end":
|
|
1264
1287
|
return _context.stop();
|
|
1265
1288
|
}
|
|
@@ -1285,6 +1308,7 @@ var TRTCCloud = /*#__PURE__*/function () {
|
|
|
1285
1308
|
this.InterfaceEventEmitter.emit('pusherAttributesChange', {
|
|
1286
1309
|
pusher: pusher,
|
|
1287
1310
|
callback: function callback() {
|
|
1311
|
+
logger.info('stopLocalPreview success');
|
|
1288
1312
|
_this9.isOpenCamera = false;
|
|
1289
1313
|
_this9.emit('onUserVideoAvailable', _this9.userId, 0);
|
|
1290
1314
|
}
|
|
@@ -1332,6 +1356,7 @@ var TRTCCloud = /*#__PURE__*/function () {
|
|
|
1332
1356
|
_this10.InterfaceEventEmitter.emit('pusherAttributesChange', {
|
|
1333
1357
|
pusher: pusher,
|
|
1334
1358
|
callback: function callback() {
|
|
1359
|
+
logger.info('muteLocalVideo success');
|
|
1335
1360
|
resolve(null);
|
|
1336
1361
|
}
|
|
1337
1362
|
});
|
|
@@ -1364,6 +1389,7 @@ var TRTCCloud = /*#__PURE__*/function () {
|
|
|
1364
1389
|
view: this.renderMap.get(streamId),
|
|
1365
1390
|
playerAttributes: playerAttributes,
|
|
1366
1391
|
callback: function callback() {
|
|
1392
|
+
logger.info('startRemoteView success');
|
|
1367
1393
|
_this11.emit('onFirstVideoFrame', userId, streamType, 0, 0);
|
|
1368
1394
|
}
|
|
1369
1395
|
});
|
|
@@ -1385,7 +1411,10 @@ var TRTCCloud = /*#__PURE__*/function () {
|
|
|
1385
1411
|
this.InterfaceEventEmitter.emit('playerAttributesChange', {
|
|
1386
1412
|
streamId: streamId,
|
|
1387
1413
|
view: this.renderMap.get(streamId),
|
|
1388
|
-
playerAttributes: playerAttributes
|
|
1414
|
+
playerAttributes: playerAttributes,
|
|
1415
|
+
callback: function callback() {
|
|
1416
|
+
logger.info('stopRemoteView success');
|
|
1417
|
+
}
|
|
1389
1418
|
});
|
|
1390
1419
|
}
|
|
1391
1420
|
/**
|
|
@@ -1423,7 +1452,10 @@ var TRTCCloud = /*#__PURE__*/function () {
|
|
|
1423
1452
|
_this12.InterfaceEventEmitter.emit('playerAttributesChange', {
|
|
1424
1453
|
streamId: streamId,
|
|
1425
1454
|
view: _this12.renderMap.get(streamId),
|
|
1426
|
-
playerAttributes: playerAttributes
|
|
1455
|
+
playerAttributes: playerAttributes,
|
|
1456
|
+
callback: function callback() {
|
|
1457
|
+
logger.info('stopAllRemoteView success');
|
|
1458
|
+
}
|
|
1427
1459
|
});
|
|
1428
1460
|
});
|
|
1429
1461
|
}
|
|
@@ -1440,7 +1472,10 @@ var TRTCCloud = /*#__PURE__*/function () {
|
|
|
1440
1472
|
this.InterfaceEventEmitter.emit('playerAttributesChange', {
|
|
1441
1473
|
streamId: streamId,
|
|
1442
1474
|
view: this.renderMap.get(streamId),
|
|
1443
|
-
playerAttributes: playerAttributes
|
|
1475
|
+
playerAttributes: playerAttributes,
|
|
1476
|
+
callback: function callback() {
|
|
1477
|
+
logger.info('muteRemoteVideoStream success');
|
|
1478
|
+
}
|
|
1444
1479
|
});
|
|
1445
1480
|
}
|
|
1446
1481
|
}, {
|
|
@@ -1457,7 +1492,10 @@ var TRTCCloud = /*#__PURE__*/function () {
|
|
|
1457
1492
|
_this13.InterfaceEventEmitter.emit('playerAttributesChange', {
|
|
1458
1493
|
streamId: streamId,
|
|
1459
1494
|
view: _this13.renderMap.get(streamId),
|
|
1460
|
-
playerAttributes: playerAttributes
|
|
1495
|
+
playerAttributes: playerAttributes,
|
|
1496
|
+
callback: function callback() {
|
|
1497
|
+
logger.info('muteAllRemoteVideoStreams success');
|
|
1498
|
+
}
|
|
1461
1499
|
});
|
|
1462
1500
|
});
|
|
1463
1501
|
}
|
|
@@ -1491,7 +1529,10 @@ var TRTCCloud = /*#__PURE__*/function () {
|
|
|
1491
1529
|
minBitrate: minVideoBitrate
|
|
1492
1530
|
});
|
|
1493
1531
|
this.InterfaceEventEmitter.emit('pusherAttributesChange', {
|
|
1494
|
-
pusher: pusher
|
|
1532
|
+
pusher: pusher,
|
|
1533
|
+
callback: function callback() {
|
|
1534
|
+
logger.info('setVideoEncoderParam success');
|
|
1535
|
+
}
|
|
1495
1536
|
});
|
|
1496
1537
|
}
|
|
1497
1538
|
}, {
|
|
@@ -1508,7 +1549,10 @@ var TRTCCloud = /*#__PURE__*/function () {
|
|
|
1508
1549
|
localMirror: localMirror
|
|
1509
1550
|
});
|
|
1510
1551
|
this.InterfaceEventEmitter.emit('pusherAttributesChange', {
|
|
1511
|
-
pusher: pusher
|
|
1552
|
+
pusher: pusher,
|
|
1553
|
+
callback: function callback() {
|
|
1554
|
+
logger.info('setLocalRenderParams success');
|
|
1555
|
+
}
|
|
1512
1556
|
});
|
|
1513
1557
|
}
|
|
1514
1558
|
/**
|
|
@@ -1532,7 +1576,10 @@ var TRTCCloud = /*#__PURE__*/function () {
|
|
|
1532
1576
|
this.InterfaceEventEmitter.emit('playerAttributesChange', {
|
|
1533
1577
|
streamId: streamId,
|
|
1534
1578
|
view: this.renderMap.get(streamId),
|
|
1535
|
-
playerAttributes: playerAttributes
|
|
1579
|
+
playerAttributes: playerAttributes,
|
|
1580
|
+
callback: function callback() {
|
|
1581
|
+
logger.info('setRemoteRenderParams success');
|
|
1582
|
+
}
|
|
1536
1583
|
});
|
|
1537
1584
|
}
|
|
1538
1585
|
}, {
|
|
@@ -1546,6 +1593,7 @@ var TRTCCloud = /*#__PURE__*/function () {
|
|
|
1546
1593
|
this.InterfaceEventEmitter.emit('pusherAttributesChange', {
|
|
1547
1594
|
pusher: pusher,
|
|
1548
1595
|
callback: function callback() {
|
|
1596
|
+
logger.info('startLocalAudio success');
|
|
1549
1597
|
_this14.emit('onMicDidReady');
|
|
1550
1598
|
_this14.emit('onUserAudioAvailable', _this14.userId, 1);
|
|
1551
1599
|
if (_this14.enterRoom) {
|
|
@@ -1565,6 +1613,7 @@ var TRTCCloud = /*#__PURE__*/function () {
|
|
|
1565
1613
|
this.InterfaceEventEmitter.emit('pusherAttributesChange', {
|
|
1566
1614
|
pusher: pusher,
|
|
1567
1615
|
callback: function callback() {
|
|
1616
|
+
logger.info('stopLocalAudio success');
|
|
1568
1617
|
_this15.emit('onUserAudioAvailable', _this15.userId, 0);
|
|
1569
1618
|
}
|
|
1570
1619
|
});
|
|
@@ -1580,6 +1629,7 @@ var TRTCCloud = /*#__PURE__*/function () {
|
|
|
1580
1629
|
this.InterfaceEventEmitter.emit('pusherAttributesChange', {
|
|
1581
1630
|
pusher: pusher,
|
|
1582
1631
|
callback: function callback() {
|
|
1632
|
+
logger.info('muteLocalAudio success');
|
|
1583
1633
|
_this16.emit('onUserAudioAvailable', _this16.userId, mute === true ? 0 : 1);
|
|
1584
1634
|
}
|
|
1585
1635
|
});
|
|
@@ -1595,7 +1645,10 @@ var TRTCCloud = /*#__PURE__*/function () {
|
|
|
1595
1645
|
this.InterfaceEventEmitter.emit('playerAttributesChange', {
|
|
1596
1646
|
streamId: streamId,
|
|
1597
1647
|
view: this.renderMap.get(streamId),
|
|
1598
|
-
playerAttributes: playerAttributes
|
|
1648
|
+
playerAttributes: playerAttributes,
|
|
1649
|
+
callback: function callback() {
|
|
1650
|
+
logger.info('muteRemoteAudio success');
|
|
1651
|
+
}
|
|
1599
1652
|
});
|
|
1600
1653
|
}
|
|
1601
1654
|
}, {
|
|
@@ -1612,7 +1665,10 @@ var TRTCCloud = /*#__PURE__*/function () {
|
|
|
1612
1665
|
_this17.InterfaceEventEmitter.emit('playerAttributesChange', {
|
|
1613
1666
|
streamId: streamId,
|
|
1614
1667
|
view: _this17.renderMap.get(streamId),
|
|
1615
|
-
playerAttributes: playerAttributes
|
|
1668
|
+
playerAttributes: playerAttributes,
|
|
1669
|
+
callback: function callback() {
|
|
1670
|
+
logger.info('muteAllRemoteAudio success');
|
|
1671
|
+
}
|
|
1616
1672
|
});
|
|
1617
1673
|
});
|
|
1618
1674
|
}
|
|
@@ -1639,11 +1695,15 @@ var TRTCCloud = /*#__PURE__*/function () {
|
|
|
1639
1695
|
frontCamera: true
|
|
1640
1696
|
});
|
|
1641
1697
|
_this18.InterfaceEventEmitter.emit('pusherAttributesChange', {
|
|
1642
|
-
pusher: pusher
|
|
1698
|
+
pusher: pusher,
|
|
1699
|
+
callback: function callback() {
|
|
1700
|
+
logger.info('switchCamera success');
|
|
1701
|
+
}
|
|
1643
1702
|
});
|
|
1644
1703
|
resolve(event);
|
|
1645
1704
|
},
|
|
1646
1705
|
fail: function fail(error) {
|
|
1706
|
+
logger.info('switchCamera fail');
|
|
1647
1707
|
reject(error);
|
|
1648
1708
|
}
|
|
1649
1709
|
});
|
|
@@ -1659,7 +1719,10 @@ var TRTCCloud = /*#__PURE__*/function () {
|
|
|
1659
1719
|
whitenessLevel: white
|
|
1660
1720
|
});
|
|
1661
1721
|
this.InterfaceEventEmitter.emit('pusherAttributesChange', {
|
|
1662
|
-
pusher: pusher
|
|
1722
|
+
pusher: pusher,
|
|
1723
|
+
callback: function callback() {
|
|
1724
|
+
logger.info('setBeautyStyle success');
|
|
1725
|
+
}
|
|
1663
1726
|
});
|
|
1664
1727
|
}
|
|
1665
1728
|
}, {
|
|
@@ -1671,9 +1734,11 @@ var TRTCCloud = /*#__PURE__*/function () {
|
|
|
1671
1734
|
wx.createLivePusherContext().sendMessage({
|
|
1672
1735
|
msg: msg,
|
|
1673
1736
|
success: function success(event) {
|
|
1737
|
+
logger.info('sendSEIMsg success');
|
|
1674
1738
|
resolve(event);
|
|
1675
1739
|
},
|
|
1676
1740
|
fail: function fail(error) {
|
|
1741
|
+
logger.info('sendSEIMsg fail');
|
|
1677
1742
|
reject(error);
|
|
1678
1743
|
}
|
|
1679
1744
|
});
|
|
@@ -1694,9 +1759,11 @@ var TRTCCloud = /*#__PURE__*/function () {
|
|
|
1694
1759
|
startTimeMs: startTimeMS,
|
|
1695
1760
|
endTimeMs: endTimeMS,
|
|
1696
1761
|
success: function success(event) {
|
|
1762
|
+
logger.info('startPlayMusic success');
|
|
1697
1763
|
resolve(event);
|
|
1698
1764
|
},
|
|
1699
1765
|
fail: function fail(error) {
|
|
1766
|
+
logger.info('startPlayMusic fail');
|
|
1700
1767
|
reject(error);
|
|
1701
1768
|
}
|
|
1702
1769
|
});
|
|
@@ -1709,9 +1776,11 @@ var TRTCCloud = /*#__PURE__*/function () {
|
|
|
1709
1776
|
return new Promise(function (resolve, reject) {
|
|
1710
1777
|
wx.createLivePusherContext().stopBGM({
|
|
1711
1778
|
success: function success(event) {
|
|
1779
|
+
logger.info('stopPlayMusic success');
|
|
1712
1780
|
resolve(event);
|
|
1713
1781
|
},
|
|
1714
1782
|
fail: function fail(error) {
|
|
1783
|
+
logger.info('stopPlayMusic fail');
|
|
1715
1784
|
reject(error);
|
|
1716
1785
|
}
|
|
1717
1786
|
});
|
|
@@ -1724,9 +1793,11 @@ var TRTCCloud = /*#__PURE__*/function () {
|
|
|
1724
1793
|
return new Promise(function (resolve, reject) {
|
|
1725
1794
|
wx.createLivePusherContext().pauseBGM({
|
|
1726
1795
|
success: function success(event) {
|
|
1796
|
+
logger.info('pausePlayMusic success');
|
|
1727
1797
|
resolve(event);
|
|
1728
1798
|
},
|
|
1729
1799
|
fail: function fail(error) {
|
|
1800
|
+
logger.info('pausePlayMusic fail');
|
|
1730
1801
|
reject(error);
|
|
1731
1802
|
}
|
|
1732
1803
|
});
|
|
@@ -1739,9 +1810,11 @@ var TRTCCloud = /*#__PURE__*/function () {
|
|
|
1739
1810
|
return new Promise(function (resolve, reject) {
|
|
1740
1811
|
wx.createLivePusherContext().resumeBGM({
|
|
1741
1812
|
success: function success(event) {
|
|
1813
|
+
logger.info('resumePlayMusic success');
|
|
1742
1814
|
resolve(event);
|
|
1743
1815
|
},
|
|
1744
1816
|
fail: function fail(error) {
|
|
1817
|
+
logger.info('resumePlayMusic fail');
|
|
1745
1818
|
reject(error);
|
|
1746
1819
|
}
|
|
1747
1820
|
});
|
|
@@ -1757,9 +1830,11 @@ var TRTCCloud = /*#__PURE__*/function () {
|
|
|
1757
1830
|
wx.createLivePusherContext().setBGMVolume({
|
|
1758
1831
|
volume: volumeStr,
|
|
1759
1832
|
success: function success(event) {
|
|
1833
|
+
logger.info('setAllMusicVolume success');
|
|
1760
1834
|
resolve(event);
|
|
1761
1835
|
},
|
|
1762
1836
|
fail: function fail(error) {
|
|
1837
|
+
logger.info('setAllMusicVolume fail');
|
|
1763
1838
|
reject(error);
|
|
1764
1839
|
}
|
|
1765
1840
|
});
|