@hysc/meeting 5.0.27 → 5.0.28

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.
@@ -11,6 +11,7 @@ import BMStreamModel, { ConnectErrorMessage } from '../BMStream/BMStreamModel';
11
11
  import BMUser from '../BMUser/BMUser';
12
12
  import BMLiveVM from './BMLiveVM';
13
13
  import SingletonQueue, { PullItem } from "../SingletonQueue/SingletonQueue";
14
+ import AudioPlay from "../audioPlay/AudioPlay";
14
15
  interface BMRoomProps {
15
16
  initDevices: boolean;
16
17
  }
@@ -99,6 +100,7 @@ export default class BMRoom {
99
100
  brtc: boolean;
100
101
  };
101
102
  brtcNetEnableWatcher: Subject<boolean>;
103
+ audioPlayer: AudioPlay;
102
104
  get isSingleColumns(): boolean;
103
105
  /**
104
106
  * 传递信息用的,主要是用于message信令往上层业务发送消息
@@ -110,6 +112,7 @@ export default class BMRoom {
110
112
  isInWaitRoom: boolean;
111
113
  constructor({ initDevices }?: BMRoomProps);
112
114
  handleReprocessStreamError: () => void;
115
+ initAudioPlayer(playerContainerId: string): void;
113
116
  /**
114
117
  * 初始化底层会控相关
115
118
  * @param options
@@ -36,8 +36,12 @@ export default class BMStreamModelVM {
36
36
  localModel: BMStreamModel | null;
37
37
  room: BMRoom | null;
38
38
  bloudStream: any;
39
- audioStream: SingleLocalStream | undefined;
40
39
  brtcStream: SingleLocalStream | undefined;
40
+ /**
41
+ * 后面打开摄像头存储的流,主要是关闭摄像头的时候得把它清除掉
42
+ */
43
+ videoStream: SingleLocalStream | null;
44
+ audioStream: SingleLocalStream | null;
41
45
  /**
42
46
  * 本地是否在屏幕共享
43
47
  */
@@ -50,10 +54,6 @@ export default class BMStreamModelVM {
50
54
  */
51
55
  mixStreamModelWatcher: BehaviorSubject<BMStreamModel | null>;
52
56
  canvasTimer: NodeJS.Timeout | null;
53
- /**
54
- * 后面打开摄像头存储的流,主要是关闭摄像头的时候得把它清除掉
55
- */
56
- videoStream: SingleLocalStream | null;
57
57
  private _recorder;
58
58
  private _isRecording;
59
59
  private _slicingRecord;
@@ -6,9 +6,17 @@
6
6
  * @update: 2023-06-08 16:35
7
7
  */
8
8
  import { SingleStream } from "../type";
9
+ import { AudioPlayer } from '@hysc/core';
9
10
  export default class AudioPlay {
10
11
  playMap: WeakSet<SingleStream>;
11
- audioCtx: AudioContext;
12
+ playerMap: Map<string, AudioPlayer>;
13
+ container: HTMLDivElement | undefined;
14
+ muted: boolean;
15
+ constructor(containerId: string);
12
16
  addStream(stream: SingleStream): void;
13
- play(stream: SingleStream): void;
17
+ removeStream(stream: SingleStream): void;
18
+ play(stream: SingleStream): Promise<void>;
19
+ mute(mute: boolean): void;
20
+ setVolume(streamId: string, volume: number): void;
21
+ setDevice(deviceId: string): void;
14
22
  }
@@ -113,3 +113,4 @@ export declare const BIND_BIG_ELEMENT = "bind-big-element";
113
113
  export declare const NO_CONTAINER = "no-container";
114
114
  export declare const MODEL_SORT_NUM_CHANGE = "model-sort-num-change";
115
115
  export declare const ADD_PULL_USER = "add-pull-user";
116
+ export declare const SET_VOLUME = "set-volume";
@@ -1,5 +1,5 @@
1
1
  import { ConnectErrorMessage, NoPlayerContainer, SubscribeMessage } from "../BMStream/BMStreamModel";
2
- import { ADD_PULL_USER, BIND_BIG_ELEMENT, BIND_ELEMENT, CHANG_IS_GUEST, HANDLE_STREAM_CONNECT_ERROR, MANUAL_SUBSCRIPTION, MODEL_SORT_NUM_CHANGE, NO_CONTAINER, RAISE_HAND, RECEIVE_SUBSCRIBE_MESSAGE, UNSUBSCRIBE_STREAM, USER_SORT_NUM_CHANGE } from "../constants";
2
+ import { ADD_PULL_USER, BIND_BIG_ELEMENT, BIND_ELEMENT, CHANG_IS_GUEST, HANDLE_STREAM_CONNECT_ERROR, MANUAL_SUBSCRIPTION, MODEL_SORT_NUM_CHANGE, NO_CONTAINER, RAISE_HAND, RECEIVE_SUBSCRIBE_MESSAGE, SET_VOLUME, UNSUBSCRIBE_STREAM, USER_SORT_NUM_CHANGE } from "../constants";
3
3
  import { RaiseHandInfo } from "../BMUser/BMUser";
4
4
  import { ChangeIsGuest } from "../BMUser/BMUserVM";
5
5
  import { PullItem } from "../SingletonQueue/SingletonQueue";
@@ -7,6 +7,10 @@ export declare type UserSortType = {
7
7
  isCommon: boolean;
8
8
  shouldDelay: boolean;
9
9
  };
10
+ export declare type VolumeInfo = {
11
+ streamId: string;
12
+ volume: number;
13
+ };
10
14
  declare type Events = {
11
15
  [RECEIVE_SUBSCRIBE_MESSAGE]: SubscribeMessage;
12
16
  [USER_SORT_NUM_CHANGE]: UserSortType;
@@ -20,6 +24,7 @@ declare type Events = {
20
24
  [NO_CONTAINER]: NoPlayerContainer;
21
25
  [MODEL_SORT_NUM_CHANGE]: null;
22
26
  [ADD_PULL_USER]: PullItem;
27
+ [SET_VOLUME]: VolumeInfo;
23
28
  };
24
29
  export declare const emitter: import("mitt").Emitter<Events>;
25
30
  export declare const removeEmitter: () => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hysc/meeting",
3
- "version": "5.0.27",
3
+ "version": "5.0.28",
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": "5.0.25",
17
+ "@hysc/core": "5.0.26",
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.3"
24
24
  },
25
25
  "peerDependencies": {
26
- "@hysc/core": "5.0.25"
26
+ "@hysc/core": "5.0.26"
27
27
  },
28
28
  "devDependencies": {
29
29
  "@types/lodash-es": "^4.17.6"
@@ -36,8 +36,12 @@ export default class BMStreamModelVM {
36
36
  localModel: BMStreamModel | null;
37
37
  room: BMRoom | null;
38
38
  bloudStream: any;
39
- audioStream: SingleLocalStream | undefined;
40
39
  brtcStream: SingleLocalStream | undefined;
40
+ /**
41
+ * 后面打开摄像头存储的流,主要是关闭摄像头的时候得把它清除掉
42
+ */
43
+ videoStream: SingleLocalStream | null;
44
+ audioStream: SingleLocalStream | null;
41
45
  /**
42
46
  * 本地是否在屏幕共享
43
47
  */
@@ -50,10 +54,6 @@ export default class BMStreamModelVM {
50
54
  */
51
55
  mixStreamModelWatcher: BehaviorSubject<BMStreamModel | null>;
52
56
  canvasTimer: NodeJS.Timeout | null;
53
- /**
54
- * 后面打开摄像头存储的流,主要是关闭摄像头的时候得把它清除掉
55
- */
56
- videoStream: SingleLocalStream | null;
57
57
  private _recorder;
58
58
  private _isRecording;
59
59
  private _slicingRecord;
@@ -6,9 +6,17 @@
6
6
  * @update: 2023-06-08 16:35
7
7
  */
8
8
  import { SingleStream } from "../type";
9
+ import { AudioPlayer } from '@hysc/core';
9
10
  export default class AudioPlay {
10
11
  playMap: WeakSet<SingleStream>;
11
- audioCtx: AudioContext;
12
+ playerMap: Map<string, AudioPlayer>;
13
+ container: HTMLDivElement | undefined;
14
+ muted: boolean;
15
+ constructor(containerId: string);
12
16
  addStream(stream: SingleStream): void;
13
- play(stream: SingleStream): void;
17
+ removeStream(stream: SingleStream): void;
18
+ play(stream: SingleStream): Promise<void>;
19
+ mute(mute: boolean): void;
20
+ setVolume(streamId: string, volume: number): void;
21
+ setDevice(deviceId: string): void;
14
22
  }
@@ -113,3 +113,4 @@ export declare const BIND_BIG_ELEMENT = "bind-big-element";
113
113
  export declare const NO_CONTAINER = "no-container";
114
114
  export declare const MODEL_SORT_NUM_CHANGE = "model-sort-num-change";
115
115
  export declare const ADD_PULL_USER = "add-pull-user";
116
+ export declare const SET_VOLUME = "set-volume";
@@ -1,5 +1,5 @@
1
1
  import { ConnectErrorMessage, NoPlayerContainer, SubscribeMessage } from "../BMStream/BMStreamModel";
2
- import { ADD_PULL_USER, BIND_BIG_ELEMENT, BIND_ELEMENT, CHANG_IS_GUEST, HANDLE_STREAM_CONNECT_ERROR, MANUAL_SUBSCRIPTION, MODEL_SORT_NUM_CHANGE, NO_CONTAINER, RAISE_HAND, RECEIVE_SUBSCRIBE_MESSAGE, UNSUBSCRIBE_STREAM, USER_SORT_NUM_CHANGE } from "../constants";
2
+ import { ADD_PULL_USER, BIND_BIG_ELEMENT, BIND_ELEMENT, CHANG_IS_GUEST, HANDLE_STREAM_CONNECT_ERROR, MANUAL_SUBSCRIPTION, MODEL_SORT_NUM_CHANGE, NO_CONTAINER, RAISE_HAND, RECEIVE_SUBSCRIBE_MESSAGE, SET_VOLUME, UNSUBSCRIBE_STREAM, USER_SORT_NUM_CHANGE } from "../constants";
3
3
  import { RaiseHandInfo } from "../BMUser/BMUser";
4
4
  import { ChangeIsGuest } from "../BMUser/BMUserVM";
5
5
  import { PullItem } from "../SingletonQueue/SingletonQueue";
@@ -7,6 +7,10 @@ export declare type UserSortType = {
7
7
  isCommon: boolean;
8
8
  shouldDelay: boolean;
9
9
  };
10
+ export declare type VolumeInfo = {
11
+ streamId: string;
12
+ volume: number;
13
+ };
10
14
  declare type Events = {
11
15
  [RECEIVE_SUBSCRIBE_MESSAGE]: SubscribeMessage;
12
16
  [USER_SORT_NUM_CHANGE]: UserSortType;
@@ -20,6 +24,7 @@ declare type Events = {
20
24
  [NO_CONTAINER]: NoPlayerContainer;
21
25
  [MODEL_SORT_NUM_CHANGE]: null;
22
26
  [ADD_PULL_USER]: PullItem;
27
+ [SET_VOLUME]: VolumeInfo;
23
28
  };
24
29
  export declare const emitter: import("mitt").Emitter<Events>;
25
30
  export declare const removeEmitter: () => void;