zbzt-live-sdk 0.8.0 → 0.8.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/CHANGELOG.md CHANGED
@@ -2,6 +2,27 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ <a name="0.8.2"></a>
6
+ ## [0.8.2] (2024-07-05)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * 修复zego重新选择屏幕共享报错的问题 ([491b56e])
12
+ * 修复火山无名氏学生的问题 ([9b8c0cc])
13
+
14
+
15
+
16
+ <a name="0.8.1"></a>
17
+ ## [0.8.1] (2024-07-01)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * 修复火山重新采集屏幕流报错的问题 ([eddf895])
23
+
24
+
25
+
5
26
  <a name="0.8.0"></a>
6
27
  # [0.8.0] (2024-07-01)
7
28
 
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * zbzt-live-sdk.js v0.8.0
3
- * 2024-7-1 lanlonggang
2
+ * zbzt-live-sdk.js v0.8.2
3
+ * 2024-7-5 lanlonggang
4
4
  * Released By TAL Live.
5
5
  */
6
6
  'use strict';
@@ -16648,7 +16648,7 @@ var urls = {
16648
16648
  api: 'api.weclassroom.com',
16649
16649
  report: 's.weclassroom.com'
16650
16650
  };
16651
- var version = '0.8.0';
16651
+ var version = '0.8.2';
16652
16652
  var liveExt = {
16653
16653
  name: 'live',
16654
16654
  version: '1.0.0.0'
@@ -20109,10 +20109,21 @@ function _restartCaptureScreen() {
20109
20109
  case 4:
20110
20110
  oldStream = screenStream;
20111
20111
  screenStream = null;
20112
- // 重新创建屏幕共享流
20113
- _context32.next = 8;
20112
+ _context32.prev = 6;
20113
+ _context32.next = 9;
20114
20114
  return startScreenPreview();
20115
- case 8:
20115
+ case 9:
20116
+ _context32.next = 16;
20117
+ break;
20118
+ case 11:
20119
+ _context32.prev = 11;
20120
+ _context32.t0 = _context32["catch"](6);
20121
+ defaultApi$1.writeLog('ZEGO:: restartCaptureScreen error' + _context32.t0, null, 'error');
20122
+ if (!screenStream) {
20123
+ screenStream = oldStream;
20124
+ }
20125
+ throw _context32.t0;
20126
+ case 16:
20116
20127
  // 销毁并停止发布旧的屏幕共享流
20117
20128
  zg.destroyStream(oldStream);
20118
20129
  zg.stopPublishingStream(screenStreamId);
@@ -20126,11 +20137,11 @@ function _restartCaptureScreen() {
20126
20137
  if (screenConstraints.captureView) {
20127
20138
  screenStream.playVideo(screenConstraints.captureView);
20128
20139
  }
20129
- case 13:
20140
+ case 21:
20130
20141
  case "end":
20131
20142
  return _context32.stop();
20132
20143
  }
20133
- }, _callee32);
20144
+ }, _callee32, null, [[6, 11]]);
20134
20145
  }));
20135
20146
  return _restartCaptureScreen.apply(this, arguments);
20136
20147
  }
@@ -21541,7 +21552,7 @@ var InvalidTokenError_1 = InvalidTokenError;
21541
21552
  lib.InvalidTokenError = InvalidTokenError_1;
21542
21553
 
21543
21554
  var StaticConfig = {
21544
- agentVersion: "OmniRTC_Web_V1.1.4-peiyou.0",
21555
+ agentVersion: "OmniRTC_Web_V1.1.5-peiyou.0",
21545
21556
  logVersion: 1,
21546
21557
  serviceType: 320,
21547
21558
  logBackendUrl: "https://rtc-logs.magic-school.com/stream.gif"
@@ -32613,13 +32624,8 @@ var VolcCoreRTC = /** @class */ (function () {
32613
32624
  if (config.mode && config.mode === 'rtc') {
32614
32625
  this._engine.setUserVisibility(true);
32615
32626
  }
32616
- if (config.role) {
32617
- if (config.role === 'host') {
32618
- this._engine.setUserVisibility(true);
32619
- }
32620
- else {
32621
- this._engine.setUserVisibility(false);
32622
- }
32627
+ if (config.role && config.role === 'host') {
32628
+ this._engine.setUserVisibility(true);
32623
32629
  }
32624
32630
  if (config.clientRoleOptions) {
32625
32631
  console.log('Currently we do not support setting clientRoleOptions !');
@@ -33807,6 +33813,7 @@ var VolcCoreRTCWrapper = /** @class */ (function () {
33807
33813
  this._plan = plan;
33808
33814
  index$1.setParameter('STATS_SCALLBACK_SUPPORT', false);
33809
33815
  this._engine = index$1.createEngine(this._appId);
33816
+ this._engine.setUserVisibility(false);
33810
33817
  VolcCoreRTC$1.setEngine(this._engine);
33811
33818
  VolcCoreRTC$1.setUserInfo({
33812
33819
  appId: appId,
@@ -35054,7 +35061,8 @@ var init$1 = /*#__PURE__*/function () {
35054
35061
  accountId: args.userId,
35055
35062
  header: args.institutionId,
35056
35063
  liveId: args.live_id,
35057
- mainStream: localStreamId$1
35064
+ mainStream: localStreamId$1,
35065
+ role: args.role
35058
35066
  }));
35059
35067
  talrtc.enableLogUpload();
35060
35068
  talrtc.onAutoplayFailed = function (autoResume, kind) {
@@ -36565,7 +36573,7 @@ var restartCaptureScreen$1 = /*#__PURE__*/function () {
36565
36573
  return startScreenCapture();
36566
36574
  case 7:
36567
36575
  if (screenPreviewDomId) {
36568
- track.play(screenPreviewDomId, {
36576
+ screenTrack.play(screenPreviewDomId, {
36569
36577
  fit: 'contain'
36570
36578
  });
36571
36579
  }
@@ -37427,7 +37435,7 @@ var setPlayViewMirror$1 = function setPlayViewMirror(isMirror, id) {
37427
37435
  */
37428
37436
  var muteRemoteAudio = /*#__PURE__*/function () {
37429
37437
  var _ref43 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee43(streamId, mute) {
37430
- var _streamId$split3, _streamId$split4, roomId, userId, numberUserId, client, user, _track;
37438
+ var _streamId$split3, _streamId$split4, roomId, userId, numberUserId, client, user, track;
37431
37439
  return regenerator.wrap(function _callee43$(_context43) {
37432
37440
  while (1) switch (_context43.prev = _context43.next) {
37433
37441
  case 0:
@@ -37473,15 +37481,15 @@ var muteRemoteAudio = /*#__PURE__*/function () {
37473
37481
  _context43.next = 24;
37474
37482
  return client.subscribe(user.mainStreamId, 'audio');
37475
37483
  case 24:
37476
- _track = _context43.sent;
37477
- _track.setVolume(speakerVolume$1);
37478
- _track.once('first-frame-decoded', function () {
37484
+ track = _context43.sent;
37485
+ track.setVolume(speakerVolume$1);
37486
+ track.once('first-frame-decoded', function () {
37479
37487
  NOTICE.firstAudioSize({
37480
37488
  streamId: streamId,
37481
37489
  userId: userId
37482
37490
  });
37483
37491
  });
37484
- _track.play();
37492
+ track.play();
37485
37493
  case 28:
37486
37494
  case "end":
37487
37495
  return _context43.stop();
@@ -37501,7 +37509,7 @@ var muteRemoteAudio = /*#__PURE__*/function () {
37501
37509
  */
37502
37510
  var muteRemoteVideo = /*#__PURE__*/function () {
37503
37511
  var _ref44 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee44(streamId, mute) {
37504
- var _streamId$split5, _streamId$split6, roomId, userId, numberUserId, client, user, _track2;
37512
+ var _streamId$split5, _streamId$split6, roomId, userId, numberUserId, client, user, track;
37505
37513
  return regenerator.wrap(function _callee44$(_context44) {
37506
37514
  while (1) switch (_context44.prev = _context44.next) {
37507
37515
  case 0:
@@ -37548,15 +37556,15 @@ var muteRemoteVideo = /*#__PURE__*/function () {
37548
37556
  _context44.next = 25;
37549
37557
  return client.subscribe(user.mainStreamId, 'video');
37550
37558
  case 25:
37551
- _track2 = _context44.sent;
37552
- _track2.once('first-frame-decoded', function () {
37559
+ track = _context44.sent;
37560
+ track.once('first-frame-decoded', function () {
37553
37561
  NOTICE.firstVideoSize({
37554
37562
  streamId: streamId,
37555
37563
  userId: userId
37556
37564
  });
37557
37565
  });
37558
37566
  if (user.videoDomId) {
37559
- _track2.play(user.videoDomId, {
37567
+ track.play(user.videoDomId, {
37560
37568
  fit: 'contain'
37561
37569
  });
37562
37570
  }
@@ -37579,7 +37587,7 @@ var muteRemoteVideo = /*#__PURE__*/function () {
37579
37587
  */
37580
37588
  var muteRemoteScreenAudio = /*#__PURE__*/function () {
37581
37589
  var _ref45 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee45(streamId, mute) {
37582
- var _streamId$split7, _streamId$split8, roomId, userId, numberUserId, client, user, _track3;
37590
+ var _streamId$split7, _streamId$split8, roomId, userId, numberUserId, client, user, track;
37583
37591
  return regenerator.wrap(function _callee45$(_context45) {
37584
37592
  while (1) switch (_context45.prev = _context45.next) {
37585
37593
  case 0:
@@ -37625,15 +37633,15 @@ var muteRemoteScreenAudio = /*#__PURE__*/function () {
37625
37633
  _context45.next = 24;
37626
37634
  return client.subscribe(user.screenStreamId, 'audio');
37627
37635
  case 24:
37628
- _track3 = _context45.sent;
37629
- _track3.setVolume(speakerVolume$1);
37630
- _track3.once('first-frame-decoded', function () {
37636
+ track = _context45.sent;
37637
+ track.setVolume(speakerVolume$1);
37638
+ track.once('first-frame-decoded', function () {
37631
37639
  NOTICE.firstAudioSize({
37632
37640
  streamId: streamId,
37633
37641
  userId: userId
37634
37642
  });
37635
37643
  });
37636
- _track3.play();
37644
+ track.play();
37637
37645
  case 28:
37638
37646
  case "end":
37639
37647
  return _context45.stop();
@@ -37652,7 +37660,7 @@ var muteRemoteScreenAudio = /*#__PURE__*/function () {
37652
37660
  */
37653
37661
  var muteRemoteScreenVideo = /*#__PURE__*/function () {
37654
37662
  var _ref46 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee46(streamId, mute) {
37655
- var _streamId$split9, _streamId$split10, roomId, userId, numberUserId, client, user, _track4;
37663
+ var _streamId$split9, _streamId$split10, roomId, userId, numberUserId, client, user, track;
37656
37664
  return regenerator.wrap(function _callee46$(_context46) {
37657
37665
  while (1) switch (_context46.prev = _context46.next) {
37658
37666
  case 0:
@@ -37699,15 +37707,15 @@ var muteRemoteScreenVideo = /*#__PURE__*/function () {
37699
37707
  _context46.next = 25;
37700
37708
  return client.subscribe(user.screenStreamId, 'video');
37701
37709
  case 25:
37702
- _track4 = _context46.sent;
37703
- _track4.once('first-frame-decoded', function () {
37710
+ track = _context46.sent;
37711
+ track.once('first-frame-decoded', function () {
37704
37712
  NOTICE.firstVideoSize({
37705
37713
  streamId: streamId,
37706
37714
  userId: userId
37707
37715
  });
37708
37716
  });
37709
37717
  if (user.screenDomId) {
37710
- _track4.play(user.screenDomId, {
37718
+ track.play(user.screenDomId, {
37711
37719
  fit: 'contain'
37712
37720
  });
37713
37721
  }
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * zbzt-live-sdk.js v0.8.0
3
- * 2024-7-1 lanlonggang
2
+ * zbzt-live-sdk.js v0.8.2
3
+ * 2024-7-5 lanlonggang
4
4
  * Released By TAL Live.
5
5
  */
6
6
  import axios$2 from 'axios';
@@ -16642,7 +16642,7 @@ var urls = {
16642
16642
  api: 'api.weclassroom.com',
16643
16643
  report: 's.weclassroom.com'
16644
16644
  };
16645
- var version = '0.8.0';
16645
+ var version = '0.8.2';
16646
16646
  var liveExt = {
16647
16647
  name: 'live',
16648
16648
  version: '1.0.0.0'
@@ -20103,10 +20103,21 @@ function _restartCaptureScreen() {
20103
20103
  case 4:
20104
20104
  oldStream = screenStream;
20105
20105
  screenStream = null;
20106
- // 重新创建屏幕共享流
20107
- _context32.next = 8;
20106
+ _context32.prev = 6;
20107
+ _context32.next = 9;
20108
20108
  return startScreenPreview();
20109
- case 8:
20109
+ case 9:
20110
+ _context32.next = 16;
20111
+ break;
20112
+ case 11:
20113
+ _context32.prev = 11;
20114
+ _context32.t0 = _context32["catch"](6);
20115
+ defaultApi$1.writeLog('ZEGO:: restartCaptureScreen error' + _context32.t0, null, 'error');
20116
+ if (!screenStream) {
20117
+ screenStream = oldStream;
20118
+ }
20119
+ throw _context32.t0;
20120
+ case 16:
20110
20121
  // 销毁并停止发布旧的屏幕共享流
20111
20122
  zg.destroyStream(oldStream);
20112
20123
  zg.stopPublishingStream(screenStreamId);
@@ -20120,11 +20131,11 @@ function _restartCaptureScreen() {
20120
20131
  if (screenConstraints.captureView) {
20121
20132
  screenStream.playVideo(screenConstraints.captureView);
20122
20133
  }
20123
- case 13:
20134
+ case 21:
20124
20135
  case "end":
20125
20136
  return _context32.stop();
20126
20137
  }
20127
- }, _callee32);
20138
+ }, _callee32, null, [[6, 11]]);
20128
20139
  }));
20129
20140
  return _restartCaptureScreen.apply(this, arguments);
20130
20141
  }
@@ -21535,7 +21546,7 @@ var InvalidTokenError_1 = InvalidTokenError;
21535
21546
  lib.InvalidTokenError = InvalidTokenError_1;
21536
21547
 
21537
21548
  var StaticConfig = {
21538
- agentVersion: "OmniRTC_Web_V1.1.4-peiyou.0",
21549
+ agentVersion: "OmniRTC_Web_V1.1.5-peiyou.0",
21539
21550
  logVersion: 1,
21540
21551
  serviceType: 320,
21541
21552
  logBackendUrl: "https://rtc-logs.magic-school.com/stream.gif"
@@ -32607,13 +32618,8 @@ var VolcCoreRTC = /** @class */ (function () {
32607
32618
  if (config.mode && config.mode === 'rtc') {
32608
32619
  this._engine.setUserVisibility(true);
32609
32620
  }
32610
- if (config.role) {
32611
- if (config.role === 'host') {
32612
- this._engine.setUserVisibility(true);
32613
- }
32614
- else {
32615
- this._engine.setUserVisibility(false);
32616
- }
32621
+ if (config.role && config.role === 'host') {
32622
+ this._engine.setUserVisibility(true);
32617
32623
  }
32618
32624
  if (config.clientRoleOptions) {
32619
32625
  console.log('Currently we do not support setting clientRoleOptions !');
@@ -33801,6 +33807,7 @@ var VolcCoreRTCWrapper = /** @class */ (function () {
33801
33807
  this._plan = plan;
33802
33808
  index$1.setParameter('STATS_SCALLBACK_SUPPORT', false);
33803
33809
  this._engine = index$1.createEngine(this._appId);
33810
+ this._engine.setUserVisibility(false);
33804
33811
  VolcCoreRTC$1.setEngine(this._engine);
33805
33812
  VolcCoreRTC$1.setUserInfo({
33806
33813
  appId: appId,
@@ -35048,7 +35055,8 @@ var init$1 = /*#__PURE__*/function () {
35048
35055
  accountId: args.userId,
35049
35056
  header: args.institutionId,
35050
35057
  liveId: args.live_id,
35051
- mainStream: localStreamId$1
35058
+ mainStream: localStreamId$1,
35059
+ role: args.role
35052
35060
  }));
35053
35061
  talrtc.enableLogUpload();
35054
35062
  talrtc.onAutoplayFailed = function (autoResume, kind) {
@@ -36559,7 +36567,7 @@ var restartCaptureScreen$1 = /*#__PURE__*/function () {
36559
36567
  return startScreenCapture();
36560
36568
  case 7:
36561
36569
  if (screenPreviewDomId) {
36562
- track.play(screenPreviewDomId, {
36570
+ screenTrack.play(screenPreviewDomId, {
36563
36571
  fit: 'contain'
36564
36572
  });
36565
36573
  }
@@ -37421,7 +37429,7 @@ var setPlayViewMirror$1 = function setPlayViewMirror(isMirror, id) {
37421
37429
  */
37422
37430
  var muteRemoteAudio = /*#__PURE__*/function () {
37423
37431
  var _ref43 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee43(streamId, mute) {
37424
- var _streamId$split3, _streamId$split4, roomId, userId, numberUserId, client, user, _track;
37432
+ var _streamId$split3, _streamId$split4, roomId, userId, numberUserId, client, user, track;
37425
37433
  return regenerator.wrap(function _callee43$(_context43) {
37426
37434
  while (1) switch (_context43.prev = _context43.next) {
37427
37435
  case 0:
@@ -37467,15 +37475,15 @@ var muteRemoteAudio = /*#__PURE__*/function () {
37467
37475
  _context43.next = 24;
37468
37476
  return client.subscribe(user.mainStreamId, 'audio');
37469
37477
  case 24:
37470
- _track = _context43.sent;
37471
- _track.setVolume(speakerVolume$1);
37472
- _track.once('first-frame-decoded', function () {
37478
+ track = _context43.sent;
37479
+ track.setVolume(speakerVolume$1);
37480
+ track.once('first-frame-decoded', function () {
37473
37481
  NOTICE.firstAudioSize({
37474
37482
  streamId: streamId,
37475
37483
  userId: userId
37476
37484
  });
37477
37485
  });
37478
- _track.play();
37486
+ track.play();
37479
37487
  case 28:
37480
37488
  case "end":
37481
37489
  return _context43.stop();
@@ -37495,7 +37503,7 @@ var muteRemoteAudio = /*#__PURE__*/function () {
37495
37503
  */
37496
37504
  var muteRemoteVideo = /*#__PURE__*/function () {
37497
37505
  var _ref44 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee44(streamId, mute) {
37498
- var _streamId$split5, _streamId$split6, roomId, userId, numberUserId, client, user, _track2;
37506
+ var _streamId$split5, _streamId$split6, roomId, userId, numberUserId, client, user, track;
37499
37507
  return regenerator.wrap(function _callee44$(_context44) {
37500
37508
  while (1) switch (_context44.prev = _context44.next) {
37501
37509
  case 0:
@@ -37542,15 +37550,15 @@ var muteRemoteVideo = /*#__PURE__*/function () {
37542
37550
  _context44.next = 25;
37543
37551
  return client.subscribe(user.mainStreamId, 'video');
37544
37552
  case 25:
37545
- _track2 = _context44.sent;
37546
- _track2.once('first-frame-decoded', function () {
37553
+ track = _context44.sent;
37554
+ track.once('first-frame-decoded', function () {
37547
37555
  NOTICE.firstVideoSize({
37548
37556
  streamId: streamId,
37549
37557
  userId: userId
37550
37558
  });
37551
37559
  });
37552
37560
  if (user.videoDomId) {
37553
- _track2.play(user.videoDomId, {
37561
+ track.play(user.videoDomId, {
37554
37562
  fit: 'contain'
37555
37563
  });
37556
37564
  }
@@ -37573,7 +37581,7 @@ var muteRemoteVideo = /*#__PURE__*/function () {
37573
37581
  */
37574
37582
  var muteRemoteScreenAudio = /*#__PURE__*/function () {
37575
37583
  var _ref45 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee45(streamId, mute) {
37576
- var _streamId$split7, _streamId$split8, roomId, userId, numberUserId, client, user, _track3;
37584
+ var _streamId$split7, _streamId$split8, roomId, userId, numberUserId, client, user, track;
37577
37585
  return regenerator.wrap(function _callee45$(_context45) {
37578
37586
  while (1) switch (_context45.prev = _context45.next) {
37579
37587
  case 0:
@@ -37619,15 +37627,15 @@ var muteRemoteScreenAudio = /*#__PURE__*/function () {
37619
37627
  _context45.next = 24;
37620
37628
  return client.subscribe(user.screenStreamId, 'audio');
37621
37629
  case 24:
37622
- _track3 = _context45.sent;
37623
- _track3.setVolume(speakerVolume$1);
37624
- _track3.once('first-frame-decoded', function () {
37630
+ track = _context45.sent;
37631
+ track.setVolume(speakerVolume$1);
37632
+ track.once('first-frame-decoded', function () {
37625
37633
  NOTICE.firstAudioSize({
37626
37634
  streamId: streamId,
37627
37635
  userId: userId
37628
37636
  });
37629
37637
  });
37630
- _track3.play();
37638
+ track.play();
37631
37639
  case 28:
37632
37640
  case "end":
37633
37641
  return _context45.stop();
@@ -37646,7 +37654,7 @@ var muteRemoteScreenAudio = /*#__PURE__*/function () {
37646
37654
  */
37647
37655
  var muteRemoteScreenVideo = /*#__PURE__*/function () {
37648
37656
  var _ref46 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee46(streamId, mute) {
37649
- var _streamId$split9, _streamId$split10, roomId, userId, numberUserId, client, user, _track4;
37657
+ var _streamId$split9, _streamId$split10, roomId, userId, numberUserId, client, user, track;
37650
37658
  return regenerator.wrap(function _callee46$(_context46) {
37651
37659
  while (1) switch (_context46.prev = _context46.next) {
37652
37660
  case 0:
@@ -37693,15 +37701,15 @@ var muteRemoteScreenVideo = /*#__PURE__*/function () {
37693
37701
  _context46.next = 25;
37694
37702
  return client.subscribe(user.screenStreamId, 'video');
37695
37703
  case 25:
37696
- _track4 = _context46.sent;
37697
- _track4.once('first-frame-decoded', function () {
37704
+ track = _context46.sent;
37705
+ track.once('first-frame-decoded', function () {
37698
37706
  NOTICE.firstVideoSize({
37699
37707
  streamId: streamId,
37700
37708
  userId: userId
37701
37709
  });
37702
37710
  });
37703
37711
  if (user.screenDomId) {
37704
- _track4.play(user.screenDomId, {
37712
+ track.play(user.screenDomId, {
37705
37713
  fit: 'contain'
37706
37714
  });
37707
37715
  }