@100mslive/react-native-hms 1.10.7 → 1.10.8
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/android/src/main/java/com/reactnativehmssdk/HMSManager.kt +28 -6
- package/ios/HMSConstants.swift +1 -0
- package/ios/HMSManager.m +39 -0
- package/ios/HMSManager.swift +116 -1
- package/ios/HMSRNSDK.swift +270 -1
- package/ios/PIPMode/HMSPipModel.swift +18 -0
- package/ios/PIPMode/HMSPipView.swift +36 -0
- package/ios/PIPMode/HMSSampleBufferSwiftUIView.swift +45 -0
- package/lib/commonjs/classes/HMSPIPConfig.js +4 -0
- package/lib/commonjs/classes/HMSPIPConfig.js.map +1 -1
- package/lib/commonjs/classes/HMSSDK.js +52 -10
- package/lib/commonjs/classes/HMSSDK.js.map +1 -1
- package/lib/module/classes/HMSPIPConfig.js +1 -1
- package/lib/module/classes/HMSPIPConfig.js.map +1 -1
- package/lib/module/classes/HMSSDK.js +52 -10
- package/lib/module/classes/HMSSDK.js.map +1 -1
- package/lib/typescript/classes/HMSPIPConfig.d.ts +3 -0
- package/lib/typescript/classes/HMSSDK.d.ts +3 -0
- package/package.json +1 -1
- package/sdk-versions.json +2 -2
- package/src/classes/HMSPIPConfig.ts +30 -0
- package/src/classes/HMSSDK.tsx +58 -21
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
import type { HMSVideoViewMode } from './HMSVideoViewMode';
|
|
1
2
|
export interface HMSPIPConfig {
|
|
2
3
|
autoEnterPipMode?: boolean;
|
|
3
4
|
aspectRatio?: [number, number];
|
|
5
|
+
scaleType?: HMSVideoViewMode;
|
|
6
|
+
useActiveSpeaker?: boolean;
|
|
4
7
|
endButton?: boolean;
|
|
5
8
|
audioButton?: boolean;
|
|
6
9
|
videoButton?: boolean;
|
|
@@ -23,6 +23,7 @@ import { HMSPeerListIterator } from './HMSPeerListIterator';
|
|
|
23
23
|
import type { HMSPIPConfig } from './HMSPIPConfig';
|
|
24
24
|
import { HMSInteractivityCenter } from './HMSInteractivityCenter';
|
|
25
25
|
import type { HMSHLSTimedMetadata } from './HMSHLSTimedMetadata';
|
|
26
|
+
import type { HMSVideoTrack } from './HMSVideoTrack';
|
|
26
27
|
type HmsViewProps = Omit<HmsComponentProps, 'id'>;
|
|
27
28
|
export declare class HMSSDK {
|
|
28
29
|
id: string;
|
|
@@ -638,6 +639,8 @@ export declare class HMSSDK {
|
|
|
638
639
|
isPipModeSupported(): Promise<undefined | boolean>;
|
|
639
640
|
enterPipMode(data?: HMSPIPConfig): Promise<undefined | boolean>;
|
|
640
641
|
setPipParams(data?: HMSPIPConfig): Promise<undefined | boolean>;
|
|
642
|
+
changeIOSPIPVideoTrack(track: HMSVideoTrack): Promise<any>;
|
|
643
|
+
setActiveSpeakerInIOSPIP(enable: boolean): Promise<any>;
|
|
641
644
|
startRealTimeTranscription(): Promise<any>;
|
|
642
645
|
stopRealTimeTranscription(): Promise<any>;
|
|
643
646
|
get interactivityCenter(): HMSInteractivityCenter;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@100mslive/react-native-hms",
|
|
3
|
-
"version": "1.10.
|
|
3
|
+
"version": "1.10.8",
|
|
4
4
|
"description": "Integrate Real Time Audio and Video conferencing, Interactive Live Streaming, and Chat in your apps with 100ms React Native SDK. With support for HLS and RTMP Live Streaming and Recording, Picture-in-Picture (PiP), one-to-one Video Call Modes, Audio Rooms, Video Player and much more, add immersive real-time communications to your apps.",
|
|
5
5
|
"main": "lib/commonjs/index",
|
|
6
6
|
"module": "lib/module/index",
|
package/sdk-versions.json
CHANGED
|
@@ -1,7 +1,37 @@
|
|
|
1
|
+
import type { HMSVideoViewMode } from './HMSVideoViewMode';
|
|
2
|
+
|
|
1
3
|
export interface HMSPIPConfig {
|
|
4
|
+
/*
|
|
5
|
+
* Whether to automatically enter PIP mode when app enters background.
|
|
6
|
+
*/
|
|
2
7
|
autoEnterPipMode?: boolean;
|
|
8
|
+
|
|
9
|
+
/*
|
|
10
|
+
* The aspect ratio of the PIP window. Default is [9, 16]. Other values can be [3, 4], [1, 1], [4, 3], [16, 9].
|
|
11
|
+
*/
|
|
3
12
|
aspectRatio?: [number, number];
|
|
13
|
+
|
|
14
|
+
/*
|
|
15
|
+
* The scale type of the PIP window. Default is ASPECT_FILL. Other values can be ASPECT_FIT, ASPECT_BALANCED. iOS Only.
|
|
16
|
+
*/
|
|
17
|
+
scaleType?: HMSVideoViewMode;
|
|
18
|
+
|
|
19
|
+
/*
|
|
20
|
+
* Whether to show the Active Speaker in the PIP window. Default is true. iOS only.
|
|
21
|
+
*/
|
|
22
|
+
useActiveSpeaker?: boolean;
|
|
23
|
+
/*
|
|
24
|
+
* Whether to show the end button in the PIP window. Default is true. Android only.
|
|
25
|
+
*/
|
|
4
26
|
endButton?: boolean;
|
|
27
|
+
|
|
28
|
+
/*
|
|
29
|
+
* Whether to show the audio mute/unmute button in the PIP window. Default is true. Android only.
|
|
30
|
+
*/
|
|
5
31
|
audioButton?: boolean;
|
|
32
|
+
|
|
33
|
+
/*
|
|
34
|
+
* Whether to show the video mute/unmute button in the PIP window. Default is true. Android only.
|
|
35
|
+
*/
|
|
6
36
|
videoButton?: boolean;
|
|
7
37
|
}
|
package/src/classes/HMSSDK.tsx
CHANGED
|
@@ -18,7 +18,6 @@ import type { HMSRole } from './HMSRole';
|
|
|
18
18
|
import type { HMSTrack } from './HMSTrack';
|
|
19
19
|
import type { HMSLogger } from './HMSLogger';
|
|
20
20
|
import type { HMSPeer } from './HMSPeer';
|
|
21
|
-
import type { HMSVideoViewMode } from './HMSVideoViewMode';
|
|
22
21
|
import type { HMSTrackSettings } from './HMSTrackSettings';
|
|
23
22
|
import type { HMSRTMPConfig } from './HMSRTMPConfig';
|
|
24
23
|
import type { HMSHLSConfig } from './HMSHLSConfig';
|
|
@@ -48,6 +47,7 @@ import { HMSPeerListIterator } from './HMSPeerListIterator';
|
|
|
48
47
|
import type { HMSPIPConfig } from './HMSPIPConfig';
|
|
49
48
|
import { HMSInteractivityCenter } from './HMSInteractivityCenter';
|
|
50
49
|
import type { HMSHLSTimedMetadata } from './HMSHLSTimedMetadata';
|
|
50
|
+
import type { HMSVideoTrack } from './HMSVideoTrack';
|
|
51
51
|
|
|
52
52
|
type HmsViewProps = Omit<HmsComponentProps, 'id'>;
|
|
53
53
|
|
|
@@ -1673,26 +1673,21 @@ export class HMSSDK {
|
|
|
1673
1673
|
break;
|
|
1674
1674
|
}
|
|
1675
1675
|
case HMSPIPListenerActions.ON_PIP_MODE_CHANGED: {
|
|
1676
|
-
if
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
this.onPIPModeChangedListener
|
|
1688
|
-
);
|
|
1689
|
-
this.emitterSubscriptions[
|
|
1690
|
-
HMSPIPListenerActions.ON_PIP_MODE_CHANGED
|
|
1691
|
-
] = pipModeChangedSubscription;
|
|
1692
|
-
}
|
|
1693
|
-
// Adding PIP mode changed Delegate listener
|
|
1694
|
-
this.onPIPModeChangedDelegate = callback;
|
|
1676
|
+
// Checking if we already have ON_PIP_MODE_CHANGED subscription
|
|
1677
|
+
if (
|
|
1678
|
+
!this.emitterSubscriptions[HMSPIPListenerActions.ON_PIP_MODE_CHANGED]
|
|
1679
|
+
) {
|
|
1680
|
+
const pipModeChangedSubscription = HMSNativeEventListener.addListener(
|
|
1681
|
+
this.id,
|
|
1682
|
+
HMSPIPListenerActions.ON_PIP_MODE_CHANGED,
|
|
1683
|
+
this.onPIPModeChangedListener
|
|
1684
|
+
);
|
|
1685
|
+
this.emitterSubscriptions[HMSPIPListenerActions.ON_PIP_MODE_CHANGED] =
|
|
1686
|
+
pipModeChangedSubscription;
|
|
1695
1687
|
}
|
|
1688
|
+
// Adding PIP mode changed Delegate listener
|
|
1689
|
+
this.onPIPModeChangedDelegate = callback;
|
|
1690
|
+
|
|
1696
1691
|
break;
|
|
1697
1692
|
}
|
|
1698
1693
|
default:
|
|
@@ -2520,6 +2515,9 @@ export class HMSSDK {
|
|
|
2520
2515
|
}
|
|
2521
2516
|
};
|
|
2522
2517
|
|
|
2518
|
+
/*
|
|
2519
|
+
* - This listener is fired when Room is left from the Picture in Picture mode. Android only.
|
|
2520
|
+
*/
|
|
2523
2521
|
onPIPRoomLeaveListener = (data: { id: string }) => {
|
|
2524
2522
|
if (data.id !== this.id) {
|
|
2525
2523
|
return;
|
|
@@ -2535,6 +2533,9 @@ export class HMSSDK {
|
|
|
2535
2533
|
}
|
|
2536
2534
|
};
|
|
2537
2535
|
|
|
2536
|
+
/*
|
|
2537
|
+
* - Attach this listener to get notified when Picture in Picture mode is changed
|
|
2538
|
+
*/
|
|
2538
2539
|
onPIPModeChangedListener = (data: { isInPictureInPictureMode: boolean }) => {
|
|
2539
2540
|
if (this.onPIPModeChangedDelegate) {
|
|
2540
2541
|
logger?.verbose('#Listener onPIPModeChanged_CALL', data);
|
|
@@ -2543,17 +2544,29 @@ export class HMSSDK {
|
|
|
2543
2544
|
}
|
|
2544
2545
|
};
|
|
2545
2546
|
|
|
2547
|
+
/*
|
|
2548
|
+
* - This function is used to check if Picture in Picture mode is supported on the device
|
|
2549
|
+
*/
|
|
2546
2550
|
async isPipModeSupported(): Promise<undefined | boolean> {
|
|
2547
|
-
|
|
2551
|
+
const data = { id: this.id };
|
|
2552
|
+
logger?.verbose('#Function isPipModeSupported', data);
|
|
2553
|
+
return HMSManager.handlePipActions('isPipModeSupported', data);
|
|
2548
2554
|
}
|
|
2549
2555
|
|
|
2556
|
+
/*
|
|
2557
|
+
* - This function can be used to manually enter Picture in Picture mode
|
|
2558
|
+
*/
|
|
2550
2559
|
async enterPipMode(data?: HMSPIPConfig): Promise<undefined | boolean> {
|
|
2560
|
+
logger?.verbose('#Function enterPipMode', data);
|
|
2551
2561
|
return HMSManager.handlePipActions('enterPipMode', {
|
|
2552
2562
|
...data,
|
|
2553
2563
|
id: this.id,
|
|
2554
2564
|
});
|
|
2555
2565
|
}
|
|
2556
2566
|
|
|
2567
|
+
/*
|
|
2568
|
+
* - This function is to be used to configure the Picture in Picture window
|
|
2569
|
+
*/
|
|
2557
2570
|
async setPipParams(data?: HMSPIPConfig): Promise<undefined | boolean> {
|
|
2558
2571
|
return HMSManager.handlePipActions('setPictureInPictureParams', {
|
|
2559
2572
|
...data,
|
|
@@ -2561,6 +2574,30 @@ export class HMSSDK {
|
|
|
2561
2574
|
});
|
|
2562
2575
|
}
|
|
2563
2576
|
|
|
2577
|
+
/*
|
|
2578
|
+
* - Use this function to set Video Track for Picture in Picture mode. iOS Only.
|
|
2579
|
+
*/
|
|
2580
|
+
async changeIOSPIPVideoTrack(track: HMSVideoTrack) {
|
|
2581
|
+
const data = {
|
|
2582
|
+
id: this.id,
|
|
2583
|
+
trackId: track.trackId,
|
|
2584
|
+
};
|
|
2585
|
+
logger?.verbose('#Function changeIOSPIPVideoTrack', data);
|
|
2586
|
+
return await HMSManager.changeIOSPIPVideoTrack(data);
|
|
2587
|
+
}
|
|
2588
|
+
|
|
2589
|
+
/*
|
|
2590
|
+
* - Use this function to automatically show the current Active Speaker Peer video in the PIP Mode window. iOS Only.
|
|
2591
|
+
*/
|
|
2592
|
+
async setActiveSpeakerInIOSPIP(enable: boolean) {
|
|
2593
|
+
const data = {
|
|
2594
|
+
id: this.id,
|
|
2595
|
+
enable,
|
|
2596
|
+
};
|
|
2597
|
+
logger?.verbose('#Function setActiveSpeakerInIOSPIP', data);
|
|
2598
|
+
return await HMSManager.setActiveSpeakerInIOSPIP(data);
|
|
2599
|
+
}
|
|
2600
|
+
|
|
2564
2601
|
async startRealTimeTranscription() {
|
|
2565
2602
|
const data = {
|
|
2566
2603
|
id: this.id,
|