@coze/realtime-api 1.2.1-beta.8 → 1.2.1-beta.9

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/cjs/index.js CHANGED
@@ -460,6 +460,10 @@ class EngineClient extends RealtimeEventHandler {
460
460
  video: true
461
461
  });
462
462
  if (!isMobileVideoDevice(deviceId) && -1 === devices.videoInputs.findIndex((i)=>i.deviceId === deviceId)) throw new RealtimeAPIError(error_RealtimeError.DEVICE_ACCESS_ERROR, `Video input device not found: ${deviceId}`);
463
+ this.engine.setLocalVideoPlayer(isScreenShareDevice(deviceId) ? rtc_namespaceObject.StreamIndex.STREAM_INDEX_SCREEN : rtc_namespaceObject.StreamIndex.STREAM_INDEX_MAIN, {
464
+ renderDom: (null === (_this__videoConfig = this._videoConfig) || void 0 === _this__videoConfig ? void 0 : _this__videoConfig.renderDom) || 'local-player',
465
+ userId: this._roomUserId
466
+ });
463
467
  await this.changeVideoState(false);
464
468
  if (isScreenShareDevice(deviceId)) {
465
469
  if (this._streamIndex === rtc_namespaceObject.StreamIndex.STREAM_INDEX_MAIN) this.engine.setLocalVideoPlayer(rtc_namespaceObject.StreamIndex.STREAM_INDEX_MAIN);
@@ -475,10 +479,6 @@ class EngineClient extends RealtimeEventHandler {
475
479
  if (isAutoCapture) await this.engine.startVideoCapture(deviceId);
476
480
  this._streamIndex = rtc_namespaceObject.StreamIndex.STREAM_INDEX_MAIN;
477
481
  }
478
- this.engine.setLocalVideoPlayer(this._streamIndex, {
479
- renderDom: (null === (_this__videoConfig = this._videoConfig) || void 0 === _this__videoConfig ? void 0 : _this__videoConfig.renderDom) || 'local-player',
480
- userId: this._roomUserId
481
- });
482
482
  }
483
483
  async createLocalStream(userId, videoConfig) {
484
484
  this._roomUserId = userId;
package/dist/esm/index.js CHANGED
@@ -431,6 +431,10 @@ class EngineClient extends RealtimeEventHandler {
431
431
  video: true
432
432
  });
433
433
  if (!isMobileVideoDevice(deviceId) && -1 === devices.videoInputs.findIndex((i)=>i.deviceId === deviceId)) throw new RealtimeAPIError(error_RealtimeError.DEVICE_ACCESS_ERROR, `Video input device not found: ${deviceId}`);
434
+ this.engine.setLocalVideoPlayer(isScreenShareDevice(deviceId) ? __WEBPACK_EXTERNAL_MODULE__volcengine_rtc__.StreamIndex.STREAM_INDEX_SCREEN : __WEBPACK_EXTERNAL_MODULE__volcengine_rtc__.StreamIndex.STREAM_INDEX_MAIN, {
435
+ renderDom: (null === (_this__videoConfig = this._videoConfig) || void 0 === _this__videoConfig ? void 0 : _this__videoConfig.renderDom) || 'local-player',
436
+ userId: this._roomUserId
437
+ });
434
438
  await this.changeVideoState(false);
435
439
  if (isScreenShareDevice(deviceId)) {
436
440
  if (this._streamIndex === __WEBPACK_EXTERNAL_MODULE__volcengine_rtc__.StreamIndex.STREAM_INDEX_MAIN) this.engine.setLocalVideoPlayer(__WEBPACK_EXTERNAL_MODULE__volcengine_rtc__.StreamIndex.STREAM_INDEX_MAIN);
@@ -446,10 +450,6 @@ class EngineClient extends RealtimeEventHandler {
446
450
  if (isAutoCapture) await this.engine.startVideoCapture(deviceId);
447
451
  this._streamIndex = __WEBPACK_EXTERNAL_MODULE__volcengine_rtc__.StreamIndex.STREAM_INDEX_MAIN;
448
452
  }
449
- this.engine.setLocalVideoPlayer(this._streamIndex, {
450
- renderDom: (null === (_this__videoConfig = this._videoConfig) || void 0 === _this__videoConfig ? void 0 : _this__videoConfig.renderDom) || 'local-player',
451
- userId: this._roomUserId
452
- });
453
453
  }
454
454
  async createLocalStream(userId, videoConfig) {
455
455
  this._roomUserId = userId;
package/dist/umd/index.js CHANGED
@@ -498,6 +498,10 @@
498
498
  video: true
499
499
  });
500
500
  if (!isMobileVideoDevice(deviceId) && -1 === devices.videoInputs.findIndex((i)=>i.deviceId === deviceId)) throw new RealtimeAPIError(error_RealtimeError.DEVICE_ACCESS_ERROR, `Video input device not found: ${deviceId}`);
501
+ this.engine.setLocalVideoPlayer(isScreenShareDevice(deviceId) ? rtc_.StreamIndex.STREAM_INDEX_SCREEN : rtc_.StreamIndex.STREAM_INDEX_MAIN, {
502
+ renderDom: (null === (_this__videoConfig = this._videoConfig) || void 0 === _this__videoConfig ? void 0 : _this__videoConfig.renderDom) || 'local-player',
503
+ userId: this._roomUserId
504
+ });
501
505
  await this.changeVideoState(false);
502
506
  if (isScreenShareDevice(deviceId)) {
503
507
  if (this._streamIndex === rtc_.StreamIndex.STREAM_INDEX_MAIN) this.engine.setLocalVideoPlayer(rtc_.StreamIndex.STREAM_INDEX_MAIN);
@@ -513,10 +517,6 @@
513
517
  if (isAutoCapture) await this.engine.startVideoCapture(deviceId);
514
518
  this._streamIndex = rtc_.StreamIndex.STREAM_INDEX_MAIN;
515
519
  }
516
- this.engine.setLocalVideoPlayer(this._streamIndex, {
517
- renderDom: (null === (_this__videoConfig = this._videoConfig) || void 0 === _this__videoConfig ? void 0 : _this__videoConfig.renderDom) || 'local-player',
518
- userId: this._roomUserId
519
- });
520
520
  }
521
521
  async createLocalStream(userId, videoConfig) {
522
522
  this._roomUserId = userId;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coze/realtime-api",
3
- "version": "1.2.1-beta.8",
3
+ "version": "1.2.1-beta.9",
4
4
  "description": "A powerful real-time communication SDK for voice interactions with Coze AI bots | 扣子官方实时通信 SDK,用于与 Coze AI bots 进行语音交互",
5
5
  "keywords": [
6
6
  "coze",
@@ -54,7 +54,7 @@
54
54
  "test:cov": "vitest --coverage --run"
55
55
  },
56
56
  "dependencies": {
57
- "@coze/api": "1.2.1-beta.17",
57
+ "@coze/api": "1.2.1-beta.18",
58
58
  "@volcengine/rtc": "~4.62.11"
59
59
  },
60
60
  "devDependencies": {