sample-xmonitor-js 2.0.0 → 2.0.1

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/lib/Monitor.d.ts CHANGED
@@ -66,7 +66,7 @@ export declare class MonitorType {
66
66
  * changed 状态改变
67
67
  * statistics 通话质量统计
68
68
  */
69
- export type MonitorEvent = 'cancel' | 'start' | 'playing' | 'pause' | 'shot' | 'stop' | 'error' | 'changed' | 'message' | 'statistics';
69
+ export type MonitorEvent = 'cancel' | 'start' | 'playing' | 'pause' | 'shot' | 'stop' | 'error' | 'changed' | 'message' | 'statistics' | 'publish-state-changed';
70
70
  export declare const MonitorEvents: Array<MonitorEvent>;
71
71
  export type MonitorEventObject = {
72
72
  event: MonitorEvent;
package/lib/Monitor.js CHANGED
@@ -119,7 +119,7 @@ export class MonitorType {
119
119
  return new MonitorType(type, device);
120
120
  }
121
121
  }
122
- export const MonitorEvents = ['cancel', 'start', 'playing', 'pause', 'shot', 'stop', 'error', 'changed', 'message', 'statistics'];
122
+ export const MonitorEvents = ['cancel', 'start', 'playing', 'pause', 'shot', 'stop', 'error', 'changed', 'message', 'statistics', 'publish-state-changed'];
123
123
  export class MObject {
124
124
  constructor(room, id) {
125
125
  this.room = room;
@@ -114,6 +114,9 @@ export default class TxrtcMonitor extends Monitor {
114
114
  this.dispatchEvent('error', event, event.error);
115
115
  this.stop();
116
116
  }
117
+ else {
118
+ this.dispatchEvent('publish-state-changed', event);
119
+ }
117
120
  }).on(TRTC.EVENT.CONNECTION_STATE_CHANGED, event => {
118
121
  if (event.state === 'CONNECTING' && event.prevState === 'DISCONNECTED' && event.isReconnecting) {
119
122
  // 尝试重连 10次之后抛出异常
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sample-xmonitor-js",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "description": "",
5
5
  "main": "./lib/index",
6
6
  "files": [