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.
@@ -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
  (function (global, factory) {
@@ -18331,7 +18331,7 @@
18331
18331
  api: 'api.weclassroom.com',
18332
18332
  report: 's.weclassroom.com'
18333
18333
  };
18334
- var version = '0.8.0';
18334
+ var version = '0.8.2';
18335
18335
  var liveExt = {
18336
18336
  name: 'live',
18337
18337
  version: '1.0.0.0'
@@ -21792,10 +21792,21 @@
21792
21792
  case 4:
21793
21793
  oldStream = screenStream;
21794
21794
  screenStream = null;
21795
- // 重新创建屏幕共享流
21796
- _context32.next = 8;
21795
+ _context32.prev = 6;
21796
+ _context32.next = 9;
21797
21797
  return startScreenPreview();
21798
- case 8:
21798
+ case 9:
21799
+ _context32.next = 16;
21800
+ break;
21801
+ case 11:
21802
+ _context32.prev = 11;
21803
+ _context32.t0 = _context32["catch"](6);
21804
+ defaultApi$1.writeLog('ZEGO:: restartCaptureScreen error' + _context32.t0, null, 'error');
21805
+ if (!screenStream) {
21806
+ screenStream = oldStream;
21807
+ }
21808
+ throw _context32.t0;
21809
+ case 16:
21799
21810
  // 销毁并停止发布旧的屏幕共享流
21800
21811
  zg.destroyStream(oldStream);
21801
21812
  zg.stopPublishingStream(screenStreamId);
@@ -21809,11 +21820,11 @@
21809
21820
  if (screenConstraints.captureView) {
21810
21821
  screenStream.playVideo(screenConstraints.captureView);
21811
21822
  }
21812
- case 13:
21823
+ case 21:
21813
21824
  case "end":
21814
21825
  return _context32.stop();
21815
21826
  }
21816
- }, _callee32);
21827
+ }, _callee32, null, [[6, 11]]);
21817
21828
  }));
21818
21829
  return _restartCaptureScreen.apply(this, arguments);
21819
21830
  }
@@ -23224,7 +23235,7 @@
23224
23235
  lib.InvalidTokenError = InvalidTokenError_1;
23225
23236
 
23226
23237
  var StaticConfig = {
23227
- agentVersion: "OmniRTC_Web_V1.1.4-peiyou.0",
23238
+ agentVersion: "OmniRTC_Web_V1.1.5-peiyou.0",
23228
23239
  logVersion: 1,
23229
23240
  serviceType: 320,
23230
23241
  logBackendUrl: "https://rtc-logs.magic-school.com/stream.gif"
@@ -34296,13 +34307,8 @@
34296
34307
  if (config.mode && config.mode === 'rtc') {
34297
34308
  this._engine.setUserVisibility(true);
34298
34309
  }
34299
- if (config.role) {
34300
- if (config.role === 'host') {
34301
- this._engine.setUserVisibility(true);
34302
- }
34303
- else {
34304
- this._engine.setUserVisibility(false);
34305
- }
34310
+ if (config.role && config.role === 'host') {
34311
+ this._engine.setUserVisibility(true);
34306
34312
  }
34307
34313
  if (config.clientRoleOptions) {
34308
34314
  console.log('Currently we do not support setting clientRoleOptions !');
@@ -35490,6 +35496,7 @@
35490
35496
  this._plan = plan;
35491
35497
  index$1.setParameter('STATS_SCALLBACK_SUPPORT', false);
35492
35498
  this._engine = index$1.createEngine(this._appId);
35499
+ this._engine.setUserVisibility(false);
35493
35500
  VolcCoreRTC$1.setEngine(this._engine);
35494
35501
  VolcCoreRTC$1.setUserInfo({
35495
35502
  appId: appId,
@@ -36737,7 +36744,8 @@
36737
36744
  accountId: args.userId,
36738
36745
  header: args.institutionId,
36739
36746
  liveId: args.live_id,
36740
- mainStream: localStreamId$1
36747
+ mainStream: localStreamId$1,
36748
+ role: args.role
36741
36749
  }));
36742
36750
  talrtc.enableLogUpload();
36743
36751
  talrtc.onAutoplayFailed = function (autoResume, kind) {
@@ -38248,7 +38256,7 @@
38248
38256
  return startScreenCapture();
38249
38257
  case 7:
38250
38258
  if (screenPreviewDomId) {
38251
- track.play(screenPreviewDomId, {
38259
+ screenTrack.play(screenPreviewDomId, {
38252
38260
  fit: 'contain'
38253
38261
  });
38254
38262
  }
@@ -39110,7 +39118,7 @@
39110
39118
  */
39111
39119
  var muteRemoteAudio = /*#__PURE__*/function () {
39112
39120
  var _ref43 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee43(streamId, mute) {
39113
- var _streamId$split3, _streamId$split4, roomId, userId, numberUserId, client, user, _track;
39121
+ var _streamId$split3, _streamId$split4, roomId, userId, numberUserId, client, user, track;
39114
39122
  return regenerator.wrap(function _callee43$(_context43) {
39115
39123
  while (1) switch (_context43.prev = _context43.next) {
39116
39124
  case 0:
@@ -39156,15 +39164,15 @@
39156
39164
  _context43.next = 24;
39157
39165
  return client.subscribe(user.mainStreamId, 'audio');
39158
39166
  case 24:
39159
- _track = _context43.sent;
39160
- _track.setVolume(speakerVolume$1);
39161
- _track.once('first-frame-decoded', function () {
39167
+ track = _context43.sent;
39168
+ track.setVolume(speakerVolume$1);
39169
+ track.once('first-frame-decoded', function () {
39162
39170
  NOTICE.firstAudioSize({
39163
39171
  streamId: streamId,
39164
39172
  userId: userId
39165
39173
  });
39166
39174
  });
39167
- _track.play();
39175
+ track.play();
39168
39176
  case 28:
39169
39177
  case "end":
39170
39178
  return _context43.stop();
@@ -39184,7 +39192,7 @@
39184
39192
  */
39185
39193
  var muteRemoteVideo = /*#__PURE__*/function () {
39186
39194
  var _ref44 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee44(streamId, mute) {
39187
- var _streamId$split5, _streamId$split6, roomId, userId, numberUserId, client, user, _track2;
39195
+ var _streamId$split5, _streamId$split6, roomId, userId, numberUserId, client, user, track;
39188
39196
  return regenerator.wrap(function _callee44$(_context44) {
39189
39197
  while (1) switch (_context44.prev = _context44.next) {
39190
39198
  case 0:
@@ -39231,15 +39239,15 @@
39231
39239
  _context44.next = 25;
39232
39240
  return client.subscribe(user.mainStreamId, 'video');
39233
39241
  case 25:
39234
- _track2 = _context44.sent;
39235
- _track2.once('first-frame-decoded', function () {
39242
+ track = _context44.sent;
39243
+ track.once('first-frame-decoded', function () {
39236
39244
  NOTICE.firstVideoSize({
39237
39245
  streamId: streamId,
39238
39246
  userId: userId
39239
39247
  });
39240
39248
  });
39241
39249
  if (user.videoDomId) {
39242
- _track2.play(user.videoDomId, {
39250
+ track.play(user.videoDomId, {
39243
39251
  fit: 'contain'
39244
39252
  });
39245
39253
  }
@@ -39262,7 +39270,7 @@
39262
39270
  */
39263
39271
  var muteRemoteScreenAudio = /*#__PURE__*/function () {
39264
39272
  var _ref45 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee45(streamId, mute) {
39265
- var _streamId$split7, _streamId$split8, roomId, userId, numberUserId, client, user, _track3;
39273
+ var _streamId$split7, _streamId$split8, roomId, userId, numberUserId, client, user, track;
39266
39274
  return regenerator.wrap(function _callee45$(_context45) {
39267
39275
  while (1) switch (_context45.prev = _context45.next) {
39268
39276
  case 0:
@@ -39308,15 +39316,15 @@
39308
39316
  _context45.next = 24;
39309
39317
  return client.subscribe(user.screenStreamId, 'audio');
39310
39318
  case 24:
39311
- _track3 = _context45.sent;
39312
- _track3.setVolume(speakerVolume$1);
39313
- _track3.once('first-frame-decoded', function () {
39319
+ track = _context45.sent;
39320
+ track.setVolume(speakerVolume$1);
39321
+ track.once('first-frame-decoded', function () {
39314
39322
  NOTICE.firstAudioSize({
39315
39323
  streamId: streamId,
39316
39324
  userId: userId
39317
39325
  });
39318
39326
  });
39319
- _track3.play();
39327
+ track.play();
39320
39328
  case 28:
39321
39329
  case "end":
39322
39330
  return _context45.stop();
@@ -39335,7 +39343,7 @@
39335
39343
  */
39336
39344
  var muteRemoteScreenVideo = /*#__PURE__*/function () {
39337
39345
  var _ref46 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee46(streamId, mute) {
39338
- var _streamId$split9, _streamId$split10, roomId, userId, numberUserId, client, user, _track4;
39346
+ var _streamId$split9, _streamId$split10, roomId, userId, numberUserId, client, user, track;
39339
39347
  return regenerator.wrap(function _callee46$(_context46) {
39340
39348
  while (1) switch (_context46.prev = _context46.next) {
39341
39349
  case 0:
@@ -39382,15 +39390,15 @@
39382
39390
  _context46.next = 25;
39383
39391
  return client.subscribe(user.screenStreamId, 'video');
39384
39392
  case 25:
39385
- _track4 = _context46.sent;
39386
- _track4.once('first-frame-decoded', function () {
39393
+ track = _context46.sent;
39394
+ track.once('first-frame-decoded', function () {
39387
39395
  NOTICE.firstVideoSize({
39388
39396
  streamId: streamId,
39389
39397
  userId: userId
39390
39398
  });
39391
39399
  });
39392
39400
  if (user.screenDomId) {
39393
- _track4.play(user.screenDomId, {
39401
+ track.play(user.screenDomId, {
39394
39402
  fit: 'contain'
39395
39403
  });
39396
39404
  }