@100mslive/react-native-hms 0.9.91 → 0.9.93
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/README.md +13 -7
- package/android/src/main/java/com/reactnativehmssdk/HMSRNSDK.kt +1 -1
- package/ios/HMSDecoder.swift +21 -24
- package/ios/HMSHelper.swift +42 -8
- package/ios/HMSManager.m +11 -0
- package/ios/HMSManager.swift +87 -18
- package/ios/HMSRNSDK.swift +308 -119
- package/ios/HMSView.swift +3 -4
- package/lib/commonjs/classes/HMSAudioFilePlayerNode.js +87 -0
- package/lib/commonjs/classes/HMSAudioFilePlayerNode.js.map +1 -0
- package/lib/commonjs/classes/HMSAudioMixerSource.js +26 -0
- package/lib/commonjs/classes/HMSAudioMixerSource.js.map +1 -0
- package/lib/commonjs/classes/HMSAudioNode.js +26 -0
- package/lib/commonjs/classes/HMSAudioNode.js.map +1 -0
- package/lib/commonjs/classes/HMSAudioTrackSettings.js +6 -0
- package/lib/commonjs/classes/HMSAudioTrackSettings.js.map +1 -1
- package/lib/commonjs/classes/HMSEncoder.js +3 -2
- package/lib/commonjs/classes/HMSEncoder.js.map +1 -1
- package/lib/commonjs/classes/HMSException.js +7 -0
- package/lib/commonjs/classes/HMSException.js.map +1 -1
- package/lib/commonjs/classes/HMSMicNode.js +35 -0
- package/lib/commonjs/classes/HMSMicNode.js.map +1 -0
- package/lib/commonjs/classes/HMSSDK.js +22 -34
- package/lib/commonjs/classes/HMSSDK.js.map +1 -1
- package/lib/commonjs/classes/HMSScreenBroadcastAudioReceiverNode.js +18 -0
- package/lib/commonjs/classes/HMSScreenBroadcastAudioReceiverNode.js.map +1 -0
- package/lib/commonjs/index.js +70 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/classes/HMSAudioFilePlayerNode.js +75 -0
- package/lib/module/classes/HMSAudioFilePlayerNode.js.map +1 -0
- package/lib/module/classes/HMSAudioMixerSource.js +17 -0
- package/lib/module/classes/HMSAudioMixerSource.js.map +1 -0
- package/lib/module/classes/HMSAudioNode.js +17 -0
- package/lib/module/classes/HMSAudioNode.js.map +1 -0
- package/lib/module/classes/HMSAudioTrackSettings.js +6 -0
- package/lib/module/classes/HMSAudioTrackSettings.js.map +1 -1
- package/lib/module/classes/HMSEncoder.js +3 -2
- package/lib/module/classes/HMSEncoder.js.map +1 -1
- package/lib/module/classes/HMSException.js +7 -0
- package/lib/module/classes/HMSException.js.map +1 -1
- package/lib/module/classes/HMSMicNode.js +23 -0
- package/lib/module/classes/HMSMicNode.js.map +1 -0
- package/lib/module/classes/HMSSDK.js +21 -33
- package/lib/module/classes/HMSSDK.js.map +1 -1
- package/lib/module/classes/HMSScreenBroadcastAudioReceiverNode.js +8 -0
- package/lib/module/classes/HMSScreenBroadcastAudioReceiverNode.js.map +1 -0
- package/lib/module/index.js +5 -0
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/classes/HMSAudioFilePlayerNode.d.ts +12 -0
- package/lib/typescript/classes/HMSAudioMixerSource.d.ts +8 -0
- package/lib/typescript/classes/HMSAudioNode.d.ts +6 -0
- package/lib/typescript/classes/HMSAudioTrackSettings.d.ts +4 -2
- package/lib/typescript/classes/HMSException.d.ts +8 -6
- package/lib/typescript/classes/HMSMicNode.d.ts +5 -0
- package/lib/typescript/classes/HMSSDK.d.ts +28 -26
- package/lib/typescript/classes/HMSScreenBroadcastAudioReceiverNode.d.ts +4 -0
- package/lib/typescript/index.d.ts +5 -0
- package/package.json +1 -1
- package/react-native-hms.podspec +2 -1
- package/src/classes/HMSAudioFilePlayerNode.ts +75 -0
- package/src/classes/HMSAudioMixerSource.ts +15 -0
- package/src/classes/HMSAudioNode.ts +12 -0
- package/src/classes/HMSAudioTrackSettings.ts +7 -4
- package/src/classes/HMSEncoder.ts +1 -0
- package/src/classes/HMSException.ts +9 -6
- package/src/classes/HMSMicNode.ts +23 -0
- package/src/classes/HMSSDK.tsx +47 -58
- package/src/classes/HMSScreenBroadcastAudioReceiverNode.ts +7 -0
- package/src/index.ts +5 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ViewStyle } from 'react-native';
|
|
3
|
+
import { HMSTrackType } from './HMSTrackType';
|
|
3
4
|
import { HMSUpdateListenerActions } from './HMSUpdateListenerActions';
|
|
4
5
|
import type { HMSConfig } from './HMSConfig';
|
|
5
6
|
import type { HMSLocalPeer } from './HMSLocalPeer';
|
|
@@ -7,7 +8,6 @@ import type { HMSRemotePeer } from './HMSRemotePeer';
|
|
|
7
8
|
import type { HMSRoom } from './HMSRoom';
|
|
8
9
|
import type { HMSRole } from './HMSRole';
|
|
9
10
|
import type { HMSTrack } from './HMSTrack';
|
|
10
|
-
import { HMSTrackType } from './HMSTrackType';
|
|
11
11
|
import type { HMSLogger } from './HMSLogger';
|
|
12
12
|
import type { HMSPeer } from './HMSPeer';
|
|
13
13
|
import type { HMSVideoViewMode } from './HMSVideoViewMode';
|
|
@@ -31,27 +31,27 @@ export declare class HMSSDK {
|
|
|
31
31
|
knownRoles?: HMSRole[];
|
|
32
32
|
id: string;
|
|
33
33
|
private muteStatus;
|
|
34
|
-
appStateSubscription
|
|
35
|
-
onPreviewDelegate
|
|
36
|
-
onJoinDelegate
|
|
37
|
-
onRoomDelegate
|
|
38
|
-
onPeerDelegate
|
|
39
|
-
onTrackDelegate
|
|
40
|
-
onErrorDelegate
|
|
41
|
-
onMessageDelegate
|
|
42
|
-
onSpeakerDelegate
|
|
43
|
-
onReconnectingDelegate
|
|
44
|
-
onReconnectedDelegate
|
|
45
|
-
onRoleChangeRequestDelegate
|
|
46
|
-
onChangeTrackStateRequestDelegate
|
|
47
|
-
onRemovedFromRoomDelegate
|
|
48
|
-
onRtcStatsDelegate
|
|
49
|
-
onLocalAudioStatsDelegate
|
|
50
|
-
onLocalVideoStatsDelegate
|
|
51
|
-
onRemoteAudioStatsDelegate
|
|
52
|
-
onRemoteVideoStatsDelegate
|
|
53
|
-
onAudioDeviceChangedDelegate
|
|
54
|
-
constructor(
|
|
34
|
+
private appStateSubscription?;
|
|
35
|
+
private onPreviewDelegate?;
|
|
36
|
+
private onJoinDelegate?;
|
|
37
|
+
private onRoomDelegate?;
|
|
38
|
+
private onPeerDelegate?;
|
|
39
|
+
private onTrackDelegate?;
|
|
40
|
+
private onErrorDelegate?;
|
|
41
|
+
private onMessageDelegate?;
|
|
42
|
+
private onSpeakerDelegate?;
|
|
43
|
+
private onReconnectingDelegate?;
|
|
44
|
+
private onReconnectedDelegate?;
|
|
45
|
+
private onRoleChangeRequestDelegate?;
|
|
46
|
+
private onChangeTrackStateRequestDelegate?;
|
|
47
|
+
private onRemovedFromRoomDelegate?;
|
|
48
|
+
private onRtcStatsDelegate?;
|
|
49
|
+
private onLocalAudioStatsDelegate?;
|
|
50
|
+
private onLocalVideoStatsDelegate?;
|
|
51
|
+
private onRemoteAudioStatsDelegate?;
|
|
52
|
+
private onRemoteVideoStatsDelegate?;
|
|
53
|
+
private onAudioDeviceChangedDelegate?;
|
|
54
|
+
private constructor();
|
|
55
55
|
/**
|
|
56
56
|
* - Returns an instance of [HMSSDK]{@link HMSSDK}
|
|
57
57
|
* - This function must be called to get an instance of HMSSDK class and only then user can interact with its methods.
|
|
@@ -61,7 +61,9 @@ export declare class HMSSDK {
|
|
|
61
61
|
* @memberof HMSSDK
|
|
62
62
|
*/
|
|
63
63
|
static build(params?: {
|
|
64
|
-
trackSettings
|
|
64
|
+
trackSettings?: HMSTrackSettings;
|
|
65
|
+
appGroup?: String;
|
|
66
|
+
preferredExtension?: String;
|
|
65
67
|
}): Promise<HMSSDK>;
|
|
66
68
|
/**
|
|
67
69
|
* - Returns the instance of logger which can be used to manipulate log levels.
|
|
@@ -186,7 +188,7 @@ export declare class HMSSDK {
|
|
|
186
188
|
*
|
|
187
189
|
* - it is advised to use a json object in string format to store multiple dataPoints in metadata.
|
|
188
190
|
*
|
|
189
|
-
* checkout {@link https://www.100ms.live/docs/react-native/v2/features/change-metadata} for more info
|
|
191
|
+
* checkout {@link https://www.100ms.live/docs/react-native/v2/advanced-features/change-metadata} for more info
|
|
190
192
|
*
|
|
191
193
|
* @param {string}
|
|
192
194
|
* @memberof HMSSDK
|
|
@@ -318,7 +320,7 @@ export declare class HMSSDK {
|
|
|
318
320
|
* - getRoom is a wrapper function on an existing native function also known as getRoom the returns
|
|
319
321
|
* current room object which is of type {@link HMSRoom}
|
|
320
322
|
*
|
|
321
|
-
* checkout {@link https://www.100ms.live/docs/react-native/v2/features/room} for more info
|
|
323
|
+
* checkout {@link https://www.100ms.live/docs/react-native/v2/features/join#get-room} for more info
|
|
322
324
|
*
|
|
323
325
|
* @memberof HMSSDK
|
|
324
326
|
* @return HMSRoom
|
|
@@ -327,7 +329,7 @@ export declare class HMSSDK {
|
|
|
327
329
|
/**
|
|
328
330
|
* - This function sets the volume of any peer in the room
|
|
329
331
|
*
|
|
330
|
-
* checkout {@link https://www.100ms.live/docs/react-native/v2/features/set-volume} for more info
|
|
332
|
+
* checkout {@link https://www.100ms.live/docs/react-native/v2/advanced-features/set-volume} for more info
|
|
331
333
|
*
|
|
332
334
|
* @memberof HMSSDK
|
|
333
335
|
*/
|
|
@@ -65,5 +65,10 @@ export * from './classes/HMSRtmpVideoResolution';
|
|
|
65
65
|
export * from './classes/HMSAudioDevice';
|
|
66
66
|
export * from './classes/HMSAudioMode';
|
|
67
67
|
export * from './classes/HMSAudioMixingMode';
|
|
68
|
+
export * from './classes/HMSAudioNode';
|
|
69
|
+
export * from './classes/HMSMicNode';
|
|
70
|
+
export * from './classes/HMSScreenBroadcastAudioReceiverNode';
|
|
71
|
+
export * from './classes/HMSAudioFilePlayerNode';
|
|
72
|
+
export * from './classes/HMSAudioMixerSource';
|
|
68
73
|
import { HMSSDK as HmsManager } from './classes/HMSSDK';
|
|
69
74
|
export default HmsManager;
|
package/package.json
CHANGED
package/react-native-hms.podspec
CHANGED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { NativeModules } from 'react-native';
|
|
2
|
+
import { HMSAudioNode } from './HMSAudioNode';
|
|
3
|
+
|
|
4
|
+
const {
|
|
5
|
+
/**
|
|
6
|
+
* @ignore
|
|
7
|
+
*/
|
|
8
|
+
HMSManager,
|
|
9
|
+
} = NativeModules;
|
|
10
|
+
|
|
11
|
+
export class HMSAudioFilePlayerNode extends HMSAudioNode {
|
|
12
|
+
constructor(name: string) {
|
|
13
|
+
super(name);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
setVolume(volume: number) {
|
|
17
|
+
HMSManager.setAudioShareVolume({
|
|
18
|
+
id: this.sdkId,
|
|
19
|
+
audioNode: this.name,
|
|
20
|
+
volume,
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
async play(fileUrl: string, loops?: boolean, interrupts?: boolean) {
|
|
25
|
+
return await HMSManager.playAudioShare({
|
|
26
|
+
id: this.sdkId,
|
|
27
|
+
audioNode: this.name,
|
|
28
|
+
fileUrl,
|
|
29
|
+
loops,
|
|
30
|
+
interrupts,
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
pause() {
|
|
35
|
+
HMSManager.pauseAudioShare({
|
|
36
|
+
id: this.sdkId,
|
|
37
|
+
audioNode: this.name,
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
resume() {
|
|
42
|
+
HMSManager.resumeAudioShare({
|
|
43
|
+
id: this.sdkId,
|
|
44
|
+
audioNode: this.name,
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
stop() {
|
|
49
|
+
HMSManager.stopAudioShare({
|
|
50
|
+
id: this.sdkId,
|
|
51
|
+
audioNode: this.name,
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
async isPlaying() {
|
|
56
|
+
return await HMSManager.audioShareIsPlaying({
|
|
57
|
+
id: this.sdkId,
|
|
58
|
+
audioNode: this.name,
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
async currentDuration() {
|
|
63
|
+
return await HMSManager.audioShareCurrentTime({
|
|
64
|
+
id: this.sdkId,
|
|
65
|
+
audioNode: this.name,
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
async duration() {
|
|
70
|
+
return await HMSManager.audioShareDuration({
|
|
71
|
+
id: this.sdkId,
|
|
72
|
+
audioNode: this.name,
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { HMSAudioNode } from './HMSAudioNode';
|
|
2
|
+
|
|
3
|
+
export class HMSAudioMixerSource {
|
|
4
|
+
node: HMSAudioNode[];
|
|
5
|
+
|
|
6
|
+
constructor(params: { node: HMSAudioNode[] }) {
|
|
7
|
+
this.node = params.node;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
toList(): string[] {
|
|
11
|
+
const nodeName: string[] = [];
|
|
12
|
+
this.node.forEach((audioNode) => nodeName.push(audioNode.toString()));
|
|
13
|
+
return nodeName;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
import type { HMSAudioCodec } from './HMSAudioCodec';
|
|
2
2
|
|
|
3
3
|
export class HMSAudioTrackSettings {
|
|
4
|
-
maxBitrate
|
|
5
|
-
trackDescription?: string;
|
|
6
|
-
|
|
4
|
+
maxBitrate: number;
|
|
5
|
+
trackDescription?: string; // ios only
|
|
6
|
+
audioSource?: string[]; // ios only
|
|
7
|
+
codec?: HMSAudioCodec; // android only
|
|
7
8
|
constructor(params: {
|
|
8
9
|
maxBitrate: number;
|
|
9
10
|
trackDescription?: string;
|
|
10
|
-
|
|
11
|
+
audioSource?: string[];
|
|
12
|
+
codec?: HMSAudioCodec;
|
|
11
13
|
}) {
|
|
12
14
|
this.maxBitrate = params.maxBitrate;
|
|
13
15
|
this.trackDescription = params.trackDescription;
|
|
16
|
+
this.audioSource = params.audioSource;
|
|
14
17
|
this.codec = params.codec;
|
|
15
18
|
}
|
|
16
19
|
}
|
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
export class HMSException {
|
|
2
2
|
code: number;
|
|
3
3
|
description: string;
|
|
4
|
-
message
|
|
5
|
-
name
|
|
6
|
-
action
|
|
4
|
+
message?: string; // `message` is available only on Android
|
|
5
|
+
name?: string; // `name` is available only on Android
|
|
6
|
+
action?: string; // `action` is available only on Android
|
|
7
7
|
isTerminal: boolean;
|
|
8
|
+
canRetry?: boolean; // `canRetry` is available only on Android
|
|
8
9
|
|
|
9
10
|
constructor(params: {
|
|
10
11
|
code: number;
|
|
11
12
|
description: string;
|
|
12
|
-
message
|
|
13
|
-
name
|
|
14
|
-
action
|
|
13
|
+
message?: string;
|
|
14
|
+
name?: string;
|
|
15
|
+
action?: string;
|
|
15
16
|
isTerminal: boolean;
|
|
17
|
+
canRetry?: boolean;
|
|
16
18
|
}) {
|
|
17
19
|
this.code = params.code;
|
|
18
20
|
this.description = params.description;
|
|
@@ -20,5 +22,6 @@ export class HMSException {
|
|
|
20
22
|
this.name = params.name;
|
|
21
23
|
this.action = params.action;
|
|
22
24
|
this.isTerminal = params.isTerminal;
|
|
25
|
+
this.canRetry = params.canRetry;
|
|
23
26
|
}
|
|
24
27
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { NativeModules } from 'react-native';
|
|
2
|
+
import { HMSAudioNode } from './HMSAudioNode';
|
|
3
|
+
|
|
4
|
+
const {
|
|
5
|
+
/**
|
|
6
|
+
* @ignore
|
|
7
|
+
*/
|
|
8
|
+
HMSManager,
|
|
9
|
+
} = NativeModules;
|
|
10
|
+
|
|
11
|
+
export class HMSMicNode extends HMSAudioNode {
|
|
12
|
+
constructor() {
|
|
13
|
+
super('mic_node');
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
setVolume(volume: number) {
|
|
17
|
+
return HMSManager.setAudioShareVolume({
|
|
18
|
+
id: this.sdkId,
|
|
19
|
+
audioNode: this.name,
|
|
20
|
+
volume,
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
}
|
package/src/classes/HMSSDK.tsx
CHANGED
|
@@ -1,27 +1,23 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
NativeModules,
|
|
5
|
-
Platform,
|
|
6
|
-
ViewStyle,
|
|
7
|
-
AppState,
|
|
8
|
-
} from 'react-native';
|
|
9
|
-
import { HMSUpdateListenerActions } from './HMSUpdateListenerActions';
|
|
2
|
+
import { AppState, NativeEventEmitter, NativeModules, Platform, ViewStyle } from 'react-native';
|
|
3
|
+
|
|
10
4
|
import { HMSEncoder } from './HMSEncoder';
|
|
11
5
|
import { HMSHelper } from './HMSHelper';
|
|
12
|
-
import { HmsViewComponent } from './HmsView';
|
|
13
6
|
import { HMSLocalAudioStats } from './HMSLocalAudioStats';
|
|
14
7
|
import { HMSLocalVideoStats } from './HMSLocalVideoStats';
|
|
15
|
-
import {
|
|
8
|
+
import { getLogger, logger, setLogger } from './HMSLogger';
|
|
16
9
|
import { HMSRemoteAudioStats } from './HMSRemoteAudioStats';
|
|
17
|
-
import {
|
|
10
|
+
import { HMSRemoteVideoStats } from './HMSRemoteVideoStats';
|
|
11
|
+
import { HMSTrackType } from './HMSTrackType';
|
|
12
|
+
import { HMSUpdateListenerActions } from './HMSUpdateListenerActions';
|
|
13
|
+
import { HmsViewComponent } from './HmsView';
|
|
14
|
+
|
|
18
15
|
import type { HMSConfig } from './HMSConfig';
|
|
19
16
|
import type { HMSLocalPeer } from './HMSLocalPeer';
|
|
20
17
|
import type { HMSRemotePeer } from './HMSRemotePeer';
|
|
21
18
|
import type { HMSRoom } from './HMSRoom';
|
|
22
19
|
import type { HMSRole } from './HMSRole';
|
|
23
20
|
import type { HMSTrack } from './HMSTrack';
|
|
24
|
-
import { HMSTrackType } from './HMSTrackType';
|
|
25
21
|
import type { HMSLogger } from './HMSLogger';
|
|
26
22
|
import type { HMSPeer } from './HMSPeer';
|
|
27
23
|
import type { HMSVideoViewMode } from './HMSVideoViewMode';
|
|
@@ -58,29 +54,29 @@ export class HMSSDK {
|
|
|
58
54
|
knownRoles?: HMSRole[];
|
|
59
55
|
id: string;
|
|
60
56
|
private muteStatus: boolean | undefined;
|
|
61
|
-
appStateSubscription?: any;
|
|
62
|
-
|
|
63
|
-
onPreviewDelegate?: any;
|
|
64
|
-
onJoinDelegate?: any;
|
|
65
|
-
onRoomDelegate?: any;
|
|
66
|
-
onPeerDelegate?: any;
|
|
67
|
-
onTrackDelegate?: any;
|
|
68
|
-
onErrorDelegate?: any;
|
|
69
|
-
onMessageDelegate?: any;
|
|
70
|
-
onSpeakerDelegate?: any;
|
|
71
|
-
onReconnectingDelegate?: any;
|
|
72
|
-
onReconnectedDelegate?: any;
|
|
73
|
-
onRoleChangeRequestDelegate?: any;
|
|
74
|
-
onChangeTrackStateRequestDelegate?: any;
|
|
75
|
-
onRemovedFromRoomDelegate?: any;
|
|
76
|
-
onRtcStatsDelegate?: any;
|
|
77
|
-
onLocalAudioStatsDelegate?: any;
|
|
78
|
-
onLocalVideoStatsDelegate?: any;
|
|
79
|
-
onRemoteAudioStatsDelegate?: any;
|
|
80
|
-
onRemoteVideoStatsDelegate?: any;
|
|
81
|
-
onAudioDeviceChangedDelegate?: any;
|
|
82
|
-
|
|
83
|
-
constructor(id: string) {
|
|
57
|
+
private appStateSubscription?: any;
|
|
58
|
+
|
|
59
|
+
private onPreviewDelegate?: any;
|
|
60
|
+
private onJoinDelegate?: any;
|
|
61
|
+
private onRoomDelegate?: any;
|
|
62
|
+
private onPeerDelegate?: any;
|
|
63
|
+
private onTrackDelegate?: any;
|
|
64
|
+
private onErrorDelegate?: any;
|
|
65
|
+
private onMessageDelegate?: any;
|
|
66
|
+
private onSpeakerDelegate?: any;
|
|
67
|
+
private onReconnectingDelegate?: any;
|
|
68
|
+
private onReconnectedDelegate?: any;
|
|
69
|
+
private onRoleChangeRequestDelegate?: any;
|
|
70
|
+
private onChangeTrackStateRequestDelegate?: any;
|
|
71
|
+
private onRemovedFromRoomDelegate?: any;
|
|
72
|
+
private onRtcStatsDelegate?: any;
|
|
73
|
+
private onLocalAudioStatsDelegate?: any;
|
|
74
|
+
private onLocalVideoStatsDelegate?: any;
|
|
75
|
+
private onRemoteAudioStatsDelegate?: any;
|
|
76
|
+
private onRemoteVideoStatsDelegate?: any;
|
|
77
|
+
private onAudioDeviceChangedDelegate?: any;
|
|
78
|
+
|
|
79
|
+
private constructor(id: string) {
|
|
84
80
|
this.id = id;
|
|
85
81
|
}
|
|
86
82
|
|
|
@@ -92,8 +88,16 @@ export class HMSSDK {
|
|
|
92
88
|
* @returns
|
|
93
89
|
* @memberof HMSSDK
|
|
94
90
|
*/
|
|
95
|
-
static async build(params?: {
|
|
96
|
-
|
|
91
|
+
static async build(params?: {
|
|
92
|
+
trackSettings?: HMSTrackSettings;
|
|
93
|
+
appGroup?: String;
|
|
94
|
+
preferredExtension?: String;
|
|
95
|
+
}) {
|
|
96
|
+
let id = await HMSManager.build({
|
|
97
|
+
trackSettings: params?.trackSettings,
|
|
98
|
+
appGroup: params?.appGroup, // required for iOS Screenshare, not required for Android
|
|
99
|
+
preferredExtension: params?.preferredExtension, // required for iOS Screenshare, not required for Android
|
|
100
|
+
});
|
|
97
101
|
HmsSdk = new HMSSDK(id);
|
|
98
102
|
HmsSdk.attachPreviewListener();
|
|
99
103
|
HmsSdk.attachListeners();
|
|
@@ -520,7 +524,7 @@ export class HMSSDK {
|
|
|
520
524
|
*
|
|
521
525
|
* - it is advised to use a json object in string format to store multiple dataPoints in metadata.
|
|
522
526
|
*
|
|
523
|
-
* checkout {@link https://www.100ms.live/docs/react-native/v2/features/change-metadata} for more info
|
|
527
|
+
* checkout {@link https://www.100ms.live/docs/react-native/v2/advanced-features/change-metadata} for more info
|
|
524
528
|
*
|
|
525
529
|
* @param {string}
|
|
526
530
|
* @memberof HMSSDK
|
|
@@ -778,7 +782,7 @@ export class HMSSDK {
|
|
|
778
782
|
* - getRoom is a wrapper function on an existing native function also known as getRoom the returns
|
|
779
783
|
* current room object which is of type {@link HMSRoom}
|
|
780
784
|
*
|
|
781
|
-
* checkout {@link https://www.100ms.live/docs/react-native/v2/features/room} for more info
|
|
785
|
+
* checkout {@link https://www.100ms.live/docs/react-native/v2/features/join#get-room} for more info
|
|
782
786
|
*
|
|
783
787
|
* @memberof HMSSDK
|
|
784
788
|
* @return HMSRoom
|
|
@@ -797,7 +801,7 @@ export class HMSSDK {
|
|
|
797
801
|
/**
|
|
798
802
|
* - This function sets the volume of any peer in the room
|
|
799
803
|
*
|
|
800
|
-
* checkout {@link https://www.100ms.live/docs/react-native/v2/features/set-volume} for more info
|
|
804
|
+
* checkout {@link https://www.100ms.live/docs/react-native/v2/advanced-features/set-volume} for more info
|
|
801
805
|
*
|
|
802
806
|
* @memberof HMSSDK
|
|
803
807
|
*/
|
|
@@ -847,12 +851,7 @@ export class HMSSDK {
|
|
|
847
851
|
*/
|
|
848
852
|
startScreenshare = async () => {
|
|
849
853
|
logger?.verbose('#Function startScreenshare', { id: this.id });
|
|
850
|
-
|
|
851
|
-
return await HMSManager.startScreenshare({ id: this.id });
|
|
852
|
-
} else {
|
|
853
|
-
console.log('API currently not available for iOS');
|
|
854
|
-
return 'API currently not available for iOS';
|
|
855
|
-
}
|
|
854
|
+
return await HMSManager.startScreenshare({ id: this.id });
|
|
856
855
|
};
|
|
857
856
|
|
|
858
857
|
/**
|
|
@@ -864,12 +863,7 @@ export class HMSSDK {
|
|
|
864
863
|
*/
|
|
865
864
|
isScreenShared = async () => {
|
|
866
865
|
logger?.verbose('#Function isScreenShared', { id: this.id });
|
|
867
|
-
|
|
868
|
-
return await HMSManager.isScreenShared({ id: this.id });
|
|
869
|
-
} else {
|
|
870
|
-
console.log('API currently not available for iOS');
|
|
871
|
-
return 'API currently not available for iOS';
|
|
872
|
-
}
|
|
866
|
+
return await HMSManager.isScreenShared({ id: this.id });
|
|
873
867
|
};
|
|
874
868
|
|
|
875
869
|
/**
|
|
@@ -881,12 +875,7 @@ export class HMSSDK {
|
|
|
881
875
|
*/
|
|
882
876
|
stopScreenshare = async () => {
|
|
883
877
|
logger?.verbose('#Function stopScreenshare', { id: this.id });
|
|
884
|
-
|
|
885
|
-
return await HMSManager.stopScreenshare({ id: this.id });
|
|
886
|
-
} else {
|
|
887
|
-
console.log('API currently not available for iOS');
|
|
888
|
-
return 'API currently not available for iOS';
|
|
889
|
-
}
|
|
878
|
+
return await HMSManager.stopScreenshare({ id: this.id });
|
|
890
879
|
};
|
|
891
880
|
|
|
892
881
|
/**
|
package/src/index.ts
CHANGED
|
@@ -65,6 +65,11 @@ export * from './classes/HMSRtmpVideoResolution';
|
|
|
65
65
|
export * from './classes/HMSAudioDevice';
|
|
66
66
|
export * from './classes/HMSAudioMode';
|
|
67
67
|
export * from './classes/HMSAudioMixingMode';
|
|
68
|
+
export * from './classes/HMSAudioNode';
|
|
69
|
+
export * from './classes/HMSMicNode';
|
|
70
|
+
export * from './classes/HMSScreenBroadcastAudioReceiverNode';
|
|
71
|
+
export * from './classes/HMSAudioFilePlayerNode';
|
|
72
|
+
export * from './classes/HMSAudioMixerSource';
|
|
68
73
|
|
|
69
74
|
import { HMSSDK as HmsManager } from './classes/HMSSDK';
|
|
70
75
|
export default HmsManager;
|