floating-live 0.11.1 → 0.11.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "floating-live",
3
- "version": "0.11.1",
3
+ "version": "0.11.2",
4
4
  "type": "commonjs",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -56,13 +56,15 @@ class bilibiliLive extends __2.LiveRoom {
56
56
  }) // 获取直播间信息
57
57
  .then((response) => response.json())
58
58
  .then((res) => {
59
- const { room_info, anchor_info } = res.data;
59
+ const { room_info, anchor_info, like_info_v3, watched_show } = res.data;
60
60
  this.roomid = room_info.room_id;
61
61
  this.status = room_info.live_status == 1 ? __1.RoomStatus.live : __1.RoomStatus.off;
62
62
  this.timestamp = this.status == __1.RoomStatus.live ? room_info.live_start_time * 1000 : refresh ? Date.now() : this.timestamp;
63
63
  this.view.title = room_info.title;
64
64
  this.view.area = [room_info.parent_area_name, room_info.area_name];
65
65
  this.view.cover = room_info.cover;
66
+ this.stats.watch = watched_show.num;
67
+ this.stats.like = like_info_v3.total_likes;
66
68
  this.anchor.id = room_info.uid;
67
69
  this.anchor.name = anchor_info.base_info.uname;
68
70
  this.anchor.avatar = anchor_info.base_info.face;
@@ -35,6 +35,7 @@ class LiveRoom extends events_1.EventEmitter {
35
35
  break;
36
36
  case "live_stats":
37
37
  this.stats = Object.assign(this.stats, msg.info);
38
+ this.emit("stats", msg.info);
38
39
  break;
39
40
  case "live_end":
40
41
  case "live_cut":