@100mslive/react-native-hms 1.9.6 → 1.9.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/local.properties +1 -8
- package/android/src/main/java/com/reactnativehmssdk/HMSDecoder.kt +57 -0
- package/android/src/main/java/com/reactnativehmssdk/HMSManager.kt +1 -0
- package/android/src/main/java/com/reactnativehmssdk/HMSRNSDK.kt +33 -7
- package/ios/HMSDecoder.swift +2 -0
- package/ios/HMSHelper.swift +4 -2
- package/ios/HMSRNSDK.swift +50 -19
- package/lib/commonjs/classes/HMSPIPConfig.js +0 -2
- package/lib/commonjs/classes/HMSPIPConfig.js.map +1 -1
- package/lib/commonjs/classes/HMSRoom.js +7 -0
- package/lib/commonjs/classes/HMSRoom.js.map +1 -1
- package/lib/commonjs/classes/HMSSessionStore.js +1 -1
- package/lib/commonjs/classes/HMSSessionStore.js.map +1 -1
- package/lib/commonjs/components/HMSHLSPlayer/HMSHLSPlayer.js.map +1 -1
- package/lib/commonjs/components/HMSHLSPlayer/hooks.js.map +1 -1
- package/lib/commonjs/hooks/hmsviews.js.map +1 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/stores/hms-store.js.map +1 -1
- package/lib/commonjs/stores/types.js +0 -9
- package/lib/commonjs/stores/types.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/HMSRoom.js +7 -0
- package/lib/module/classes/HMSRoom.js.map +1 -1
- package/lib/module/classes/HMSSessionStore.js +1 -1
- package/lib/module/classes/HMSSessionStore.js.map +1 -1
- package/lib/module/components/HMSHLSPlayer/HMSHLSPlayer.js.map +1 -1
- package/lib/module/components/HMSHLSPlayer/hooks.js.map +1 -1
- package/lib/module/hooks/hmsviews.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/stores/hms-store.js.map +1 -1
- package/lib/module/stores/types.js +0 -9
- package/lib/module/stores/types.js.map +1 -1
- package/lib/typescript/classes/HMSRoom.d.ts +1 -0
- package/lib/typescript/classes/HMSSessionStore.d.ts +10 -8
- package/lib/typescript/index.d.ts +1 -1
- package/package.json +1 -1
- package/sdk-versions.json +2 -2
- package/src/classes/HMSPIPConfig.ts +1 -1
- package/src/classes/HMSRoom.ts +13 -0
- package/src/classes/HMSSessionStore.ts +19 -18
- package/src/components/HMSHLSPlayer/HMSHLSPlayer.tsx +3 -2
- package/src/components/HMSHLSPlayer/hooks.ts +1 -2
- package/src/hooks/hmsviews.ts +3 -1
- package/src/index.ts +4 -1
- package/src/stores/hms-store.ts +1 -1
- package/src/stores/types.ts +4 -2
- package/ios/Hmssdk.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -7
- package/ios/Hmssdk.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
- package/ios/Hmssdk.xcodeproj/project.xcworkspace/xcuserdata/jatinnagar.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/Hmssdk.xcodeproj/xcuserdata/jatinnagar.xcuserdatad/xcschemes/xcschememanagement.plist +0 -14
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
type
|
|
2
|
-
export type
|
|
1
|
+
export type JsonPrimitive = string | number | boolean | null;
|
|
2
|
+
export type JsonMap = {
|
|
3
|
+
[key: string]: JsonPrimitive | JsonMap | JsonArray;
|
|
4
|
+
};
|
|
5
|
+
export type JsonArray = Array<JsonPrimitive | JsonMap | JsonArray>;
|
|
6
|
+
export type JsonValue = JsonPrimitive | JsonMap | JsonArray;
|
|
3
7
|
/**
|
|
4
8
|
* Session store is a shared realtime key-value store that is accessible by everyone in the room.
|
|
5
9
|
* It can be utilized to implement features such as pinned text, spotlight (which brings a particular
|
|
@@ -24,13 +28,12 @@ export declare class HMSSessionStore {
|
|
|
24
28
|
* Once a value is assigned, it will be available for other peers in the room
|
|
25
29
|
* who are listening for changes in value for that specific key.
|
|
26
30
|
*
|
|
27
|
-
* @param {
|
|
31
|
+
* @param {JsonValue} value
|
|
28
32
|
* @param {string} key
|
|
29
33
|
* @returns {Promise}
|
|
30
34
|
*/
|
|
31
|
-
set(value:
|
|
35
|
+
set(value: JsonValue, key: string): Promise<{
|
|
32
36
|
success: true;
|
|
33
|
-
finalValue: HMSSessionStoreValue;
|
|
34
37
|
}>;
|
|
35
38
|
/**
|
|
36
39
|
* This method returns the value of any specified key on session store.
|
|
@@ -42,7 +45,7 @@ export declare class HMSSessionStore {
|
|
|
42
45
|
* @param {string} key
|
|
43
46
|
* @returns {Promise}
|
|
44
47
|
*/
|
|
45
|
-
get(key: string): Promise<
|
|
48
|
+
get(key: string): Promise<JsonValue>;
|
|
46
49
|
/**
|
|
47
50
|
* This method registers a callback function for listening to value changes of a particular key.
|
|
48
51
|
* Registered Callback function will be called initially with latest value and whenever the value updates
|
|
@@ -53,11 +56,10 @@ export declare class HMSSessionStore {
|
|
|
53
56
|
*/
|
|
54
57
|
addKeyChangeListener<T extends string[]>(forKeys: T, callback: (error: string | null, data: {
|
|
55
58
|
key: T[number];
|
|
56
|
-
value:
|
|
59
|
+
value: JsonValue;
|
|
57
60
|
} | null) => void): {
|
|
58
61
|
remove: () => void;
|
|
59
62
|
};
|
|
60
63
|
private _cleanup;
|
|
61
64
|
private _deviceEventEmitterListener;
|
|
62
65
|
}
|
|
63
|
-
export {};
|
|
@@ -82,7 +82,7 @@ export * from './classes/HMSCameraControl';
|
|
|
82
82
|
export * from './classes/HMSIOSAudioMode';
|
|
83
83
|
export * from './classes/HMSRecordingState';
|
|
84
84
|
export * from './classes/HMSStreamingState';
|
|
85
|
-
export type { HMSSessionStore,
|
|
85
|
+
export type { HMSSessionStore, JsonArray, JsonMap, JsonPrimitive, JsonValue, } from './classes/HMSSessionStore';
|
|
86
86
|
export type { HmsViewComponent as HMSView, HmsComponentProps as HMSViewProps, } from './classes/HmsView';
|
|
87
87
|
export type { HMSPIPConfig } from './classes/HMSPIPConfig';
|
|
88
88
|
export { HMSRecordingState } from './classes/HMSRecordingState';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@100mslive/react-native-hms",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.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
package/src/classes/HMSRoom.ts
CHANGED
|
@@ -153,4 +153,17 @@ export class HMSRoom {
|
|
|
153
153
|
'localPeer'
|
|
154
154
|
);
|
|
155
155
|
}
|
|
156
|
+
|
|
157
|
+
get isLargeRoom(): boolean {
|
|
158
|
+
const hmsRoomCache = getHmsRoomCache();
|
|
159
|
+
|
|
160
|
+
if (hmsRoomCache) {
|
|
161
|
+
return hmsRoomCache.getProperty('isLargeRoom');
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
return getHMSRoomPropertyFromNative(
|
|
165
|
+
HMSConstants.DEFAULT_SDK_ID,
|
|
166
|
+
'isLargeRoom'
|
|
167
|
+
);
|
|
168
|
+
}
|
|
156
169
|
}
|
|
@@ -9,9 +9,12 @@ import { HMSUpdateListenerActions } from './HMSUpdateListenerActions';
|
|
|
9
9
|
import { EventEmitter } from '../utils';
|
|
10
10
|
import type { EmitterSubscription } from '../utils';
|
|
11
11
|
|
|
12
|
-
type
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
export type JsonPrimitive = string | number | boolean | null;
|
|
13
|
+
export type JsonMap = {
|
|
14
|
+
[key: string]: JsonPrimitive | JsonMap | JsonArray;
|
|
15
|
+
};
|
|
16
|
+
export type JsonArray = Array<JsonPrimitive | JsonMap | JsonArray>;
|
|
17
|
+
export type JsonValue = JsonPrimitive | JsonMap | JsonArray;
|
|
15
18
|
|
|
16
19
|
/**
|
|
17
20
|
* Session store is a shared realtime key-value store that is accessible by everyone in the room.
|
|
@@ -38,17 +41,16 @@ export class HMSSessionStore {
|
|
|
38
41
|
* Once a value is assigned, it will be available for other peers in the room
|
|
39
42
|
* who are listening for changes in value for that specific key.
|
|
40
43
|
*
|
|
41
|
-
* @param {
|
|
44
|
+
* @param {JsonValue} value
|
|
42
45
|
* @param {string} key
|
|
43
46
|
* @returns {Promise}
|
|
44
47
|
*/
|
|
45
|
-
async set(value:
|
|
46
|
-
const data: { success: true
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
});
|
|
48
|
+
async set(value: JsonValue, key: string) {
|
|
49
|
+
const data: { success: true } = await HMSManager.setSessionMetadataForKey({
|
|
50
|
+
id: HMSConstants.DEFAULT_SDK_ID,
|
|
51
|
+
key,
|
|
52
|
+
value,
|
|
53
|
+
});
|
|
52
54
|
return data;
|
|
53
55
|
}
|
|
54
56
|
|
|
@@ -63,11 +65,10 @@ export class HMSSessionStore {
|
|
|
63
65
|
* @returns {Promise}
|
|
64
66
|
*/
|
|
65
67
|
async get(key: string) {
|
|
66
|
-
const data:
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
});
|
|
68
|
+
const data: JsonValue = await HMSManager.getSessionMetadataForKey({
|
|
69
|
+
id: HMSConstants.DEFAULT_SDK_ID,
|
|
70
|
+
key,
|
|
71
|
+
});
|
|
71
72
|
return data;
|
|
72
73
|
}
|
|
73
74
|
|
|
@@ -83,7 +84,7 @@ export class HMSSessionStore {
|
|
|
83
84
|
forKeys: T,
|
|
84
85
|
callback: (
|
|
85
86
|
error: string | null,
|
|
86
|
-
data: { key: T[number]; value:
|
|
87
|
+
data: { key: T[number]; value: JsonValue } | null
|
|
87
88
|
) => void
|
|
88
89
|
) {
|
|
89
90
|
// Add Native Device Event Emitter if it is not already added
|
|
@@ -192,7 +193,7 @@ export class HMSSessionStore {
|
|
|
192
193
|
private _deviceEventEmitterListener(data: {
|
|
193
194
|
id: string;
|
|
194
195
|
key: string;
|
|
195
|
-
value:
|
|
196
|
+
value: JsonValue;
|
|
196
197
|
}) {
|
|
197
198
|
// if id is different from default sdk_id, return early
|
|
198
199
|
if (data.id !== HMSConstants.DEFAULT_SDK_ID) {
|
|
@@ -200,9 +200,10 @@ const _HMSHLSPlayer: React.ForwardRefRenderFunction<
|
|
|
200
200
|
) {
|
|
201
201
|
setHMSHLSPlayerPlaybackError(data.error);
|
|
202
202
|
} else if (
|
|
203
|
-
event ===
|
|
203
|
+
event ===
|
|
204
|
+
HMSHLSPlayerPlaybackEventTypes.ON_PLAYBACK_RESOLUTION_CHANGE_EVENT
|
|
204
205
|
) {
|
|
205
|
-
setHMSHLSPlayerResolution({...data});
|
|
206
|
+
setHMSHLSPlayerResolution({ ...data });
|
|
206
207
|
|
|
207
208
|
const aspectRatio = data.width / data.height;
|
|
208
209
|
|
|
@@ -93,8 +93,7 @@ export const useHMSHLSPlayerCue = (
|
|
|
93
93
|
export const setHMSHLSPlayerPlaybackState =
|
|
94
94
|
useHMSStore.getState().setPlaybackState;
|
|
95
95
|
|
|
96
|
-
export const setHMSHLSPlayerResolution =
|
|
97
|
-
useHMSStore.getState().setResolution;
|
|
96
|
+
export const setHMSHLSPlayerResolution = useHMSStore.getState().setResolution;
|
|
98
97
|
|
|
99
98
|
export const setHMSHLSPlayerCue = useHMSStore.getState().setCue;
|
|
100
99
|
|
package/src/hooks/hmsviews.ts
CHANGED
|
@@ -4,7 +4,9 @@ import { useHMSStore } from '../stores/hms-store';
|
|
|
4
4
|
// use latest state (with component rerender)
|
|
5
5
|
|
|
6
6
|
export const useHmsViewsResolutionsState = (trackId?: TrackId) => {
|
|
7
|
-
return useHMSStore((state) =>
|
|
7
|
+
return useHMSStore((state) =>
|
|
8
|
+
trackId ? state.hmsviewsResolutions[trackId] : undefined
|
|
9
|
+
);
|
|
8
10
|
};
|
|
9
11
|
|
|
10
12
|
// state setters
|
package/src/index.ts
CHANGED
|
@@ -84,7 +84,10 @@ export * from './classes/HMSRecordingState';
|
|
|
84
84
|
export * from './classes/HMSStreamingState';
|
|
85
85
|
export type {
|
|
86
86
|
HMSSessionStore,
|
|
87
|
-
|
|
87
|
+
JsonArray,
|
|
88
|
+
JsonMap,
|
|
89
|
+
JsonPrimitive,
|
|
90
|
+
JsonValue,
|
|
88
91
|
} from './classes/HMSSessionStore';
|
|
89
92
|
export type {
|
|
90
93
|
HmsViewComponent as HMSView,
|
package/src/stores/hms-store.ts
CHANGED
package/src/stores/types.ts
CHANGED
|
@@ -24,7 +24,7 @@ export type Resolution = {
|
|
|
24
24
|
export interface HMSViewsSlice {
|
|
25
25
|
hmsviewsResolutions: Record<TrackId, Resolution | undefined>;
|
|
26
26
|
setHmsviewsResolutions(trackId: TrackId, resolution: Resolution): void;
|
|
27
|
-
}
|
|
27
|
+
}
|
|
28
28
|
|
|
29
29
|
// HLS Player Playback Slice
|
|
30
30
|
|
|
@@ -40,7 +40,9 @@ export type HMSHLSPlayerPlaybackError =
|
|
|
40
40
|
| HMSHLSPlayerPlaybackFailureEventData['error']
|
|
41
41
|
| undefined;
|
|
42
42
|
|
|
43
|
-
export type HMSHLSPlayerResolution =
|
|
43
|
+
export type HMSHLSPlayerResolution =
|
|
44
|
+
| HMSHLSPlayerPlaybackResolutionChangeEventData
|
|
45
|
+
| undefined;
|
|
44
46
|
|
|
45
47
|
export interface HMSHLSPlayerPlaybackSlice {
|
|
46
48
|
cue: HMSHLSPlayerCue;
|
|
Binary file
|
package/ios/Hmssdk.xcodeproj/xcuserdata/jatinnagar.xcuserdatad/xcschemes/xcschememanagement.plist
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
-
<plist version="1.0">
|
|
4
|
-
<dict>
|
|
5
|
-
<key>SchemeUserState</key>
|
|
6
|
-
<dict>
|
|
7
|
-
<key>Hmssdk.xcscheme_^#shared#^_</key>
|
|
8
|
-
<dict>
|
|
9
|
-
<key>orderHint</key>
|
|
10
|
-
<integer>0</integer>
|
|
11
|
-
</dict>
|
|
12
|
-
</dict>
|
|
13
|
-
</dict>
|
|
14
|
-
</plist>
|