@100mslive/react-native-hms 1.10.3 → 1.10.5
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/build.gradle +9 -2
- package/android/local.properties +8 -1
- package/android/src/main/java/com/reactnativehmssdk/HMSDecoder.kt +11 -0
- package/android/src/main/java/com/reactnativehmssdk/HMSHLSPlayer.kt +94 -0
- package/android/src/main/java/com/reactnativehmssdk/HMSHLSPlayerManager.kt +32 -0
- package/android/src/main/java/com/reactnativehmssdk/HMSManager.kt +38 -0
- package/android/src/main/java/com/reactnativehmssdk/HMSRNSDK.kt +6 -4
- package/android/src/main/java/com/reactnativehmssdk/Interactivity/HMSInteractivityDecoder.kt +50 -25
- package/android/src/main/java/com/reactnativehmssdk/Interactivity/HMSRNInteractivityCenter.kt +69 -1
- package/ios/HMSConstants.swift +1 -0
- package/ios/HMSDecoder.swift +22 -2
- package/ios/HMSHLSPlayerManager.m +6 -0
- package/ios/HMSHLSPlayerManager.swift +144 -2
- package/ios/HMSInteractivityDecoder.swift +41 -0
- package/ios/HMSManager.m +12 -0
- package/ios/HMSManager.swift +20 -1
- package/ios/HMSRNInteractivityCenter.swift +41 -0
- package/ios/Hmssdk.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- package/ios/Hmssdk.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/ios/Hmssdk.xcodeproj/project.xcworkspace/xcuserdata/jatinnagar.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/Hmssdk.xcodeproj/xcuserdata/jatinnagar.xcuserdatad/xcschemes/xcschememanagement.plist +14 -0
- package/lib/commonjs/classes/HMSEncoder.js +11 -1
- package/lib/commonjs/classes/HMSEncoder.js.map +1 -1
- package/lib/commonjs/classes/HMSHLSPlaylistType.js +12 -0
- package/lib/commonjs/classes/HMSHLSPlaylistType.js.map +1 -0
- package/lib/commonjs/classes/HMSHLSVariant.js +2 -0
- package/lib/commonjs/classes/HMSHLSVariant.js.map +1 -1
- package/lib/commonjs/classes/HMSInteractivityCenter.js +58 -4
- package/lib/commonjs/classes/HMSInteractivityCenter.js.map +1 -1
- package/lib/commonjs/classes/HMSInteractivityEncoder.js +6 -0
- package/lib/commonjs/classes/HMSInteractivityEncoder.js.map +1 -1
- package/lib/commonjs/classes/HMSNoiseCancellationPlugin.js +1 -0
- package/lib/commonjs/classes/HMSNoiseCancellationPlugin.js.map +1 -1
- package/lib/commonjs/classes/HMSPermissions.js +2 -0
- package/lib/commonjs/classes/HMSPermissions.js.map +1 -1
- package/lib/commonjs/classes/whiteboard/HMSWhiteboard.js +6 -0
- package/lib/commonjs/classes/whiteboard/HMSWhiteboard.js.map +1 -0
- package/lib/commonjs/classes/whiteboard/HMSWhiteboardListenerActions.js +11 -0
- package/lib/commonjs/classes/whiteboard/HMSWhiteboardListenerActions.js.map +1 -0
- package/lib/commonjs/classes/whiteboard/HMSWhiteboardState.js +12 -0
- package/lib/commonjs/classes/whiteboard/HMSWhiteboardState.js.map +1 -0
- package/lib/commonjs/classes/whiteboard/HMSWhiteboardUpdateType.js +12 -0
- package/lib/commonjs/classes/whiteboard/HMSWhiteboardUpdateType.js.map +1 -0
- package/lib/commonjs/classes/whiteboard/index.js +39 -0
- package/lib/commonjs/classes/whiteboard/index.js.map +1 -0
- package/lib/commonjs/classes/whiteboard/registerCallbacks.js +26 -0
- package/lib/commonjs/classes/whiteboard/registerCallbacks.js.map +1 -0
- package/lib/commonjs/components/HMSHLSPlayer/HMSHLSPlayer.js +98 -2
- package/lib/commonjs/components/HMSHLSPlayer/HMSHLSPlayer.js.map +1 -1
- package/lib/commonjs/components/HMSHLSPlayer/RCTHMSHLSPlayer.js.map +1 -1
- package/lib/commonjs/components/HMSHLSPlayer/hooks.js +16 -6
- package/lib/commonjs/components/HMSHLSPlayer/hooks.js.map +1 -1
- package/lib/commonjs/components/HMSHLSPlayer/index.js +15 -1
- package/lib/commonjs/components/HMSHLSPlayer/index.js.map +1 -1
- package/lib/commonjs/index.js +24 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/stores/hls-player-playback-slice.js +6 -0
- package/lib/commonjs/stores/hls-player-playback-slice.js.map +1 -1
- package/lib/commonjs/stores/hls-player-stats-store.js +27 -15
- package/lib/commonjs/stores/hls-player-stats-store.js.map +1 -1
- package/lib/commonjs/stores/types.js.map +1 -1
- package/lib/commonjs/types.js.map +1 -1
- package/lib/module/classes/HMSEncoder.js +11 -1
- package/lib/module/classes/HMSEncoder.js.map +1 -1
- package/lib/module/classes/HMSHLSPlaylistType.js +6 -0
- package/lib/module/classes/HMSHLSPlaylistType.js.map +1 -0
- package/lib/module/classes/HMSHLSVariant.js +2 -0
- package/lib/module/classes/HMSHLSVariant.js.map +1 -1
- package/lib/module/classes/HMSInteractivityCenter.js +58 -4
- package/lib/module/classes/HMSInteractivityCenter.js.map +1 -1
- package/lib/module/classes/HMSInteractivityEncoder.js +6 -0
- package/lib/module/classes/HMSInteractivityEncoder.js.map +1 -1
- package/lib/module/classes/HMSNoiseCancellationPlugin.js +1 -0
- package/lib/module/classes/HMSNoiseCancellationPlugin.js.map +1 -1
- package/lib/module/classes/HMSPermissions.js +2 -0
- package/lib/module/classes/HMSPermissions.js.map +1 -1
- package/lib/module/classes/whiteboard/HMSWhiteboard.js +2 -0
- package/lib/module/classes/whiteboard/HMSWhiteboard.js.map +1 -0
- package/lib/module/classes/whiteboard/HMSWhiteboardListenerActions.js +5 -0
- package/lib/module/classes/whiteboard/HMSWhiteboardListenerActions.js.map +1 -0
- package/lib/module/classes/whiteboard/HMSWhiteboardState.js +6 -0
- package/lib/module/classes/whiteboard/HMSWhiteboardState.js.map +1 -0
- package/lib/module/classes/whiteboard/HMSWhiteboardUpdateType.js +6 -0
- package/lib/module/classes/whiteboard/HMSWhiteboardUpdateType.js.map +1 -0
- package/lib/module/classes/whiteboard/index.js +4 -0
- package/lib/module/classes/whiteboard/index.js.map +1 -0
- package/lib/module/classes/whiteboard/registerCallbacks.js +18 -0
- package/lib/module/classes/whiteboard/registerCallbacks.js.map +1 -0
- package/lib/module/components/HMSHLSPlayer/HMSHLSPlayer.js +101 -5
- package/lib/module/components/HMSHLSPlayer/HMSHLSPlayer.js.map +1 -1
- package/lib/module/components/HMSHLSPlayer/RCTHMSHLSPlayer.js.map +1 -1
- package/lib/module/components/HMSHLSPlayer/hooks.js +12 -4
- package/lib/module/components/HMSHLSPlayer/hooks.js.map +1 -1
- package/lib/module/components/HMSHLSPlayer/index.js +1 -1
- package/lib/module/components/HMSHLSPlayer/index.js.map +1 -1
- package/lib/module/index.js +2 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/stores/hls-player-playback-slice.js +6 -0
- package/lib/module/stores/hls-player-playback-slice.js.map +1 -1
- package/lib/module/stores/hls-player-stats-store.js +27 -15
- package/lib/module/stores/hls-player-stats-store.js.map +1 -1
- package/lib/module/stores/types.js.map +1 -1
- package/lib/module/types.js.map +1 -1
- package/lib/typescript/classes/HMSEncoder.d.ts +2 -0
- package/lib/typescript/classes/HMSHLSPlaylistType.d.ts +4 -0
- package/lib/typescript/classes/HMSHLSVariant.d.ts +3 -0
- package/lib/typescript/classes/HMSInteractivityCenter.d.ts +19 -2
- package/lib/typescript/classes/HMSInteractivityEncoder.d.ts +2 -0
- package/lib/typescript/classes/HMSNoiseCancellationPlugin.d.ts +1 -0
- package/lib/typescript/classes/HMSPermissions.d.ts +7 -0
- package/lib/typescript/classes/whiteboard/HMSWhiteboard.d.ts +10 -0
- package/lib/typescript/classes/whiteboard/HMSWhiteboardListenerActions.d.ts +3 -0
- package/lib/typescript/classes/whiteboard/HMSWhiteboardState.d.ts +4 -0
- package/lib/typescript/classes/whiteboard/HMSWhiteboardUpdateType.d.ts +4 -0
- package/lib/typescript/classes/whiteboard/index.d.ts +3 -0
- package/lib/typescript/classes/whiteboard/registerCallbacks.d.ts +8 -0
- package/lib/typescript/components/HMSHLSPlayer/HMSHLSPlayer.d.ts +6 -0
- package/lib/typescript/components/HMSHLSPlayer/RCTHMSHLSPlayer.d.ts +5 -1
- package/lib/typescript/components/HMSHLSPlayer/hooks.d.ts +3 -0
- package/lib/typescript/components/HMSHLSPlayer/index.d.ts +1 -1
- package/lib/typescript/index.d.ts +2 -0
- package/lib/typescript/stores/hls-player-stats-store.d.ts +4 -3
- package/lib/typescript/stores/types.d.ts +7 -1
- package/lib/typescript/types.d.ts +9 -0
- package/package.json +1 -1
- package/sdk-versions.json +2 -2
- package/src/classes/HMSEncoder.ts +13 -0
- package/src/classes/HMSHLSPlaylistType.ts +4 -0
- package/src/classes/HMSHLSVariant.ts +5 -0
- package/src/classes/HMSInteractivityCenter.ts +89 -10
- package/src/classes/HMSInteractivityEncoder.ts +8 -0
- package/src/classes/HMSNoiseCancellationPlugin.ts +1 -0
- package/src/classes/HMSPermissions.ts +9 -0
- package/src/classes/whiteboard/HMSWhiteboard.tsx +16 -0
- package/src/classes/whiteboard/HMSWhiteboardListenerActions.ts +3 -0
- package/src/classes/whiteboard/HMSWhiteboardState.tsx +4 -0
- package/src/classes/whiteboard/HMSWhiteboardUpdateType.tsx +4 -0
- package/src/classes/whiteboard/index.ts +3 -0
- package/src/classes/whiteboard/registerCallbacks.ts +34 -0
- package/src/components/HMSHLSPlayer/HMSHLSPlayer.tsx +158 -4
- package/src/components/HMSHLSPlayer/RCTHMSHLSPlayer.ts +12 -0
- package/src/components/HMSHLSPlayer/hooks.ts +16 -4
- package/src/components/HMSHLSPlayer/index.ts +2 -0
- package/src/index.ts +2 -0
- package/src/stores/hls-player-playback-slice.ts +8 -0
- package/src/stores/hls-player-stats-store.ts +28 -18
- package/src/stores/types.ts +9 -1
- package/src/types.ts +15 -0
|
@@ -2,6 +2,8 @@ import type { HMSPoll } from './polls/HMSPoll';
|
|
|
2
2
|
import type { HMSPollCreateParams } from './polls/HMSPollCreateParams';
|
|
3
3
|
import type { HMSPollUpdateType } from './polls/HMSPollUpdateType';
|
|
4
4
|
import type { PollLeaderboardResponse } from './polls/PollLeaderboardResponse';
|
|
5
|
+
import type { HMSWhiteboardUpdateType } from './whiteboard/HMSWhiteboardUpdateType';
|
|
6
|
+
import type { HMSWhiteboard } from './whiteboard/HMSWhiteboard';
|
|
5
7
|
type PollQuestionResponseCreateParams = {
|
|
6
8
|
pollId: string;
|
|
7
9
|
pollQuestionIndex: number;
|
|
@@ -15,9 +17,9 @@ type PollQuestionResponseCreateParams = {
|
|
|
15
17
|
};
|
|
16
18
|
export declare class HMSInteractivityCenter {
|
|
17
19
|
private _eventEmitter;
|
|
18
|
-
private
|
|
19
|
-
private _onAllPollUpdateListenerRemoved;
|
|
20
|
+
private onUpdateListenerRemoved;
|
|
20
21
|
constructor();
|
|
22
|
+
private _pollUpdateListener;
|
|
21
23
|
/**
|
|
22
24
|
* Adds a listener for poll updates
|
|
23
25
|
* @param listener - Callback to be called when a poll is updated
|
|
@@ -41,5 +43,20 @@ export declare class HMSInteractivityCenter {
|
|
|
41
43
|
* @returns Promise<PollLeaderboardResponse>
|
|
42
44
|
*/
|
|
43
45
|
fetchLeaderboard(pollId: string, count: number, startIndex: number, includeCurrentPeer: boolean): Promise<PollLeaderboardResponse>;
|
|
46
|
+
private _whiteboardUpdateListener;
|
|
47
|
+
/**
|
|
48
|
+
* Adds a listener for Whiteboard updates
|
|
49
|
+
* @param listener - Callback to be called when whiteboard is updated
|
|
50
|
+
* @returns HMSEventSubscription
|
|
51
|
+
*/
|
|
52
|
+
addWhiteboardUpdateListener(listener: (hmsWhiteboard: HMSWhiteboard, updateType: HMSWhiteboardUpdateType) => void): import("../utils").EmitterSubscription;
|
|
53
|
+
/**
|
|
54
|
+
* Starts Whiteboard
|
|
55
|
+
*/
|
|
56
|
+
startWhiteboard(title: string): Promise<any>;
|
|
57
|
+
/**
|
|
58
|
+
* Stops Whiteboard
|
|
59
|
+
*/
|
|
60
|
+
stopWhiteboard(): Promise<any>;
|
|
44
61
|
}
|
|
45
62
|
export {};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { DecodedPollLeaderboardResponse } from './polls/DecodedPollLeaderboardResponse';
|
|
2
2
|
import type { HMSPoll } from './polls/HMSPoll';
|
|
3
3
|
import type { PollLeaderboardResponse } from './polls/PollLeaderboardResponse';
|
|
4
|
+
import type { HMSWhiteboard } from './whiteboard/HMSWhiteboard';
|
|
4
5
|
export declare class HMSInteractivityEncoder {
|
|
5
6
|
static transformPoll(poll: HMSPoll): HMSPoll;
|
|
6
7
|
static transformPollLeaderboardResponse(decodedPollLeaderboardResponse: DecodedPollLeaderboardResponse): PollLeaderboardResponse;
|
|
8
|
+
static transformHMSWhiteboard(hmsWhiteboard: HMSWhiteboard): HMSWhiteboard;
|
|
7
9
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Class representing an HMS Noise Cancellation Plugin.
|
|
3
|
+
* Checkout {@link https://www.100ms.live/docs/react-native/v2/how-to-guides/extend-capabilities/noise-cancellation} for more info
|
|
3
4
|
*/
|
|
4
5
|
export declare class HMSNoiseCancellationPlugin {
|
|
5
6
|
modelName: HMSNoiseCancellationModels;
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
export interface HMSWhiteboardPermission {
|
|
2
|
+
admin?: boolean;
|
|
3
|
+
write?: boolean;
|
|
4
|
+
read?: boolean;
|
|
5
|
+
}
|
|
1
6
|
export declare class HMSPermissions {
|
|
2
7
|
endRoom?: boolean;
|
|
3
8
|
removeOthers?: boolean;
|
|
@@ -9,6 +14,7 @@ export declare class HMSPermissions {
|
|
|
9
14
|
rtmpStreaming?: boolean;
|
|
10
15
|
pollRead?: boolean;
|
|
11
16
|
pollWrite?: boolean;
|
|
17
|
+
whiteboard?: HMSWhiteboardPermission;
|
|
12
18
|
constructor(params?: {
|
|
13
19
|
endRoom?: boolean;
|
|
14
20
|
removeOthers?: boolean;
|
|
@@ -20,5 +26,6 @@ export declare class HMSPermissions {
|
|
|
20
26
|
rtmpStreaming?: boolean;
|
|
21
27
|
pollRead?: boolean;
|
|
22
28
|
pollWrite?: boolean;
|
|
29
|
+
whiteboard?: HMSWhiteboardPermission;
|
|
23
30
|
});
|
|
24
31
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { HMSPeer } from '../HMSPeer';
|
|
2
|
+
import type { HMSWhiteboardState } from './HMSWhiteboardState';
|
|
3
|
+
export interface HMSWhiteboard {
|
|
4
|
+
id: string;
|
|
5
|
+
title?: string;
|
|
6
|
+
state: HMSWhiteboardState;
|
|
7
|
+
isOwner: boolean;
|
|
8
|
+
owner?: HMSPeer;
|
|
9
|
+
url?: string;
|
|
10
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { HMSWhiteboard } from './HMSWhiteboard';
|
|
2
|
+
import type { HMSWhiteboardUpdateType } from './HMSWhiteboardUpdateType';
|
|
3
|
+
export type WhiteboardUpdateListener = (data: {
|
|
4
|
+
hmsWhiteboard: HMSWhiteboard;
|
|
5
|
+
updateType: HMSWhiteboardUpdateType;
|
|
6
|
+
}) => void;
|
|
7
|
+
export declare function registerWhiteboardUpdateListener(listener: WhiteboardUpdateListener): void;
|
|
8
|
+
export declare function unregisterWhiteboardUpdateListener(): void;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { StyleProp, ViewStyle } from 'react-native';
|
|
3
|
+
import type { HLSPlayerDurationDetails } from '../../types';
|
|
3
4
|
export interface HMSHLSPlayerProps {
|
|
4
5
|
url?: string;
|
|
5
6
|
style?: StyleProp<ViewStyle>;
|
|
@@ -17,5 +18,10 @@ export interface HMSHLSPlayerRefProperties {
|
|
|
17
18
|
seekBackward: (seconds: number) => void;
|
|
18
19
|
seekToLivePosition: () => void;
|
|
19
20
|
setVolume: (level: number) => void;
|
|
21
|
+
isClosedCaptionSupported: () => Promise<boolean>;
|
|
22
|
+
isClosedCaptionEnabled: () => Promise<boolean>;
|
|
23
|
+
enableClosedCaption: () => void;
|
|
24
|
+
disableClosedCaption: () => void;
|
|
25
|
+
getPlayerDurationDetails: () => Promise<HLSPlayerDurationDetails>;
|
|
20
26
|
}
|
|
21
27
|
export declare const HMSHLSPlayer: React.ForwardRefExoticComponent<HMSHLSPlayerProps & React.RefAttributes<HMSHLSPlayerRefProperties>>;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { StyleProp, NativeSyntheticEvent, ViewStyle, NativeMethods } from 'react-native';
|
|
2
|
-
import type { HMSHLSPlayerPlaybackEvent, HMSHLSPlayerStatsEvent } from '../../types';
|
|
2
|
+
import type { HMSHLSPlayerCuesEvent, HMSHLSPlayerPlaybackEvent, HMSHLSPlayerStatsEvent, RequestedDataEvent } from '../../types';
|
|
3
3
|
export type HmsHlsPlaybackEventHandler = (event: NativeSyntheticEvent<HMSHLSPlayerPlaybackEvent>) => void;
|
|
4
4
|
export type HmsHlsStatsEventHandler = (event: NativeSyntheticEvent<HMSHLSPlayerStatsEvent>) => void;
|
|
5
|
+
export type HlsSPlayerCuesEventHandler = (event: NativeSyntheticEvent<HMSHLSPlayerCuesEvent>) => void;
|
|
6
|
+
export type RequestedDataEventHandler = (event: NativeSyntheticEvent<RequestedDataEvent>) => void;
|
|
5
7
|
export type RCTHMSHLSPlayerProps = {
|
|
6
8
|
url?: string;
|
|
7
9
|
style?: StyleProp<ViewStyle>;
|
|
@@ -9,6 +11,8 @@ export type RCTHMSHLSPlayerProps = {
|
|
|
9
11
|
enableControls?: boolean;
|
|
10
12
|
onHmsHlsPlaybackEvent?: HmsHlsPlaybackEventHandler;
|
|
11
13
|
onHmsHlsStatsEvent?: HmsHlsStatsEventHandler;
|
|
14
|
+
onDataReturned?: RequestedDataEventHandler;
|
|
15
|
+
onHlsPlayerCuesEvent?: HlsSPlayerCuesEventHandler;
|
|
12
16
|
};
|
|
13
17
|
export declare const RCTHMSHLSPlayer: import("react-native").HostComponent<RCTHMSHLSPlayerProps>;
|
|
14
18
|
export type RCTHMSHLSPlayerRef = React.Component<RCTHMSHLSPlayerProps> & Readonly<NativeMethods>;
|
|
@@ -8,6 +8,8 @@ export declare const useHMSHLSPlayerStats: () => {
|
|
|
8
8
|
error: HMSHLSPlayerStatsError;
|
|
9
9
|
};
|
|
10
10
|
export declare const useHMSHLSPlayerStat: <T extends keyof HMSHLSPlayerStatsUpdateEventData>(stat: T) => HMSHLSPlayerStatsUpdateEventData[T];
|
|
11
|
+
export declare const useHMSHLSPlayerSubtitles: () => string | null;
|
|
12
|
+
export declare const useIsHLSStreamLive: (liveOffsetMillis?: number) => boolean;
|
|
11
13
|
export declare const useHMSHLSPlayerStatsError: (callback: (error: NonNullable<HMSHLSPlayerStatsError>) => void, deps: DependencyList) => void;
|
|
12
14
|
export declare const useHMSHLSPlayerPlaybackError: (callback: (error: NonNullable<HMSHLSPlayerPlaybackError>) => void, deps: DependencyList) => void;
|
|
13
15
|
export declare const useHMSHLSPlayerCue: (callback: (error: NonNullable<HMSHLSPlayerCue>) => void, deps: DependencyList) => void;
|
|
@@ -17,3 +19,4 @@ export declare const setHMSHLSPlayerCue: (cue: import("../../stores/types").HMSH
|
|
|
17
19
|
export declare const setHMSHLSPlayerPlaybackError: (error: HMSHLSPlayerPlaybackError) => void;
|
|
18
20
|
export declare const setHMSHLSPlayerStats: (stats: HMSHLSPlayerStatsUpdateEventData) => void;
|
|
19
21
|
export declare const setHMSHLSPlayerStatsError: (error: HMSHLSPlayerStatsError) => void;
|
|
22
|
+
export declare const setHMSHLSPlayerSubtitles: (subtitles: string | null) => void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from './HMSHLSPlayer';
|
|
2
|
-
export { useHMSHLSPlayerPlaybackState, useHMSHLSPlayerCue, useHMSHLSPlayerPlaybackError, useHMSHLSPlayerStats, useHMSHLSPlayerStat, useHMSHLSPlayerStatsError, useHMSHLSPlayerResolution, } from './hooks';
|
|
2
|
+
export { useHMSHLSPlayerPlaybackState, useHMSHLSPlayerCue, useHMSHLSPlayerPlaybackError, useHMSHLSPlayerStats, useHMSHLSPlayerStat, useHMSHLSPlayerStatsError, useHMSHLSPlayerResolution, useHMSHLSPlayerSubtitles, useIsHLSStreamLive, } from './hooks';
|
|
@@ -83,12 +83,14 @@ export * from './classes/HMSCameraControl';
|
|
|
83
83
|
export * from './classes/HMSIOSAudioMode';
|
|
84
84
|
export * from './classes/HMSRecordingState';
|
|
85
85
|
export * from './classes/HMSStreamingState';
|
|
86
|
+
export * from './classes/HMSHLSPlaylistType';
|
|
86
87
|
export type { HMSSessionStore, JsonArray, JsonMap, JsonPrimitive, JsonValue, } from './classes/HMSSessionStore';
|
|
87
88
|
export type { HmsViewComponent as HMSView, HmsComponentProps as HMSViewProps, } from './classes/HmsView';
|
|
88
89
|
export type { HMSPIPConfig } from './classes/HMSPIPConfig';
|
|
89
90
|
export { HMSRecordingState } from './classes/HMSRecordingState';
|
|
90
91
|
export type { HMSPoll } from './classes/polls/HMSPoll';
|
|
91
92
|
export * from './classes/HMSNoiseCancellationPlugin';
|
|
93
|
+
export * from './classes/whiteboard';
|
|
92
94
|
export { HMSPollQuestionType } from './classes/polls/HMSPollQuestionType';
|
|
93
95
|
export { HMSPollType } from './classes/polls/HMSPollType';
|
|
94
96
|
export { HMSPollUserTrackingMode } from './classes/polls/HMSPollUserTrackingMode';
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import type { HMSHLSPlayerStatsStore } from './types';
|
|
2
|
+
export declare const useHMSHLSPlayerStatsStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<HMSHLSPlayerStatsStore>, "subscribe"> & {
|
|
2
3
|
subscribe: {
|
|
3
|
-
(listener: (selectedState:
|
|
4
|
-
<U>(selector: (state:
|
|
4
|
+
(listener: (selectedState: HMSHLSPlayerStatsStore, previousSelectedState: HMSHLSPlayerStatsStore) => void): () => void;
|
|
5
|
+
<U>(selector: (state: HMSHLSPlayerStatsStore) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
|
|
5
6
|
equalityFn?: ((a: U, b: U) => boolean) | undefined;
|
|
6
7
|
fireImmediately?: boolean | undefined;
|
|
7
8
|
} | undefined): () => void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { HMSPoll } from '../classes/polls/HMSPoll';
|
|
2
2
|
import type { HMSHLSPlayerPlaybackState, HMSHLSPlayerPlaybackCueEventData, HMSHLSPlayerPlaybackFailureEventData, HMSHLSPlayerPlaybackResolutionChangeEventData, HMSHLSPlayerStatsErrorEventData, HMSHLSPlayerStatsUpdateEventData } from '../types';
|
|
3
3
|
export type HMSStore = HMSHLSPlayerPlaybackSlice & HMSViewsSlice;
|
|
4
|
-
export type HMSHLSPlayerStatsStore = HMSHLSPlayerStatsSlice;
|
|
4
|
+
export type HMSHLSPlayerStatsStore = HMSHLSPlayerStatsSlice & HLSPlayerClosedCaptionsSlice;
|
|
5
5
|
export type HMSInteractivityStore = HMSPollsSlice;
|
|
6
6
|
export type TrackId = string;
|
|
7
7
|
export type Resolution = {
|
|
@@ -28,6 +28,7 @@ export interface HMSHLSPlayerPlaybackSlice {
|
|
|
28
28
|
setPlaybackState(playbackState: HMSHLSPlayerPlaybackState): void;
|
|
29
29
|
setResolution(resolution: HMSHLSPlayerResolution): void;
|
|
30
30
|
setPlaybackError(error: HMSHLSPlayerPlaybackError): void;
|
|
31
|
+
resetPlaybackSlice(): void;
|
|
31
32
|
}
|
|
32
33
|
export type HMSHLSPlayerStats = HMSHLSPlayerStatsUpdateEventData;
|
|
33
34
|
export type HMSHLSPlayerStatsError = HMSHLSPlayerStatsErrorEventData | undefined;
|
|
@@ -36,6 +37,11 @@ export interface HMSHLSPlayerStatsSlice {
|
|
|
36
37
|
error: HMSHLSPlayerStatsError | undefined;
|
|
37
38
|
changeStats(stats: HMSHLSPlayerStats): void;
|
|
38
39
|
setError(error: HMSHLSPlayerStatsError): void;
|
|
40
|
+
reset(): void;
|
|
41
|
+
}
|
|
42
|
+
export interface HLSPlayerClosedCaptionsSlice {
|
|
43
|
+
subtitles: string | null;
|
|
44
|
+
setSubtitles(subtitles: string | null): void;
|
|
39
45
|
}
|
|
40
46
|
export type HMSPollsSlice = {
|
|
41
47
|
polls: Record<string, HMSPoll>;
|
|
@@ -66,4 +66,13 @@ export type HMSHLSPlayerStatsUpdateEventData = {
|
|
|
66
66
|
type HMSHLSPlayerStatsErrorEvent = HMSHLSPlayerEvent<HMSHLSPlayerStatsEventTypes.ON_STATS_EVENT_ERROR, HMSHLSPlayerStatsErrorEventData>;
|
|
67
67
|
type HMSHLSPlayerStatsUpdateEvent = HMSHLSPlayerEvent<HMSHLSPlayerStatsEventTypes.ON_STATS_EVENT_UPDATE, HMSHLSPlayerStatsUpdateEventData>;
|
|
68
68
|
export type HMSHLSPlayerStatsEvent = HMSHLSPlayerStatsErrorEvent | HMSHLSPlayerStatsUpdateEvent;
|
|
69
|
+
export type HMSHLSPlayerCuesEvent = HMSHLSPlayerEvent<'ON_CLOSED_CAPTION_UPDATE', string | null>;
|
|
70
|
+
export type RequestedDataEvent = {
|
|
71
|
+
requestId: number;
|
|
72
|
+
data: any;
|
|
73
|
+
};
|
|
74
|
+
export type HLSPlayerDurationDetails = {
|
|
75
|
+
streamDuration?: number;
|
|
76
|
+
rollingWindowTime?: number;
|
|
77
|
+
};
|
|
69
78
|
export {};
|
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.5",
|
|
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
|
@@ -40,6 +40,7 @@ import { HMSLayer } from './HMSLayer';
|
|
|
40
40
|
import { HMSSimulcastLayerDefinition } from './HMSSimulcastLayerDefinition';
|
|
41
41
|
import { HMSQualityLimitationReasons } from './HMSQualityLimitationReasons';
|
|
42
42
|
import { HMSTrackType } from './HMSTrackType';
|
|
43
|
+
import { HMSHLSPlaylistType } from './HMSHLSPlaylistType';
|
|
43
44
|
|
|
44
45
|
interface InitialData {
|
|
45
46
|
roles: Record<string, HMSRole>;
|
|
@@ -520,6 +521,9 @@ export class HMSEncoder {
|
|
|
520
521
|
meetingUrl: item.meetingUrl,
|
|
521
522
|
metadata: item?.metaData ? item?.metadata : undefined,
|
|
522
523
|
startedAt: HMSEncoder.encodeDate(item?.startedAt),
|
|
524
|
+
playlistType: item?.playlistType
|
|
525
|
+
? this.getHLSVariantPlaylistType(item.playlistType.toUpperCase())
|
|
526
|
+
: undefined,
|
|
523
527
|
});
|
|
524
528
|
variants.push(variant);
|
|
525
529
|
});
|
|
@@ -527,6 +531,15 @@ export class HMSEncoder {
|
|
|
527
531
|
return variants;
|
|
528
532
|
}
|
|
529
533
|
|
|
534
|
+
static getHLSVariantPlaylistType(type: String) {
|
|
535
|
+
switch (type) {
|
|
536
|
+
case 'DVR':
|
|
537
|
+
return HMSHLSPlaylistType.DVR;
|
|
538
|
+
default:
|
|
539
|
+
return HMSHLSPlaylistType.noDVR;
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
|
|
530
543
|
static encodeHMSNetworkQuality(data: any) {
|
|
531
544
|
if (data) {
|
|
532
545
|
return new HMSNetworkQuality({
|
|
@@ -1,18 +1,23 @@
|
|
|
1
|
+
import type { HMSHLSPlaylistType } from './HMSHLSPlaylistType';
|
|
2
|
+
|
|
1
3
|
export class HMSHLSVariant {
|
|
2
4
|
hlsStreamUrl?: string;
|
|
3
5
|
meetingUrl?: string;
|
|
4
6
|
metadata?: string;
|
|
5
7
|
startedAt?: Date;
|
|
8
|
+
playlistType?: HMSHLSPlaylistType;
|
|
6
9
|
|
|
7
10
|
constructor(params: {
|
|
8
11
|
hlsStreamUrl?: string;
|
|
9
12
|
meetingUrl?: string;
|
|
10
13
|
metadata?: string;
|
|
11
14
|
startedAt?: Date;
|
|
15
|
+
playlistType?: HMSHLSPlaylistType;
|
|
12
16
|
}) {
|
|
13
17
|
this.hlsStreamUrl = params.hlsStreamUrl;
|
|
14
18
|
this.meetingUrl = params.meetingUrl;
|
|
15
19
|
this.metadata = params.metadata;
|
|
16
20
|
this.startedAt = params.startedAt;
|
|
21
|
+
this.playlistType = params.playlistType;
|
|
17
22
|
}
|
|
18
23
|
}
|
|
@@ -12,6 +12,14 @@ import { HMSInteractivityEncoder } from './HMSInteractivityEncoder';
|
|
|
12
12
|
import { HMSHelper } from './HMSHelper';
|
|
13
13
|
import type { PollLeaderboardResponse } from './polls/PollLeaderboardResponse';
|
|
14
14
|
import type { DecodedPollLeaderboardResponse } from './polls/DecodedPollLeaderboardResponse';
|
|
15
|
+
import type { HMSWhiteboardUpdateType } from './whiteboard/HMSWhiteboardUpdateType';
|
|
16
|
+
import type { HMSWhiteboard } from './whiteboard/HMSWhiteboard';
|
|
17
|
+
import { HMSWhiteboardListenerActions } from './whiteboard/HMSWhiteboardListenerActions';
|
|
18
|
+
import {
|
|
19
|
+
WhiteboardUpdateListener,
|
|
20
|
+
registerWhiteboardUpdateListener,
|
|
21
|
+
unregisterWhiteboardUpdateListener,
|
|
22
|
+
} from './whiteboard/registerCallbacks';
|
|
15
23
|
|
|
16
24
|
type PollUpdateListener = (data: {
|
|
17
25
|
updatedPoll: HMSPoll;
|
|
@@ -56,6 +64,26 @@ function unregisterPollUpdateListener() {
|
|
|
56
64
|
export class HMSInteractivityCenter {
|
|
57
65
|
private _eventEmitter = new EventEmitter();
|
|
58
66
|
|
|
67
|
+
private onUpdateListenerRemoved(eventType: string) {
|
|
68
|
+
if (eventType === HMSPollsListenerActions.ON_POLL_UPDATE) {
|
|
69
|
+
unregisterPollUpdateListener();
|
|
70
|
+
} else if (
|
|
71
|
+
eventType === HMSWhiteboardListenerActions.ON_WHITEBOARD_UPDATE
|
|
72
|
+
) {
|
|
73
|
+
unregisterWhiteboardUpdateListener();
|
|
74
|
+
} else {
|
|
75
|
+
console.warn('Unknown update listener removed: ', eventType);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
constructor() {
|
|
80
|
+
this._eventEmitter.registerOnAllListenersRemoved(
|
|
81
|
+
this.onUpdateListenerRemoved
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
//#region Poll Methods & Listeners
|
|
86
|
+
|
|
59
87
|
private _pollUpdateListener = (...args: Parameters<PollUpdateListener>) => {
|
|
60
88
|
const { updatedPoll, update } = args[0];
|
|
61
89
|
logger?.verbose('#Listener ON_POLL_UPDATE', {
|
|
@@ -69,16 +97,6 @@ export class HMSInteractivityCenter {
|
|
|
69
97
|
);
|
|
70
98
|
};
|
|
71
99
|
|
|
72
|
-
private _onAllPollUpdateListenerRemoved = () => {
|
|
73
|
-
unregisterPollUpdateListener();
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
constructor() {
|
|
77
|
-
this._eventEmitter.registerOnAllListenersRemoved(
|
|
78
|
-
this._onAllPollUpdateListenerRemoved
|
|
79
|
-
);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
100
|
/**
|
|
83
101
|
* Adds a listener for poll updates
|
|
84
102
|
* @param listener - Callback to be called when a poll is updated
|
|
@@ -164,4 +182,65 @@ export class HMSInteractivityCenter {
|
|
|
164
182
|
await HMSManager.fetchLeaderboard(data);
|
|
165
183
|
return HMSInteractivityEncoder.transformPollLeaderboardResponse(response);
|
|
166
184
|
}
|
|
185
|
+
//#endregion Poll Methods & Listeners
|
|
186
|
+
|
|
187
|
+
//#region Whiteboard Methods & Listeners
|
|
188
|
+
|
|
189
|
+
private _whiteboardUpdateListener = (
|
|
190
|
+
...args: Parameters<WhiteboardUpdateListener>
|
|
191
|
+
) => {
|
|
192
|
+
const { hmsWhiteboard, updateType } = args[0];
|
|
193
|
+
logger?.verbose('#Listener ON_WHITEBOARD_UPDATE', {
|
|
194
|
+
updateType,
|
|
195
|
+
hmsWhiteboard,
|
|
196
|
+
});
|
|
197
|
+
this._eventEmitter.emit(
|
|
198
|
+
HMSWhiteboardListenerActions.ON_WHITEBOARD_UPDATE,
|
|
199
|
+
HMSInteractivityEncoder.transformHMSWhiteboard(hmsWhiteboard),
|
|
200
|
+
updateType
|
|
201
|
+
);
|
|
202
|
+
};
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* Adds a listener for Whiteboard updates
|
|
206
|
+
* @param listener - Callback to be called when whiteboard is updated
|
|
207
|
+
* @returns HMSEventSubscription
|
|
208
|
+
*/
|
|
209
|
+
addWhiteboardUpdateListener(
|
|
210
|
+
listener: (
|
|
211
|
+
hmsWhiteboard: HMSWhiteboard,
|
|
212
|
+
updateType: HMSWhiteboardUpdateType
|
|
213
|
+
) => void
|
|
214
|
+
) {
|
|
215
|
+
registerWhiteboardUpdateListener(this._whiteboardUpdateListener);
|
|
216
|
+
return this._eventEmitter.addListener(
|
|
217
|
+
HMSWhiteboardListenerActions.ON_WHITEBOARD_UPDATE,
|
|
218
|
+
listener,
|
|
219
|
+
null
|
|
220
|
+
);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* Starts Whiteboard
|
|
225
|
+
*/
|
|
226
|
+
async startWhiteboard(title: string) {
|
|
227
|
+
const data = {
|
|
228
|
+
id: HMSConstants.DEFAULT_SDK_ID,
|
|
229
|
+
title,
|
|
230
|
+
};
|
|
231
|
+
logger?.verbose('#Function startWhiteboard', data);
|
|
232
|
+
return HMSManager.startWhiteboard(data);
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* Stops Whiteboard
|
|
237
|
+
*/
|
|
238
|
+
async stopWhiteboard() {
|
|
239
|
+
const data = {
|
|
240
|
+
id: HMSConstants.DEFAULT_SDK_ID,
|
|
241
|
+
};
|
|
242
|
+
logger?.verbose('#Function stopWhiteboard', data);
|
|
243
|
+
return HMSManager.stopWhiteboard(data);
|
|
244
|
+
}
|
|
245
|
+
//#endregion Whiteboard Methods & Listeners
|
|
167
246
|
}
|
|
@@ -2,6 +2,7 @@ import { HMSEncoder } from './HMSEncoder';
|
|
|
2
2
|
import type { DecodedPollLeaderboardResponse } from './polls/DecodedPollLeaderboardResponse';
|
|
3
3
|
import type { HMSPoll } from './polls/HMSPoll';
|
|
4
4
|
import type { PollLeaderboardResponse } from './polls/PollLeaderboardResponse';
|
|
5
|
+
import type { HMSWhiteboard } from './whiteboard/HMSWhiteboard';
|
|
5
6
|
|
|
6
7
|
export class HMSInteractivityEncoder {
|
|
7
8
|
static transformPoll(poll: HMSPoll): HMSPoll {
|
|
@@ -81,4 +82,11 @@ export class HMSInteractivityEncoder {
|
|
|
81
82
|
|
|
82
83
|
return decodedPollLeaderboardResponse as PollLeaderboardResponse;
|
|
83
84
|
}
|
|
85
|
+
|
|
86
|
+
static transformHMSWhiteboard(hmsWhiteboard: HMSWhiteboard): HMSWhiteboard {
|
|
87
|
+
if (hmsWhiteboard.owner) {
|
|
88
|
+
hmsWhiteboard.owner = HMSEncoder.encodeHmsPeer(hmsWhiteboard.owner);
|
|
89
|
+
}
|
|
90
|
+
return hmsWhiteboard;
|
|
91
|
+
}
|
|
84
92
|
}
|
|
@@ -4,6 +4,7 @@ import { logger } from './HMSLogger';
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Class representing an HMS Noise Cancellation Plugin.
|
|
7
|
+
* Checkout {@link https://www.100ms.live/docs/react-native/v2/how-to-guides/extend-capabilities/noise-cancellation} for more info
|
|
7
8
|
*/
|
|
8
9
|
export class HMSNoiseCancellationPlugin {
|
|
9
10
|
modelName: HMSNoiseCancellationModels;
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
export interface HMSWhiteboardPermission {
|
|
2
|
+
admin?: boolean;
|
|
3
|
+
write?: boolean;
|
|
4
|
+
read?: boolean;
|
|
5
|
+
}
|
|
6
|
+
|
|
1
7
|
export class HMSPermissions {
|
|
2
8
|
endRoom?: boolean;
|
|
3
9
|
removeOthers?: boolean;
|
|
@@ -9,6 +15,7 @@ export class HMSPermissions {
|
|
|
9
15
|
rtmpStreaming?: boolean;
|
|
10
16
|
pollRead?: boolean;
|
|
11
17
|
pollWrite?: boolean;
|
|
18
|
+
whiteboard?: HMSWhiteboardPermission;
|
|
12
19
|
|
|
13
20
|
constructor(params?: {
|
|
14
21
|
endRoom?: boolean;
|
|
@@ -21,6 +28,7 @@ export class HMSPermissions {
|
|
|
21
28
|
rtmpStreaming?: boolean;
|
|
22
29
|
pollRead?: boolean;
|
|
23
30
|
pollWrite?: boolean;
|
|
31
|
+
whiteboard?: HMSWhiteboardPermission;
|
|
24
32
|
}) {
|
|
25
33
|
if (params) {
|
|
26
34
|
this.endRoom = params.endRoom;
|
|
@@ -33,6 +41,7 @@ export class HMSPermissions {
|
|
|
33
41
|
this.rtmpStreaming = params.rtmpStreaming;
|
|
34
42
|
this.pollRead = params.pollRead;
|
|
35
43
|
this.pollWrite = params.pollWrite;
|
|
44
|
+
this.whiteboard = params.whiteboard;
|
|
36
45
|
}
|
|
37
46
|
}
|
|
38
47
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { HMSPeer } from '../HMSPeer';
|
|
2
|
+
import type { HMSWhiteboardState } from './HMSWhiteboardState';
|
|
3
|
+
|
|
4
|
+
export interface HMSWhiteboard {
|
|
5
|
+
id: string;
|
|
6
|
+
|
|
7
|
+
title?: string;
|
|
8
|
+
|
|
9
|
+
state: HMSWhiteboardState;
|
|
10
|
+
|
|
11
|
+
isOwner: boolean;
|
|
12
|
+
|
|
13
|
+
owner?: HMSPeer;
|
|
14
|
+
|
|
15
|
+
url?: string;
|
|
16
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { HMSConstants } from '../HMSConstants';
|
|
2
|
+
import type { HMSEventSubscription } from '../HMSNativeEventEmitter';
|
|
3
|
+
import HMSNativeEventListener from '../HMSNativeEventListener';
|
|
4
|
+
import type { HMSWhiteboard } from './HMSWhiteboard';
|
|
5
|
+
import { HMSWhiteboardListenerActions } from './HMSWhiteboardListenerActions';
|
|
6
|
+
import type { HMSWhiteboardUpdateType } from './HMSWhiteboardUpdateType';
|
|
7
|
+
|
|
8
|
+
export type WhiteboardUpdateListener = (data: {
|
|
9
|
+
hmsWhiteboard: HMSWhiteboard;
|
|
10
|
+
updateType: HMSWhiteboardUpdateType;
|
|
11
|
+
}) => void;
|
|
12
|
+
|
|
13
|
+
let whiteboardUpdateSubscription: null | HMSEventSubscription = null;
|
|
14
|
+
|
|
15
|
+
export function registerWhiteboardUpdateListener(
|
|
16
|
+
listener: WhiteboardUpdateListener
|
|
17
|
+
) {
|
|
18
|
+
if (whiteboardUpdateSubscription !== null) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
whiteboardUpdateSubscription = HMSNativeEventListener.addListener(
|
|
22
|
+
HMSConstants.DEFAULT_SDK_ID,
|
|
23
|
+
HMSWhiteboardListenerActions.ON_WHITEBOARD_UPDATE,
|
|
24
|
+
listener
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function unregisterWhiteboardUpdateListener() {
|
|
29
|
+
if (whiteboardUpdateSubscription === null) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
whiteboardUpdateSubscription.remove();
|
|
33
|
+
whiteboardUpdateSubscription = null;
|
|
34
|
+
}
|