@coze/realtime-api 1.2.1-beta.5 → 1.2.1-beta.6

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.
@@ -117,13 +117,9 @@ var EventNames = /*#__PURE__*/ function(EventNames) {
117
117
  * zh: 网络质量改变
118
118
  */ EventNames["NETWORK_QUALITY"] = "client.network.quality";
119
119
  /**
120
- * en: User publish screen
121
- * zh: 用户发布屏幕
122
- */ EventNames["USER_PUBLISH_SCREEN"] = "client.user.publish.screen";
123
- /**
124
- * en: User unpublish screen
125
- * zh: 用户取消发布屏幕
126
- */ EventNames["USER_UNPUBLISH_SCREEN"] = "client.user.unpublish.screen";
120
+ * en: Track ended
121
+ * zh: 轨道结束
122
+ */ EventNames["TRACK_ENDED"] = "client.track.ended";
127
123
  /**
128
124
  * en: Bot joined
129
125
  * zh: Bot 加入
package/dist/cjs/index.js CHANGED
@@ -230,13 +230,9 @@ var event_names_EventNames = /*#__PURE__*/ function(EventNames) {
230
230
  * zh: 网络质量改变
231
231
  */ EventNames["NETWORK_QUALITY"] = "client.network.quality";
232
232
  /**
233
- * en: User publish screen
234
- * zh: 用户发布屏幕
235
- */ EventNames["USER_PUBLISH_SCREEN"] = "client.user.publish.screen";
236
- /**
237
- * en: User unpublish screen
238
- * zh: 用户取消发布屏幕
239
- */ EventNames["USER_UNPUBLISH_SCREEN"] = "client.user.unpublish.screen";
233
+ * en: Track ended
234
+ * zh: 轨道结束
235
+ */ EventNames["TRACK_ENDED"] = "client.track.ended";
240
236
  /**
241
237
  * en: Bot joined
242
238
  * zh: Bot 加入
@@ -362,8 +358,7 @@ class EngineClient extends RealtimeEventHandler {
362
358
  this.engine.on(rtc_default().events.onUserLeave, this.handleUserLeave);
363
359
  this.engine.on(rtc_default().events.onError, this.handleEventError);
364
360
  this.engine.on(rtc_default().events.onNetworkQuality, this.handleNetworkQuality);
365
- this.engine.on(rtc_default().events.onUserPublishScreen, this.handleUserPublishScreen);
366
- this.engine.on(rtc_default().events.onUserUnpublishScreen, this.handleUserUnpublishScreen);
361
+ this.engine.on(rtc_default().events.onTrackEnded, this.handleTrackEnded);
367
362
  if (this._isSupportVideo) this.engine.on(rtc_default().events.onPlayerEvent, this.handlePlayerEvent);
368
363
  if (this._debug) {
369
364
  this.engine.on(rtc_default().events.onLocalAudioPropertiesReport, this.handleLocalAudioPropertiesReport);
@@ -376,8 +371,7 @@ class EngineClient extends RealtimeEventHandler {
376
371
  this.engine.off(rtc_default().events.onUserLeave, this.handleUserLeave);
377
372
  this.engine.off(rtc_default().events.onError, this.handleEventError);
378
373
  this.engine.off(rtc_default().events.onNetworkQuality, this.handleNetworkQuality);
379
- this.engine.off(rtc_default().events.onUserPublishScreen, this.handleUserPublishScreen);
380
- this.engine.off(rtc_default().events.onUserUnpublishScreen, this.handleUserUnpublishScreen);
374
+ this.engine.off(rtc_default().events.onTrackEnded, this.handleTrackEnded);
381
375
  if (this._isSupportVideo) this.engine.off(rtc_default().events.onPlayerEvent, this.handlePlayerEvent);
382
376
  if (this._debug) {
383
377
  this.engine.off(rtc_default().events.onLocalAudioPropertiesReport, this.handleLocalAudioPropertiesReport);
@@ -428,11 +422,8 @@ class EngineClient extends RealtimeEventHandler {
428
422
  downlinkNetworkQuality
429
423
  });
430
424
  }
431
- handleUserPublishScreen(event) {
432
- this.dispatch(event_names.USER_PUBLISH_SCREEN, event);
433
- }
434
- handleUserUnpublishScreen(event) {
435
- this.dispatch(event_names.USER_UNPUBLISH_SCREEN, event);
425
+ handleTrackEnded(event) {
426
+ this.dispatch(event_names.TRACK_ENDED, event);
436
427
  }
437
428
  async joinRoom(options) {
438
429
  const { token, roomId, uid, audioMutedDefault, videoOnDefault, isAutoSubscribeAudio } = options;
@@ -625,8 +616,7 @@ class EngineClient extends RealtimeEventHandler {
625
616
  this.handleEventError = this.handleEventError.bind(this);
626
617
  this.handlePlayerEvent = this.handlePlayerEvent.bind(this);
627
618
  this.handleNetworkQuality = this.handleNetworkQuality.bind(this);
628
- this.handleUserPublishScreen = this.handleUserPublishScreen.bind(this);
629
- this.handleUserUnpublishScreen = this.handleUserUnpublishScreen.bind(this);
619
+ this.handleTrackEnded = this.handleTrackEnded.bind(this);
630
620
  // Debug only
631
621
  this.handleLocalAudioPropertiesReport = this.handleLocalAudioPropertiesReport.bind(this);
632
622
  this.handleRemoteAudioPropertiesReport = this.handleRemoteAudioPropertiesReport.bind(this);
@@ -80,13 +80,9 @@ var event_names_EventNames = /*#__PURE__*/ function(EventNames) {
80
80
  * zh: 网络质量改变
81
81
  */ EventNames["NETWORK_QUALITY"] = "client.network.quality";
82
82
  /**
83
- * en: User publish screen
84
- * zh: 用户发布屏幕
85
- */ EventNames["USER_PUBLISH_SCREEN"] = "client.user.publish.screen";
86
- /**
87
- * en: User unpublish screen
88
- * zh: 用户取消发布屏幕
89
- */ EventNames["USER_UNPUBLISH_SCREEN"] = "client.user.unpublish.screen";
83
+ * en: Track ended
84
+ * zh: 轨道结束
85
+ */ EventNames["TRACK_ENDED"] = "client.track.ended";
90
86
  /**
91
87
  * en: Bot joined
92
88
  * zh: Bot 加入
package/dist/esm/index.js CHANGED
@@ -203,13 +203,9 @@ var event_names_EventNames = /*#__PURE__*/ function(EventNames) {
203
203
  * zh: 网络质量改变
204
204
  */ EventNames["NETWORK_QUALITY"] = "client.network.quality";
205
205
  /**
206
- * en: User publish screen
207
- * zh: 用户发布屏幕
208
- */ EventNames["USER_PUBLISH_SCREEN"] = "client.user.publish.screen";
209
- /**
210
- * en: User unpublish screen
211
- * zh: 用户取消发布屏幕
212
- */ EventNames["USER_UNPUBLISH_SCREEN"] = "client.user.unpublish.screen";
206
+ * en: Track ended
207
+ * zh: 轨道结束
208
+ */ EventNames["TRACK_ENDED"] = "client.track.ended";
213
209
  /**
214
210
  * en: Bot joined
215
211
  * zh: Bot 加入
@@ -333,8 +329,7 @@ class EngineClient extends RealtimeEventHandler {
333
329
  this.engine.on(__WEBPACK_EXTERNAL_MODULE__volcengine_rtc__["default"].events.onUserLeave, this.handleUserLeave);
334
330
  this.engine.on(__WEBPACK_EXTERNAL_MODULE__volcengine_rtc__["default"].events.onError, this.handleEventError);
335
331
  this.engine.on(__WEBPACK_EXTERNAL_MODULE__volcengine_rtc__["default"].events.onNetworkQuality, this.handleNetworkQuality);
336
- this.engine.on(__WEBPACK_EXTERNAL_MODULE__volcengine_rtc__["default"].events.onUserPublishScreen, this.handleUserPublishScreen);
337
- this.engine.on(__WEBPACK_EXTERNAL_MODULE__volcengine_rtc__["default"].events.onUserUnpublishScreen, this.handleUserUnpublishScreen);
332
+ this.engine.on(__WEBPACK_EXTERNAL_MODULE__volcengine_rtc__["default"].events.onTrackEnded, this.handleTrackEnded);
338
333
  if (this._isSupportVideo) this.engine.on(__WEBPACK_EXTERNAL_MODULE__volcengine_rtc__["default"].events.onPlayerEvent, this.handlePlayerEvent);
339
334
  if (this._debug) {
340
335
  this.engine.on(__WEBPACK_EXTERNAL_MODULE__volcengine_rtc__["default"].events.onLocalAudioPropertiesReport, this.handleLocalAudioPropertiesReport);
@@ -347,8 +342,7 @@ class EngineClient extends RealtimeEventHandler {
347
342
  this.engine.off(__WEBPACK_EXTERNAL_MODULE__volcengine_rtc__["default"].events.onUserLeave, this.handleUserLeave);
348
343
  this.engine.off(__WEBPACK_EXTERNAL_MODULE__volcengine_rtc__["default"].events.onError, this.handleEventError);
349
344
  this.engine.off(__WEBPACK_EXTERNAL_MODULE__volcengine_rtc__["default"].events.onNetworkQuality, this.handleNetworkQuality);
350
- this.engine.off(__WEBPACK_EXTERNAL_MODULE__volcengine_rtc__["default"].events.onUserPublishScreen, this.handleUserPublishScreen);
351
- this.engine.off(__WEBPACK_EXTERNAL_MODULE__volcengine_rtc__["default"].events.onUserUnpublishScreen, this.handleUserUnpublishScreen);
345
+ this.engine.off(__WEBPACK_EXTERNAL_MODULE__volcengine_rtc__["default"].events.onTrackEnded, this.handleTrackEnded);
352
346
  if (this._isSupportVideo) this.engine.off(__WEBPACK_EXTERNAL_MODULE__volcengine_rtc__["default"].events.onPlayerEvent, this.handlePlayerEvent);
353
347
  if (this._debug) {
354
348
  this.engine.off(__WEBPACK_EXTERNAL_MODULE__volcengine_rtc__["default"].events.onLocalAudioPropertiesReport, this.handleLocalAudioPropertiesReport);
@@ -399,11 +393,8 @@ class EngineClient extends RealtimeEventHandler {
399
393
  downlinkNetworkQuality
400
394
  });
401
395
  }
402
- handleUserPublishScreen(event) {
403
- this.dispatch(event_names.USER_PUBLISH_SCREEN, event);
404
- }
405
- handleUserUnpublishScreen(event) {
406
- this.dispatch(event_names.USER_UNPUBLISH_SCREEN, event);
396
+ handleTrackEnded(event) {
397
+ this.dispatch(event_names.TRACK_ENDED, event);
407
398
  }
408
399
  async joinRoom(options) {
409
400
  const { token, roomId, uid, audioMutedDefault, videoOnDefault, isAutoSubscribeAudio } = options;
@@ -596,8 +587,7 @@ class EngineClient extends RealtimeEventHandler {
596
587
  this.handleEventError = this.handleEventError.bind(this);
597
588
  this.handlePlayerEvent = this.handlePlayerEvent.bind(this);
598
589
  this.handleNetworkQuality = this.handleNetworkQuality.bind(this);
599
- this.handleUserPublishScreen = this.handleUserPublishScreen.bind(this);
600
- this.handleUserUnpublishScreen = this.handleUserUnpublishScreen.bind(this);
590
+ this.handleTrackEnded = this.handleTrackEnded.bind(this);
601
591
  // Debug only
602
592
  this.handleLocalAudioPropertiesReport = this.handleLocalAudioPropertiesReport.bind(this);
603
593
  this.handleRemoteAudioPropertiesReport = this.handleRemoteAudioPropertiesReport.bind(this);
@@ -19,8 +19,7 @@ export declare class EngineClient extends RealtimeEventHandler {
19
19
  handleUserLeave(event: onUserLeaveEvent): void;
20
20
  handlePlayerEvent(event: unknown): void;
21
21
  handleNetworkQuality(uplinkNetworkQuality: NetworkQuality, downlinkNetworkQuality: NetworkQuality): void;
22
- handleUserPublishScreen(event: unknown): void;
23
- handleUserUnpublishScreen(event: unknown): void;
22
+ handleTrackEnded(event: unknown): void;
24
23
  joinRoom(options: {
25
24
  token: string;
26
25
  roomId: string;
@@ -19,8 +19,7 @@ export declare class EngineClient extends RealtimeEventHandler {
19
19
  handleUserLeave(event: onUserLeaveEvent): void;
20
20
  handlePlayerEvent(event: unknown): void;
21
21
  handleNetworkQuality(uplinkNetworkQuality: NetworkQuality, downlinkNetworkQuality: NetworkQuality): void;
22
- handleUserPublishScreen(event: unknown): void;
23
- handleUserUnpublishScreen(event: unknown): void;
22
+ handleTrackEnded(event: unknown): void;
24
23
  joinRoom(options: {
25
24
  token: string;
26
25
  roomId: string;
@@ -100,15 +100,10 @@ declare enum EventNames {
100
100
  */
101
101
  NETWORK_QUALITY = "client.network.quality",
102
102
  /**
103
- * en: User publish screen
104
- * zh: 用户发布屏幕
103
+ * en: Track ended
104
+ * zh: 轨道结束
105
105
  */
106
- USER_PUBLISH_SCREEN = "client.user.publish.screen",
107
- /**
108
- * en: User unpublish screen
109
- * zh: 用户取消发布屏幕
110
- */
111
- USER_UNPUBLISH_SCREEN = "client.user.unpublish.screen",
106
+ TRACK_ENDED = "client.track.ended",
112
107
  /**
113
108
  * en: Bot joined
114
109
  * zh: Bot 加入
@@ -100,15 +100,10 @@ declare enum EventNames {
100
100
  */
101
101
  NETWORK_QUALITY = "client.network.quality",
102
102
  /**
103
- * en: User publish screen
104
- * zh: 用户发布屏幕
103
+ * en: Track ended
104
+ * zh: 轨道结束
105
105
  */
106
- USER_PUBLISH_SCREEN = "client.user.publish.screen",
107
- /**
108
- * en: User unpublish screen
109
- * zh: 用户取消发布屏幕
110
- */
111
- USER_UNPUBLISH_SCREEN = "client.user.unpublish.screen",
106
+ TRACK_ENDED = "client.track.ended",
112
107
  /**
113
108
  * en: Bot joined
114
109
  * zh: Bot 加入
package/dist/umd/index.js CHANGED
@@ -267,13 +267,9 @@
267
267
  * zh: 网络质量改变
268
268
  */ EventNames["NETWORK_QUALITY"] = "client.network.quality";
269
269
  /**
270
- * en: User publish screen
271
- * zh: 用户发布屏幕
272
- */ EventNames["USER_PUBLISH_SCREEN"] = "client.user.publish.screen";
273
- /**
274
- * en: User unpublish screen
275
- * zh: 用户取消发布屏幕
276
- */ EventNames["USER_UNPUBLISH_SCREEN"] = "client.user.unpublish.screen";
270
+ * en: Track ended
271
+ * zh: 轨道结束
272
+ */ EventNames["TRACK_ENDED"] = "client.track.ended";
277
273
  /**
278
274
  * en: Bot joined
279
275
  * zh: Bot 加入
@@ -400,8 +396,7 @@
400
396
  this.engine.on(rtc_default().events.onUserLeave, this.handleUserLeave);
401
397
  this.engine.on(rtc_default().events.onError, this.handleEventError);
402
398
  this.engine.on(rtc_default().events.onNetworkQuality, this.handleNetworkQuality);
403
- this.engine.on(rtc_default().events.onUserPublishScreen, this.handleUserPublishScreen);
404
- this.engine.on(rtc_default().events.onUserUnpublishScreen, this.handleUserUnpublishScreen);
399
+ this.engine.on(rtc_default().events.onTrackEnded, this.handleTrackEnded);
405
400
  if (this._isSupportVideo) this.engine.on(rtc_default().events.onPlayerEvent, this.handlePlayerEvent);
406
401
  if (this._debug) {
407
402
  this.engine.on(rtc_default().events.onLocalAudioPropertiesReport, this.handleLocalAudioPropertiesReport);
@@ -414,8 +409,7 @@
414
409
  this.engine.off(rtc_default().events.onUserLeave, this.handleUserLeave);
415
410
  this.engine.off(rtc_default().events.onError, this.handleEventError);
416
411
  this.engine.off(rtc_default().events.onNetworkQuality, this.handleNetworkQuality);
417
- this.engine.off(rtc_default().events.onUserPublishScreen, this.handleUserPublishScreen);
418
- this.engine.off(rtc_default().events.onUserUnpublishScreen, this.handleUserUnpublishScreen);
412
+ this.engine.off(rtc_default().events.onTrackEnded, this.handleTrackEnded);
419
413
  if (this._isSupportVideo) this.engine.off(rtc_default().events.onPlayerEvent, this.handlePlayerEvent);
420
414
  if (this._debug) {
421
415
  this.engine.off(rtc_default().events.onLocalAudioPropertiesReport, this.handleLocalAudioPropertiesReport);
@@ -466,11 +460,8 @@
466
460
  downlinkNetworkQuality
467
461
  });
468
462
  }
469
- handleUserPublishScreen(event) {
470
- this.dispatch(event_names.USER_PUBLISH_SCREEN, event);
471
- }
472
- handleUserUnpublishScreen(event) {
473
- this.dispatch(event_names.USER_UNPUBLISH_SCREEN, event);
463
+ handleTrackEnded(event) {
464
+ this.dispatch(event_names.TRACK_ENDED, event);
474
465
  }
475
466
  async joinRoom(options) {
476
467
  const { token, roomId, uid, audioMutedDefault, videoOnDefault, isAutoSubscribeAudio } = options;
@@ -663,8 +654,7 @@
663
654
  this.handleEventError = this.handleEventError.bind(this);
664
655
  this.handlePlayerEvent = this.handlePlayerEvent.bind(this);
665
656
  this.handleNetworkQuality = this.handleNetworkQuality.bind(this);
666
- this.handleUserPublishScreen = this.handleUserPublishScreen.bind(this);
667
- this.handleUserUnpublishScreen = this.handleUserUnpublishScreen.bind(this);
657
+ this.handleTrackEnded = this.handleTrackEnded.bind(this);
668
658
  // Debug only
669
659
  this.handleLocalAudioPropertiesReport = this.handleLocalAudioPropertiesReport.bind(this);
670
660
  this.handleRemoteAudioPropertiesReport = this.handleRemoteAudioPropertiesReport.bind(this);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coze/realtime-api",
3
- "version": "1.2.1-beta.5",
3
+ "version": "1.2.1-beta.6",
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.13",
57
+ "@coze/api": "1.2.1-beta.17",
58
58
  "@volcengine/rtc": "~4.62.11"
59
59
  },
60
60
  "devDependencies": {
@@ -66,7 +66,7 @@
66
66
  "@types/node": "^20",
67
67
  "@types/uuid": "^9.0.1",
68
68
  "@types/whatwg-fetch": "^0.0.33",
69
- "@vitest/coverage-v8": "~2.1.4",
69
+ "@vitest/coverage-v8": "~2.1.9",
70
70
  "axios": "^1.7.7",
71
71
  "typescript": "^5.5.3",
72
72
  "vitest": "~2.1.9"