@hysc/meeting 1.6.16 → 1.6.18

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": "@hysc/meeting",
3
- "version": "1.6.16",
3
+ "version": "1.6.18",
4
4
  "description": "boom meeting",
5
5
  "main": "umd/index.js",
6
6
  "module": "esm/index.js",
@@ -14,7 +14,7 @@
14
14
  "author": "yangliye",
15
15
  "license": "MIT",
16
16
  "dependencies": {
17
- "@hysc/core": "1.6.8",
17
+ "@hysc/core": "1.6.10",
18
18
  "lodash-es": "^4.17.21",
19
19
  "mitt": "^3.0.0",
20
20
  "@hysc/p-queue": "6.3.0",
@@ -23,7 +23,7 @@
23
23
  "@hysc/utils": "1.2.0"
24
24
  },
25
25
  "peerDependencies": {
26
- "@hysc/core": "1.6.8"
26
+ "@hysc/core": "1.6.10"
27
27
  },
28
28
  "devDependencies": {
29
29
  "@types/lodash-es": "^4.17.6"
@@ -28,6 +28,8 @@ export default class BMStreamModel {
28
28
  _audio_enable: boolean;
29
29
  videoEnableWatcher: BehaviorSubject<boolean>;
30
30
  audioEnableWatcher: BehaviorSubject<boolean>;
31
+ streamUpdateWatcher: Subject<boolean>;
32
+ isSubScribedWatcher: Subject<boolean>;
31
33
  playStateChangeWatcher: Subject<BMStreamModel>;
32
34
  audioLevelWatcher: Subject<number>;
33
35
  isCurrentDisplay: boolean;
@@ -0,0 +1,151 @@
1
+ import BMStreamModel from '../BMStream/BMStreamModel';
2
+ import { BehaviorSubject } from 'rxjs';
3
+ import BCUser from '@hysc/core/esm/BoomAdapter/User/User';
4
+ import BMRoom from '../BMRoom/BMRoom';
5
+ declare type Operation = 'none' | 'getMaster' | 'getManager' | 'removeMaster' | 'getGuest' | 'removeGuest' | 'removeManager' | 'changeNickName' | 'speakerEnable' | 'changeShare' | 'updateUser' | 'raiseHandsVideo' | 'raiseHandsAudio' | 'audienceEnableSpeaking' | 'inBackground';
6
+ interface IUserActionWatcher {
7
+ operation: Operation;
8
+ user: BMUser;
9
+ }
10
+ interface UserInfo {
11
+ avatar: string;
12
+ jointime: number;
13
+ nickname: string;
14
+ pos: string;
15
+ userId: string;
16
+ status?: {
17
+ audioRaiseHands: boolean;
18
+ videoRaiseHands: boolean;
19
+ };
20
+ }
21
+ export interface RaiseHandInfo {
22
+ status: 'raiseHandsAudio' | 'raiseHandsVideo';
23
+ user: BMUser;
24
+ }
25
+ export default class BMUser {
26
+ /**
27
+ * 用户id
28
+ */
29
+ userId: string;
30
+ /**
31
+ * 用户信息
32
+ */
33
+ userInfo: UserInfo;
34
+ nickName: string;
35
+ isMaster: boolean;
36
+ isManager: boolean;
37
+ mirror: boolean;
38
+ isLocal: boolean;
39
+ isToupingma: boolean;
40
+ hasMultiple: boolean;
41
+ isCreate: boolean;
42
+ hasShare: boolean;
43
+ audienceEnableSpeaking: boolean;
44
+ /** 头像 */
45
+ avatar: string;
46
+ private streamModels;
47
+ permission: any;
48
+ /**
49
+ * 监听器, 监听返回对象属性
50
+ * @property {string} operation
51
+ * 'getManager':获得管理员权限/成为联席主持人
52
+ * 'getMaster':成为主持人
53
+ * 'removeManager':取消管理员权限/取消联席主持人
54
+ * 'removeMaster':取消主持人
55
+ * 'changeNickName':改变昵称
56
+ * 'speakerEnable':扬声器开关状态改变
57
+ * 'changeShare': 是否在屏幕共享
58
+ * 'raiseHandsVideo': 是否视频举手
59
+ * 'raiseHandsAudio': 是否音频举手
60
+ * @property {BMUser} user
61
+ */
62
+ watcher: BehaviorSubject<IUserActionWatcher>;
63
+ /**
64
+ * 排序
65
+ */
66
+ sortNum: number;
67
+ /**
68
+ * 举手相关
69
+ */
70
+ raiseVideoHands: boolean;
71
+ raiseAudioHands: boolean;
72
+ isAudience: boolean;
73
+ /**
74
+ * 是不是普通参会者
75
+ */
76
+ isCommonUser: boolean;
77
+ /**
78
+ * 如果改用户是移动端, 该值用于判断这个用户是否在后台
79
+ */
80
+ inBackground: boolean;
81
+ /**
82
+ * 是不是web端入会
83
+ */
84
+ get isWeb(): boolean;
85
+ constructor(user: any, isLocal?: boolean);
86
+ setup(userId: string, userinfo: UserInfo, nickname: string): void;
87
+ getMainStreamModel(): BMStreamModel | undefined;
88
+ getShareStreamModel(): BMStreamModel | undefined;
89
+ /**
90
+ * 获取用户麦克风开启状态
91
+ */
92
+ get audioEnable(): boolean;
93
+ get isMixer(): boolean;
94
+ /**
95
+ * 获取用户视频开启状态
96
+ */
97
+ get videoEnable(): boolean;
98
+ get isSharing(): boolean;
99
+ /**
100
+ * 是否是信号源
101
+ */
102
+ get isSignal(): boolean;
103
+ /**
104
+ * 检测当前用户是否有主持人权限
105
+ */
106
+ checkLocalHasMaster(): boolean;
107
+ /**
108
+ * 给用户添加流
109
+ * @param streamId
110
+ * @param stream 流
111
+ */
112
+ addStream(streamId: string, stream: BMStreamModel): void;
113
+ /**
114
+ * 删除流
115
+ * @param streamId
116
+ */
117
+ removeStream(streamId: string): void;
118
+ /**
119
+ * 获取用户id
120
+ */
121
+ getID(): string;
122
+ /**
123
+ * 获取用户昵称
124
+ */
125
+ getNickName(): string;
126
+ /**
127
+ * 获取用户信息
128
+ */
129
+ getUserInfo(): UserInfo;
130
+ /**
131
+ * 获取用户流信息
132
+ */
133
+ getStreams(): Map<string, BMStreamModel>;
134
+ /**
135
+ * updateUserInfo更新用户信息(除了isMaster,isMaster是通过change-master事件改变的)
136
+ * @param bcUser
137
+ * @param participant
138
+ * @param bmRoom
139
+ * @returns
140
+ */
141
+ updateUserInfo(bcUser: BCUser, participant: any, bmRoom: BMRoom): void;
142
+ /** 是否有管理权限, 是主持人或联席主持人之一 */
143
+ hasManager(): boolean;
144
+ /** 获取用户后面的身份标识 */
145
+ getNicknameSuffix(): string;
146
+ /**
147
+ * 更新当前用户的排序
148
+ */
149
+ updateSortNum(): void;
150
+ }
151
+ export {};
@@ -0,0 +1,138 @@
1
+ import BoomCore from '@hysc/core/esm';
2
+ import BMUser from './BMUser';
3
+ import BCUser from '@hysc/core/esm/BoomAdapter/User/User';
4
+ import BMRoom from '../BMRoom/BMRoom';
5
+ import { BehaviorSubject } from 'rxjs';
6
+ import { UpdateMasterType } from '../type';
7
+ /**
8
+ * 往业务端返回的时候,需要把这些用户过滤掉
9
+ */
10
+ export declare const ignoreUserId: string[];
11
+ export interface ChangeIsGuest {
12
+ user: BMUser;
13
+ preIsGuest: boolean;
14
+ isGuest: boolean;
15
+ }
16
+ export default class BMUserVM {
17
+ userList: Map<string, BMUser>;
18
+ audiencesList: Map<string, BMUser>;
19
+ signalList: Map<string, BMUser>;
20
+ commonUserList: Map<string, BMUser>;
21
+ boomCore: BoomCore;
22
+ room: BMRoom | null;
23
+ userListWatcher: BehaviorSubject<BMUser[]>;
24
+ audiencesListWatcher: BehaviorSubject<BMUser[]>;
25
+ commonUserListWatcher: BehaviorSubject<BMUser[]>;
26
+ signalListWatcher: BehaviorSubject<BMUser[]>;
27
+ masterUserWatcher: BehaviorSubject<BMUser | null>;
28
+ localUser: BMUser;
29
+ constructor(boomCore: BoomCore, localUser: BMUser);
30
+ initWithRoom(room: BMRoom): void;
31
+ handleUserRoleChange(info: ChangeIsGuest): Promise<void>;
32
+ /**
33
+ * 添加用户, 并返回已添加的用户对象
34
+ * @param bcUser bcUser对象
35
+ */
36
+ addUser(bcUser: BCUser): BMUser | null;
37
+ /**
38
+ * 移除用户
39
+ * @param userId 用户id
40
+ */
41
+ removeUser(userId: string): void;
42
+ /**
43
+ * 是否在userList找到该用户,返回true or false
44
+ * @param bcUser bcUser对象
45
+ * @returns
46
+ */
47
+ findUser(bcUser: BCUser): boolean;
48
+ /**
49
+ * 获取用户视频开启状态
50
+ * @param userId 用户id
51
+ */
52
+ videoEnable(userId: string): boolean;
53
+ /**
54
+ * 获取用户音频开启状态
55
+ * @param userId
56
+ */
57
+ audioEnable(userId: string): boolean;
58
+ /**
59
+ * 检测用户是不是主持人
60
+ * @param {string} userId 用户id
61
+ */
62
+ checkIsMaster(userId: any): boolean;
63
+ /**
64
+ * 检测当前用户是否有主持人权限
65
+ */
66
+ checkLocalHasMaster(): any;
67
+ /**
68
+ * 检测目标用户是否有主持人权限
69
+ */
70
+ checkUserHasMaster(userId: string): boolean;
71
+ /**
72
+ * 根据用户id获取user对象
73
+ * @param {string} userId
74
+ */
75
+ getUser(userId: string): BMUser | undefined;
76
+ getAllUsers(pageIndex: number, allUsers: Map<string, BCUser>): Promise<void>;
77
+ /**
78
+ * 刚加入房间时初始化人数
79
+ */
80
+ initUserList(usersInRoom: Map<string, BCUser>): Promise<void>;
81
+ /**
82
+ * 改变userList中的主持人,返回改变后的主持人用户对象,该方法只在change-master中调用, 不对外暴露
83
+ * @param userId
84
+ * @param oldMasterId
85
+ * @param isKeep
86
+ */
87
+ updateMaster(userId: string, oldMasterId: string, isKeep: boolean): UpdateMasterType;
88
+ /**
89
+ * 联席主持人设置嘉宾的操作
90
+ * @param userId
91
+ */
92
+ managerChangeToGuest(userId: string): any;
93
+ /**
94
+ * 改变联席主持人,返回设置为联席主持人的bmuser对象
95
+ * @param userId
96
+ * @param status true:设置成联席主持人 false:取消联席主持人身份
97
+ * @param hasS
98
+ * @returns
99
+ */
100
+ updateManager(userId: string, status: boolean, hasS?: boolean): BMUser;
101
+ /**
102
+ * 获取我自己
103
+ */
104
+ getLocalUser(): BMUser;
105
+ updateSelf(bcUser: BCUser): void;
106
+ updateUser(bmUser: BMUser, bcUser: BCUser): void;
107
+ /**
108
+ * bcUser变成BMUser
109
+ * @param bcUser
110
+ * @returns
111
+ */
112
+ toBMUser(bcUser: BCUser): BMUser;
113
+ private sortUsers;
114
+ private sortAudiences;
115
+ private sortCommonUsers;
116
+ private sortSignalUsers;
117
+ private static filterUsers;
118
+ /**
119
+ * 排序变化之后的处理逻辑
120
+ */
121
+ updateSort: () => void;
122
+ /**
123
+ * 初始化所有的用户
124
+ * @param total
125
+ */
126
+ initUsers(total: number): Promise<void>;
127
+ /**
128
+ * 本地嘉宾用户降级为普通参会者之后要取消拉流
129
+ */
130
+ handleUnSubCommonUser(): void;
131
+ handleCommonUserChange(): void;
132
+ getUsers(page: number, pageSize: number, permission?: string): Promise<{
133
+ userList: BMUser[];
134
+ total: number;
135
+ }>;
136
+ getTotalUserNumber(): Promise<number>;
137
+ clearUsers(): void;
138
+ }