floating-live 0.8.1 → 0.8.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "floating-live",
3
- "version": "0.8.1",
3
+ "version": "0.8.3",
4
4
  "type": "commonjs",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -67,7 +67,7 @@ class Room {
67
67
  if (open) {
68
68
  room.open();
69
69
  }
70
- this.main.emit("room_add", { key: key, room: (0, getRoomInfo_1.default)(room) });
70
+ this.main.emit("room_add", key, (0, getRoomInfo_1.default)(room));
71
71
  }
72
72
  /** 移除房间 */
73
73
  remove(roomKey) {
@@ -20,7 +20,7 @@ export default class Controller {
20
20
  /** 添加房间 */
21
21
  addRoom({ platform, id }: {
22
22
  platform: string;
23
- id: number;
23
+ id: string | number;
24
24
  }, open?: boolean): void;
25
25
  /** 移除房间 */
26
26
  removeRoom(roomKey: string): void;
@@ -22,13 +22,13 @@ class Controller {
22
22
  start() {
23
23
  this.started = true;
24
24
  this.timestamp = new Date().valueOf();
25
- this.main.emit("start");
25
+ this.main.emit("start", this.timestamp);
26
26
  }
27
27
  /** 结束 */
28
28
  end() {
29
29
  this.closeAllRooms();
30
30
  this.started = false;
31
- this.main.emit("end");
31
+ this.main.emit("end", this.timestamp);
32
32
  this.timestamp = 0;
33
33
  }
34
34
  /** 添加房间 */
@@ -52,7 +52,7 @@ class Controller {
52
52
  }
53
53
  /** 关闭房间 */
54
54
  closeRoom(roomKey) {
55
- this.room.open(roomKey);
55
+ this.room.close(roomKey);
56
56
  }
57
57
  /** 打开所有房间 */
58
58
  openAllRooms() {
@@ -3,7 +3,7 @@ interface LiveRoom extends RoomInfo {
3
3
  /** 直播平台 */
4
4
  readonly platform: string;
5
5
  /** 房间id */
6
- readonly id: number;
6
+ readonly id: number | string;
7
7
  /** 打开连接 */
8
8
  open: () => void;
9
9
  /** 关闭连接 */
@@ -4,7 +4,7 @@ export default interface RoomInfo {
4
4
  /** 平台id */
5
5
  platform: string;
6
6
  /** 房间id */
7
- id: number;
7
+ id: number | string;
8
8
  /** 直播信息 */
9
9
  live: LiveInfo;
10
10
  /** 主播信息 */