@100mslive/react-sdk 0.4.3-alpha.1 → 0.4.3
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/dist/hooks/useAVToggle.js +1 -1
- package/dist/hooks/useAVToggle.js.map +1 -1
- package/dist/hooks/useAudioLevelStyles.js.map +1 -1
- package/dist/hooks/useAutoplayError.js +1 -1
- package/dist/hooks/useAutoplayError.js.map +1 -1
- package/dist/hooks/useCustomEvent.js +1 -1
- package/dist/hooks/useCustomEvent.js.map +1 -1
- package/dist/hooks/useDevices.js +1 -1
- package/dist/hooks/useDevices.js.map +1 -1
- package/dist/hooks/useParticipantList.js.map +1 -1
- package/dist/hooks/useParticipants.js +1 -1
- package/dist/hooks/useParticipants.js.map +1 -1
- package/dist/hooks/usePreviewJoin.js +1 -1
- package/dist/hooks/usePreviewJoin.js.map +1 -1
- package/dist/hooks/useRecordingStreaming.js.map +1 -1
- package/dist/hooks/useRemoteAVToggle.js +1 -1
- package/dist/hooks/useRemoteAVToggle.js.map +1 -1
- package/dist/hooks/useScreenShare.js +1 -1
- package/dist/hooks/useScreenShare.js.map +1 -1
- package/dist/hooks/useVideo.js +1 -1
- package/dist/hooks/useVideo.js.map +1 -1
- package/dist/hooks/useVideoList.js.map +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/{packages/react-sdk/node_modules → node_modules}/zustand/esm/shallow.js +0 -0
- package/dist/node_modules/zustand/esm/shallow.js.map +1 -0
- package/dist/package.json.js +2 -0
- package/dist/package.json.js.map +1 -0
- package/dist/primitives/HmsRoomProvider.js +1 -1
- package/dist/primitives/HmsRoomProvider.js.map +1 -1
- package/dist/primitives/store.js +1 -1
- package/dist/primitives/store.js.map +1 -1
- package/dist/utils/commons.js.map +1 -1
- package/dist/utils/groupBy.js.map +1 -1
- package/dist/utils/isBrowser.js.map +1 -1
- package/dist/utils/layout.js +1 -1
- package/dist/utils/layout.js.map +1 -1
- package/dist/utils/logger.js +1 -1
- package/dist/utils/logger.js.map +1 -1
- package/package.json +4 -3
- package/src/primitives/HmsRoomProvider.ts +2 -1
- package/dist/hooks/types.d.ts +0 -6
- package/dist/hooks/useAVToggle.d.ts +0 -24
- package/dist/hooks/useAudioLevelStyles.d.ts +0 -15
- package/dist/hooks/useAutoplayError.d.ts +0 -17
- package/dist/hooks/useCustomEvent.d.ts +0 -58
- package/dist/hooks/useDevices.d.ts +0 -40
- package/dist/hooks/useParticipantList.d.ts +0 -13
- package/dist/hooks/useParticipants.d.ts +0 -42
- package/dist/hooks/usePreviewJoin.d.ts +0 -58
- package/dist/hooks/useRecordingStreaming.d.ts +0 -10
- package/dist/hooks/useRemoteAVToggle.d.ts +0 -36
- package/dist/hooks/useScreenShare.d.ts +0 -40
- package/dist/hooks/useVideo.d.ts +0 -27
- package/dist/hooks/useVideoList.d.ts +0 -68
- package/dist/index.d.ts +0 -29
- package/dist/node_modules/tslib/tslib.es6.js +0 -2
- package/dist/node_modules/tslib/tslib.es6.js.map +0 -1
- package/dist/packages/react-sdk/node_modules/zustand/esm/shallow.js.map +0 -1
- package/dist/primitives/HmsRoomProvider.d.ts +0 -49
- package/dist/primitives/store.d.ts +0 -15
- package/dist/primitives/types.d.ts +0 -5
- package/dist/utils/commons.d.ts +0 -7
- package/dist/utils/groupBy.d.ts +0 -15
- package/dist/utils/isBrowser.d.ts +0 -1
- package/dist/utils/layout.d.ts +0 -116
- package/dist/utils/logger.d.ts +0 -17
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"main": "dist/index.cjs.js",
|
|
5
5
|
"module": "dist/index.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
7
|
-
"version": "0.4.3
|
|
7
|
+
"version": "0.4.3",
|
|
8
8
|
"author": "100ms",
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"files": [
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@rollup/plugin-commonjs": "^21.0.3",
|
|
26
|
+
"@rollup/plugin-json": "^5.0.0",
|
|
26
27
|
"@rollup/plugin-node-resolve": "^13.1.3",
|
|
27
28
|
"@rollup/plugin-typescript": "^8.3.1",
|
|
28
29
|
"@types/react": "^18.0.8",
|
|
@@ -35,10 +36,10 @@
|
|
|
35
36
|
"react": ">=16.8 <19.0.0"
|
|
36
37
|
},
|
|
37
38
|
"dependencies": {
|
|
38
|
-
"@100mslive/hms-video-store": "0.6.3
|
|
39
|
+
"@100mslive/hms-video-store": "0.6.3",
|
|
39
40
|
"react-intersection-observer": "^8.33.1",
|
|
40
41
|
"react-resize-detector": "^7.0.0",
|
|
41
42
|
"zustand": "^3.6.2"
|
|
42
43
|
},
|
|
43
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "4d8386faab9c4c833efbd01c1e53dd918cb41b9f"
|
|
44
45
|
}
|
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
import create from 'zustand';
|
|
14
14
|
import { HMSContextProviderProps, makeHMSStoreHook, hooksErrorMessage, makeHMSStatsStoreHook } from './store';
|
|
15
15
|
import { isBrowser } from '../utils/isBrowser';
|
|
16
|
+
import { version as sdkVersion } from '../../package.json';
|
|
16
17
|
|
|
17
18
|
export interface HMSRoomProviderProps {
|
|
18
19
|
actions?: HMSActions;
|
|
@@ -102,7 +103,7 @@ export const HMSRoomProvider: React.FC<PropsWithChildren<HMSRoomProviderProps>>
|
|
|
102
103
|
providerProps.actions.setFrameworkInfo({
|
|
103
104
|
type: 'react-web',
|
|
104
105
|
version: React.version,
|
|
105
|
-
sdkVersion
|
|
106
|
+
sdkVersion,
|
|
106
107
|
});
|
|
107
108
|
}
|
|
108
109
|
|
package/dist/hooks/types.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* use this to control how errors are handled within a function exposed by a hook. By default this
|
|
3
|
-
* only logs the error to the console, and can be overridden for any other behaviour. For e.g.
|
|
4
|
-
* `(err) => throw err;` will ensure that any error is thrown back to the caller when the function is called.
|
|
5
|
-
*/
|
|
6
|
-
export declare type hooksErrHandler = (err: Error, method?: string) => void;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { hooksErrHandler } from '../hooks/types';
|
|
2
|
-
export interface useAVToggleResult {
|
|
3
|
-
/**
|
|
4
|
-
* true if unmuted and vice versa
|
|
5
|
-
*/
|
|
6
|
-
isLocalAudioEnabled: boolean;
|
|
7
|
-
isLocalVideoEnabled: boolean;
|
|
8
|
-
/**
|
|
9
|
-
* use this function to toggle audio state, the function will only be present if the user
|
|
10
|
-
* has permission to unmute audio
|
|
11
|
-
*/
|
|
12
|
-
toggleAudio?: () => void;
|
|
13
|
-
/**
|
|
14
|
-
* use this function to toggle video state, the function will only be present if the user
|
|
15
|
-
* has permission to unmute video
|
|
16
|
-
*/
|
|
17
|
-
toggleVideo?: () => void;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Use this hook to implement mute/unmute for audio and video.
|
|
21
|
-
* isAllowedToPublish can be used to decide whether to show the toggle buttons in the UI.
|
|
22
|
-
* @param handleError to handle any error during toggle of audio/video
|
|
23
|
-
*/
|
|
24
|
-
export declare const useAVToggle: (handleError?: hooksErrHandler) => useAVToggleResult;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
/**
|
|
3
|
-
* This hook can be used to apply css properties on an element based on the current audio level for the passed in track.
|
|
4
|
-
* It doesn't return the audio level as it's optimised for performance. As audio level could be changing frequently we
|
|
5
|
-
* want to minimise the number of components an audio level change causes to re render.
|
|
6
|
-
* An e.g. use of this hook will be to apply box-shadow on parent tile based on audio level.
|
|
7
|
-
* @param trackId is the audio track id for which audio level needs to be used
|
|
8
|
-
* @param getStyle is a function which can take in current audio level and return the style to apply for the ref
|
|
9
|
-
* @param ref is the ref of the element on which you want the css to apply
|
|
10
|
-
*/
|
|
11
|
-
export declare function useAudioLevelStyles({ trackId, getStyle, ref, }: {
|
|
12
|
-
trackId?: string;
|
|
13
|
-
getStyle: (level: number) => Record<string, string>;
|
|
14
|
-
ref: React.RefObject<any>;
|
|
15
|
-
}): void;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export interface useAutoplayErrorResult {
|
|
2
|
-
error: string;
|
|
3
|
-
/**
|
|
4
|
-
* call this method on a UI element click to unblock the blocked audio autoplay.
|
|
5
|
-
*/
|
|
6
|
-
unblockAudio: () => Promise<void>;
|
|
7
|
-
/**
|
|
8
|
-
* Call this method to reset(hide) the UI that is rendered when there was an error
|
|
9
|
-
*/
|
|
10
|
-
resetError: () => void;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Use this hook to show a UI(modal or a toast) when autoplay is blocked by browser and allow the user to
|
|
14
|
-
* unblock the browser autoplay block
|
|
15
|
-
* @returns {useAutoplayErrorResult}
|
|
16
|
-
*/
|
|
17
|
-
export declare const useAutoplayError: () => useAutoplayErrorResult;
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { HMSPeerID, HMSRoleName } from '@100mslive/hms-video-store';
|
|
2
|
-
import { hooksErrHandler } from './types';
|
|
3
|
-
export interface useCustomEventInput<T> {
|
|
4
|
-
/**
|
|
5
|
-
* type of the event, e.g. MODERATOR_EVENT, EMOJI_REACTIONS etc.
|
|
6
|
-
*/
|
|
7
|
-
type: string;
|
|
8
|
-
/**
|
|
9
|
-
* the handler function for when the custom event comes. It's recommended
|
|
10
|
-
* to use `useCallback` for the function passed in here for performance
|
|
11
|
-
* reasons.
|
|
12
|
-
* The callback is optional in case you want to decouple sending event and
|
|
13
|
-
* handling event in the UI.
|
|
14
|
-
*/
|
|
15
|
-
onEvent?: (data: T) => void;
|
|
16
|
-
/**
|
|
17
|
-
* flag to treat event payload as json.
|
|
18
|
-
* If true, the payload will be stringified before sending and
|
|
19
|
-
* parsed before calling the onEvent handler function.
|
|
20
|
-
*
|
|
21
|
-
* Set it to `false` if you want to send/receive only string messages
|
|
22
|
-
*
|
|
23
|
-
* Set it to `true` if you want to send/receive objects
|
|
24
|
-
*
|
|
25
|
-
* default value is true
|
|
26
|
-
*/
|
|
27
|
-
json?: boolean;
|
|
28
|
-
/**
|
|
29
|
-
* function to handle errors happening during sending the event
|
|
30
|
-
*/
|
|
31
|
-
handleError?: hooksErrHandler;
|
|
32
|
-
}
|
|
33
|
-
export interface EventReceiver {
|
|
34
|
-
peerId?: HMSPeerID;
|
|
35
|
-
roleNames?: HMSRoleName[];
|
|
36
|
-
}
|
|
37
|
-
export interface useCustomEventResult<T> {
|
|
38
|
-
/**
|
|
39
|
-
* sends the event data to others in the room who will receive it in onEvent
|
|
40
|
-
*
|
|
41
|
-
* @example to send message to peers of specific roles
|
|
42
|
-
* ```js
|
|
43
|
-
* sendEvent(data, {roleNames: ['host','guest']})
|
|
44
|
-
* ```
|
|
45
|
-
*
|
|
46
|
-
* @example to send message to single peer
|
|
47
|
-
* ```js
|
|
48
|
-
* sendEvent(data, {peerId})
|
|
49
|
-
* ```
|
|
50
|
-
*/
|
|
51
|
-
sendEvent: (data: T, receiver?: EventReceiver) => void;
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* A generic function to implement [custom events](https://www.100ms.live/docs/javascript/v2/features/chat#custom-events) in your UI.
|
|
55
|
-
* The data to be sent to remote is expected to be a serializable JSON. The serialization
|
|
56
|
-
* and deserialization is taken care of by the hook.
|
|
57
|
-
*/
|
|
58
|
-
export declare const useCustomEvent: <T>({ type, json, onEvent, handleError, }: useCustomEventInput<T>) => useCustomEventResult<T>;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { hooksErrHandler } from '../hooks/types';
|
|
2
|
-
export declare enum DeviceType {
|
|
3
|
-
videoInput = "videoInput",
|
|
4
|
-
audioInput = "audioInput",
|
|
5
|
-
audioOutput = "audioOutput"
|
|
6
|
-
}
|
|
7
|
-
export declare type DeviceTypeAndInfo<T> = {
|
|
8
|
-
[key in DeviceType]?: T;
|
|
9
|
-
};
|
|
10
|
-
export interface useDevicesResult {
|
|
11
|
-
/**
|
|
12
|
-
* list of all devices by type
|
|
13
|
-
*/
|
|
14
|
-
allDevices: DeviceTypeAndInfo<MediaDeviceInfo[]>;
|
|
15
|
-
/**
|
|
16
|
-
* selected device ids for all types
|
|
17
|
-
*/
|
|
18
|
-
selectedDeviceIDs: DeviceTypeAndInfo<string>;
|
|
19
|
-
/**
|
|
20
|
-
* function to call to update device
|
|
21
|
-
*/
|
|
22
|
-
updateDevice: ({ deviceType, deviceId }: {
|
|
23
|
-
deviceType: DeviceType;
|
|
24
|
-
deviceId: string;
|
|
25
|
-
}) => Promise<void>;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* This hook can be used to implement a UI component which allows the user to manually change their
|
|
29
|
-
* audio/video device. It returns the list of all devices as well as the currently selected one. The input
|
|
30
|
-
* devices will be returned based on what the user is allowed to publish, so a audio only user won't get
|
|
31
|
-
* the audioInput field. This can be used to show the UI dropdowns properly.
|
|
32
|
-
*
|
|
33
|
-
* Note:
|
|
34
|
-
* - Browsers give access to the list of devices only if the user has given permission to access them
|
|
35
|
-
* - Changing devices manually work best in combination with remembering the user's selection for the next time, do
|
|
36
|
-
* pass the rememberDeviceSelection flag at time of join for this to happen.
|
|
37
|
-
*
|
|
38
|
-
* @param handleError error handler for any errors during device change
|
|
39
|
-
*/
|
|
40
|
-
export declare const useDevices: (handleError?: hooksErrHandler) => useDevicesResult;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { HMSPeer, HMSRoleName } from '@100mslive/hms-video-store';
|
|
2
|
-
export interface useParticipantListResult {
|
|
3
|
-
roles: HMSRoleName[];
|
|
4
|
-
participantsByRoles: Record<string, HMSPeer[]>;
|
|
5
|
-
peerCount: number;
|
|
6
|
-
isConnected: boolean;
|
|
7
|
-
}
|
|
8
|
-
export declare const useParticipantList: () => {
|
|
9
|
-
roles: string[];
|
|
10
|
-
participantsByRoles: Record<string, HMSPeer[]>;
|
|
11
|
-
peerCount: number;
|
|
12
|
-
isConnected: boolean | undefined;
|
|
13
|
-
};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { HMSPeer, HMSRoleName } from '@100mslive/hms-video-store';
|
|
2
|
-
export interface useParticipantsResult {
|
|
3
|
-
/**
|
|
4
|
-
* list of participants that match the given filters
|
|
5
|
-
*/
|
|
6
|
-
participants: HMSPeer[];
|
|
7
|
-
/**
|
|
8
|
-
* Total number of participants in the room
|
|
9
|
-
*/
|
|
10
|
-
peerCount: number;
|
|
11
|
-
/**
|
|
12
|
-
* is joined in the room
|
|
13
|
-
*/
|
|
14
|
-
isConnected: boolean;
|
|
15
|
-
/**
|
|
16
|
-
* role names with atleast one participant present with that role
|
|
17
|
-
*/
|
|
18
|
-
rolesWithParticipants: HMSRoleName[];
|
|
19
|
-
}
|
|
20
|
-
export declare type useParticipantsParams = {
|
|
21
|
-
/** To filter by particular role */
|
|
22
|
-
role: HMSRoleName;
|
|
23
|
-
/**
|
|
24
|
-
* To filter by particular by metadata. only supports { isHandRaised: true } for now
|
|
25
|
-
* @beta
|
|
26
|
-
*/
|
|
27
|
-
metadata: Record<string, any>;
|
|
28
|
-
/** To filter by name/role (partial match) */
|
|
29
|
-
search: string;
|
|
30
|
-
};
|
|
31
|
-
/**
|
|
32
|
-
* This can be used to get the total count of participants in the room, participants
|
|
33
|
-
* filtered by role or metadata with isHandRaised or the entire participants if no params are passed
|
|
34
|
-
* @param {useParticipantsParams} params
|
|
35
|
-
* @returns {useParticipantsResult}
|
|
36
|
-
*/
|
|
37
|
-
export declare const useParticipants: (params?: useParticipantsParams) => {
|
|
38
|
-
participants: HMSPeer[];
|
|
39
|
-
isConnected: boolean | undefined;
|
|
40
|
-
peerCount: number;
|
|
41
|
-
rolesWithParticipants: (string | undefined)[];
|
|
42
|
-
};
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { HMSConfigInitialSettings } from '@100mslive/hms-video-store';
|
|
2
|
-
import { hooksErrHandler } from './types';
|
|
3
|
-
export interface usePreviewInput {
|
|
4
|
-
/**
|
|
5
|
-
* name of user who is joining, this is only required if join is called
|
|
6
|
-
*/
|
|
7
|
-
name?: string;
|
|
8
|
-
/**
|
|
9
|
-
* app side authentication token
|
|
10
|
-
*/
|
|
11
|
-
token: string;
|
|
12
|
-
/**
|
|
13
|
-
* any extra metadata info for the peer
|
|
14
|
-
*/
|
|
15
|
-
metadata?: string;
|
|
16
|
-
/**
|
|
17
|
-
* function to handle errors happening during preview
|
|
18
|
-
*/
|
|
19
|
-
handleError?: hooksErrHandler;
|
|
20
|
-
initEndpoint?: string;
|
|
21
|
-
/**
|
|
22
|
-
* initial settings for audio/video and device to be used.
|
|
23
|
-
*/
|
|
24
|
-
initialSettings?: HMSConfigInitialSettings;
|
|
25
|
-
/**
|
|
26
|
-
* Enable to get a network quality score while in preview. The score ranges from -1 to 5.
|
|
27
|
-
* -1 when we are not able to connect to 100ms servers within an expected time limit
|
|
28
|
-
* 0 when there is a timeout/failure when measuring the quality
|
|
29
|
-
* 1-5 ranges from poor to good quality.
|
|
30
|
-
*/
|
|
31
|
-
captureNetworkQualityInPreview?: boolean;
|
|
32
|
-
}
|
|
33
|
-
export interface usePreviewResult {
|
|
34
|
-
/**
|
|
35
|
-
* enable the join button for the user only when this is true
|
|
36
|
-
*/
|
|
37
|
-
enableJoin: boolean;
|
|
38
|
-
/**
|
|
39
|
-
* call this function to join the room
|
|
40
|
-
*/
|
|
41
|
-
join: () => Promise<void>;
|
|
42
|
-
/**
|
|
43
|
-
* once the user has joined the room, till leave happens this flag will be true. It can be used
|
|
44
|
-
* to decide to show between preview form and conferencing component/video tiles.
|
|
45
|
-
*/
|
|
46
|
-
isConnected: boolean;
|
|
47
|
-
/**
|
|
48
|
-
* call this function to join the room
|
|
49
|
-
*/
|
|
50
|
-
preview: () => Promise<void>;
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* This hook can be used to build a preview UI component, this lets you call preview everytime the passed in
|
|
54
|
-
* token changes. This hook is best used in combination with useDevices for changing devices, useAVToggle for
|
|
55
|
-
* muting/unmuting and useAudioLevelStyles for showing mic audio level to the user.
|
|
56
|
-
* Any device change or mute/unmute will be carried across to join.
|
|
57
|
-
*/
|
|
58
|
-
export declare const usePreviewJoin: ({ name, token, metadata, handleError, initEndpoint, initialSettings, captureNetworkQualityInPreview, }: usePreviewInput) => usePreviewResult;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export interface useRecordingStreamingResult {
|
|
2
|
-
isServerRecordingOn: boolean;
|
|
3
|
-
isBrowserRecordingOn: boolean;
|
|
4
|
-
isHLSRecordingOn: boolean;
|
|
5
|
-
isStreamingOn: boolean;
|
|
6
|
-
isHLSRunning: boolean;
|
|
7
|
-
isRTMPRunning: boolean;
|
|
8
|
-
isRecordingOn: boolean;
|
|
9
|
-
}
|
|
10
|
-
export declare const useRecordingStreaming: () => useRecordingStreamingResult;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { HMSTrackID } from '@100mslive/hms-video-store';
|
|
2
|
-
import { hooksErrHandler } from './types';
|
|
3
|
-
export interface useRemoteAVToggleResult {
|
|
4
|
-
/**
|
|
5
|
-
* true if unmuted and vice versa
|
|
6
|
-
*/
|
|
7
|
-
isAudioEnabled: boolean;
|
|
8
|
-
isVideoEnabled: boolean;
|
|
9
|
-
/**
|
|
10
|
-
* current volume of the audio track
|
|
11
|
-
*/
|
|
12
|
-
volume?: number;
|
|
13
|
-
/**
|
|
14
|
-
* use this function to toggle audio state, the function will only be present if the user
|
|
15
|
-
* has permission to mute/unmute remote audio
|
|
16
|
-
*/
|
|
17
|
-
toggleAudio?: () => void;
|
|
18
|
-
/**
|
|
19
|
-
* use this function to toggle video state, the function will only be present if the user
|
|
20
|
-
* has permission to mute/unmute remote video
|
|
21
|
-
*/
|
|
22
|
-
toggleVideo?: () => void;
|
|
23
|
-
/**
|
|
24
|
-
* use this function to set the volume of peer's audio track for the local user, the function will
|
|
25
|
-
* only be present if the remote peer has an audio track to change volume for
|
|
26
|
-
*/
|
|
27
|
-
setVolume?: (volume: number) => void;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* This hook can be used to implement remote mute/unmute + audio volume changer on tile level.
|
|
31
|
-
* @param peerId of the peer whose tracks need to be managed
|
|
32
|
-
* @param audioTrackId of the peer whose tracks need to be managed
|
|
33
|
-
* @param videoTrackId of the peer whose tracks need to be managed
|
|
34
|
-
* @param handleError to handle any error during toggle of audio/video
|
|
35
|
-
*/
|
|
36
|
-
export declare const useRemoteAVToggle: (audioTrackId: HMSTrackID, videoTrackId: HMSTrackID, handleError?: hooksErrHandler) => useRemoteAVToggleResult;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { hooksErrHandler } from '../hooks/types';
|
|
2
|
-
import { HMSPeerID, HMSTrackID } from '@100mslive/hms-video-store';
|
|
3
|
-
export interface useScreenShareResult {
|
|
4
|
-
/**
|
|
5
|
-
* true if the local user is screensharing, false otherwise
|
|
6
|
-
*/
|
|
7
|
-
amIScreenSharing: boolean;
|
|
8
|
-
/**
|
|
9
|
-
* toggle screenshare for the local user, will only be present if the user has the permission to toggle
|
|
10
|
-
*/
|
|
11
|
-
toggleScreenShare?: () => void;
|
|
12
|
-
/**
|
|
13
|
-
* the id of the peer who is currently screensharing, will only be present if there is a screenshare in the room.
|
|
14
|
-
* In case of multiple screenshares, the behaviour of which one is picked is not defined.
|
|
15
|
-
*/
|
|
16
|
-
screenSharingPeerId?: HMSPeerID;
|
|
17
|
-
/**
|
|
18
|
-
* the name of the peer who is currently screensharing. Will be undefined if no one is sharing the screen.
|
|
19
|
-
* In case of multiple screenshares, the behavior of which one is picked is not defined.
|
|
20
|
-
*/
|
|
21
|
-
screenSharingPeerName?: string;
|
|
22
|
-
/**
|
|
23
|
-
* screenShare audio track id, will only be present if there is a screenshare with video track
|
|
24
|
-
*/
|
|
25
|
-
screenShareVideoTrackId?: HMSTrackID;
|
|
26
|
-
/**
|
|
27
|
-
* screenShare audio track id, will only be present if there is a screenshare with audio track
|
|
28
|
-
*/
|
|
29
|
-
screenShareAudioTrackId?: HMSTrackID;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* This hook can be used to implement a screenshare toggle button as well as know about the screenshare in the room.
|
|
33
|
-
* This works best if your application only needs to show one screenshare in large view at a time with other screenshares
|
|
34
|
-
* similar to normal user tiles.
|
|
35
|
-
* For any complicated requirement with multiple screenshares it's best to use the store directly.
|
|
36
|
-
* For viewing the screenshare this hook is best used in combination with useVideo.
|
|
37
|
-
* For implementing control bar for local peer, this is used based with useAVToggle.
|
|
38
|
-
* @param handleError to handle any errors during screenshare toggle
|
|
39
|
-
*/
|
|
40
|
-
export declare const useScreenShare: (handleError?: hooksErrHandler) => useScreenShareResult;
|
package/dist/hooks/useVideo.d.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { HMSTrackID } from '@100mslive/hms-video-store';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
export interface useVideoInput {
|
|
4
|
-
/**
|
|
5
|
-
* TrackId that is to be rendered
|
|
6
|
-
*/
|
|
7
|
-
trackId?: HMSTrackID;
|
|
8
|
-
/**
|
|
9
|
-
* Boolean stating whether to override the internal behaviour.
|
|
10
|
-
* when attach is false, even if tile is inView or enabled, it won't be rendered
|
|
11
|
-
*/
|
|
12
|
-
attach?: boolean;
|
|
13
|
-
/**
|
|
14
|
-
* Number between 0 and 1 indication when the element is considered inView
|
|
15
|
-
*/
|
|
16
|
-
threshold?: number;
|
|
17
|
-
}
|
|
18
|
-
export interface useVideoOutput {
|
|
19
|
-
videoRef: React.RefCallback<HTMLVideoElement>;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* This hooks can be used to implement a video tile component. Given a track id it will return a ref.
|
|
23
|
-
* The returned ref can be used to set on a video element meant to display the video.
|
|
24
|
-
* The hook will take care of attaching and detaching video, and will automatically detach when the video
|
|
25
|
-
* goes out of view to save on bandwidth.
|
|
26
|
-
*/
|
|
27
|
-
export declare const useVideo: ({ trackId, attach, threshold }: useVideoInput) => useVideoOutput;
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { HMSPeer } from '@100mslive/hms-video-store';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { TrackWithPeer } from '../utils/layout';
|
|
4
|
-
export interface useVideoListInput {
|
|
5
|
-
/**
|
|
6
|
-
* peers is the list of all peers you need to display
|
|
7
|
-
*/
|
|
8
|
-
peers: HMSPeer[];
|
|
9
|
-
/**
|
|
10
|
-
* Max tiles in a page. Overrides maxRowCount and maxColCount
|
|
11
|
-
*/
|
|
12
|
-
maxTileCount?: number;
|
|
13
|
-
/**
|
|
14
|
-
* Max rows in a page. Only applied if maxTileCount is not present
|
|
15
|
-
*/
|
|
16
|
-
maxRowCount?: number;
|
|
17
|
-
/**
|
|
18
|
-
* Max columns in a page. Only applied if maxTileCount and maxRowCount are not present
|
|
19
|
-
*/
|
|
20
|
-
maxColCount?: number;
|
|
21
|
-
/**
|
|
22
|
-
* A function which tells whether to show the screenShare for a peer who is screensharing. A peer is passed
|
|
23
|
-
* and a boolean value is expected.
|
|
24
|
-
* This can be useful if there are multiple screenShares in the room where you may want to show the main one in the
|
|
25
|
-
* center view and others in video list along side other tiles. No screenShare is included by default.
|
|
26
|
-
* e.g. includeScreenShare = (peer) => return peer.id !== mainScreenSharingPeer.id
|
|
27
|
-
*/
|
|
28
|
-
includeScreenShareForPeer?: (peer: HMSPeer) => boolean;
|
|
29
|
-
/**
|
|
30
|
-
* Aspect ratio of VideoTiles, ideally this should be the same as the aspect ratio selected for
|
|
31
|
-
* capture in the dashboard template.
|
|
32
|
-
*/
|
|
33
|
-
aspectRatio?: {
|
|
34
|
-
width: number;
|
|
35
|
-
height: number;
|
|
36
|
-
};
|
|
37
|
-
/**
|
|
38
|
-
* By default this will be true. Only publishing(audio/video/screen) peers in the passed in peer list
|
|
39
|
-
* will be filtered. If you wish to show all peers, pass false for this.
|
|
40
|
-
*/
|
|
41
|
-
filterNonPublishingPeers?: boolean;
|
|
42
|
-
/**
|
|
43
|
-
* Height that would be subtracted from the parent's height to give the available height, use case: if your pagination is inside the parent component then offsetY would be the height of pagination
|
|
44
|
-
*/
|
|
45
|
-
offsetY?: number;
|
|
46
|
-
}
|
|
47
|
-
export interface useVideoListTile extends TrackWithPeer {
|
|
48
|
-
width: number;
|
|
49
|
-
height: number;
|
|
50
|
-
}
|
|
51
|
-
export interface useVideoResult {
|
|
52
|
-
/**
|
|
53
|
-
* This returns a list of all pages with every page containing the list of all tiles on it.
|
|
54
|
-
*/
|
|
55
|
-
pagesWithTiles: useVideoListTile[][];
|
|
56
|
-
/**
|
|
57
|
-
* add the ref to the element going to render the video list, this is used to measure the available
|
|
58
|
-
* space/dimensions in order to calculate the best fit
|
|
59
|
-
*/
|
|
60
|
-
ref: React.MutableRefObject<any>;
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* This hook can be used to build a paginated gallery view of video tiles. You can give the hook
|
|
64
|
-
* a list of all the peers which need to be shown and it tells you how to structure the UI by giving
|
|
65
|
-
* a list of pages with every page having a list of video tiles.
|
|
66
|
-
* Please check the documentation of input and output types for more details.
|
|
67
|
-
*/
|
|
68
|
-
export declare const useVideoList: ({ peers, maxTileCount, maxColCount, maxRowCount, includeScreenShareForPeer, aspectRatio, filterNonPublishingPeers, offsetY, }: useVideoListInput) => useVideoResult;
|
package/dist/index.d.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
export { HMSRoomProvider, useHMSStore, useHMSActions, useHMSNotifications, useHMSVanillaStore, useHMSVanillaNotifications, useHMSStatsStore, } from './primitives/HmsRoomProvider';
|
|
2
|
-
export { usePreviewJoin } from './hooks/usePreviewJoin';
|
|
3
|
-
export { useAVToggle } from './hooks/useAVToggle';
|
|
4
|
-
export { useVideo } from './hooks/useVideo';
|
|
5
|
-
export { useScreenShare } from './hooks/useScreenShare';
|
|
6
|
-
export { useRemoteAVToggle } from './hooks/useRemoteAVToggle';
|
|
7
|
-
export { useVideoList } from './hooks/useVideoList';
|
|
8
|
-
export { useAudioLevelStyles } from './hooks/useAudioLevelStyles';
|
|
9
|
-
export { useDevices, DeviceType } from './hooks/useDevices';
|
|
10
|
-
export { useParticipantList } from './hooks/useParticipantList';
|
|
11
|
-
export { useRecordingStreaming } from './hooks/useRecordingStreaming';
|
|
12
|
-
export { useAutoplayError } from './hooks/useAutoplayError';
|
|
13
|
-
export { useCustomEvent } from './hooks/useCustomEvent';
|
|
14
|
-
export { useParticipants } from './hooks/useParticipants';
|
|
15
|
-
export type { hooksErrHandler } from './hooks/types';
|
|
16
|
-
export type { usePreviewInput, usePreviewResult } from './hooks/usePreviewJoin';
|
|
17
|
-
export type { useVideoListInput, useVideoResult, useVideoListTile } from './hooks/useVideoList';
|
|
18
|
-
export type { useAVToggleResult } from './hooks/useAVToggle';
|
|
19
|
-
export type { useDevicesResult } from './hooks/useDevices';
|
|
20
|
-
export type { useScreenShareResult } from './hooks/useScreenShare';
|
|
21
|
-
export type { useRemoteAVToggleResult } from './hooks/useRemoteAVToggle';
|
|
22
|
-
export type { useRecordingStreamingResult } from './hooks/useRecordingStreaming';
|
|
23
|
-
export type { useParticipantListResult } from './hooks/useParticipantList';
|
|
24
|
-
export type { useParticipantsResult, useParticipantsParams } from './hooks/useParticipants';
|
|
25
|
-
export type { useVideoInput, useVideoOutput } from './hooks/useVideo';
|
|
26
|
-
export type { useAutoplayErrorResult } from './hooks/useAutoplayError';
|
|
27
|
-
export type { useCustomEventInput, useCustomEventResult } from './hooks/useCustomEvent';
|
|
28
|
-
export { throwErrorHandler } from './utils/commons';
|
|
29
|
-
export * from '@100mslive/hms-video-store';
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
function n(n,t,e,c){return new(e||(e=Promise))((function(o,u){function i(n){try{a(c.next(n))}catch(n){u(n)}}function r(n){try{a(c.throw(n))}catch(n){u(n)}}function a(n){var t;n.done?o(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(i,r)}a((c=c.apply(n,t||[])).next())}))}export{n as __awaiter};
|
|
2
|
-
//# sourceMappingURL=tslib.es6.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tslib.es6.js","sources":["../../../../../node_modules/tslib/tslib.es6.js"],"sourcesContent":["/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n"],"names":["__awaiter","thisArg","_arguments","P","generator","Promise","resolve","reject","fulfilled","value","step","next","e","rejected","result","done","then","apply"],"mappings":"AAqEO,SAASA,EAAUC,EAASC,EAAYC,EAAGC,GAE9C,OAAO,IAAKD,IAAMA,EAAIE,WAAU,SAAUC,EAASC,GAC/C,SAASC,EAAUC,GAAS,IAAMC,EAAKN,EAAUO,KAAKF,IAAW,MAAOG,GAAKL,EAAOK,GAAO,CAC3F,SAASC,EAASJ,GAAS,IAAMC,EAAKN,EAAiB,MAAEK,IAAW,MAAOG,GAAKL,EAAOK,GAAO,CAC9F,SAASF,EAAKI,GAJlB,IAAeL,EAIaK,EAAOC,KAAOT,EAAQQ,EAAOL,QAJ1CA,EAIyDK,EAAOL,MAJhDA,aAAiBN,EAAIM,EAAQ,IAAIN,GAAE,SAAUG,GAAWA,EAAQG,EAAO,KAIhBO,KAAKR,EAAWK,EAAY,CAC9GH,GAAMN,EAAYA,EAAUa,MAAMhB,EAASC,GAAc,KAAKS,OACtE,GACA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"shallow.js","sources":["../../../../../../node_modules/zustand/esm/shallow.js"],"sourcesContent":["function shallow(objA, objB) {\n if (Object.is(objA, objB)) {\n return true;\n }\n if (typeof objA !== \"object\" || objA === null || typeof objB !== \"object\" || objB === null) {\n return false;\n }\n const keysA = Object.keys(objA);\n if (keysA.length !== Object.keys(objB).length) {\n return false;\n }\n for (let i = 0; i < keysA.length; i++) {\n if (!Object.prototype.hasOwnProperty.call(objB, keysA[i]) || !Object.is(objA[keysA[i]], objB[keysA[i]])) {\n return false;\n }\n }\n return true;\n}\n\nexport { shallow as default };\n"],"names":["shallow","objA","objB","Object","is","keysA","keys","length","i","prototype","hasOwnProperty","call"],"mappings":"AAAA,SAASA,EAAQC,EAAMC,GACrB,GAAIC,OAAOC,GAAGH,EAAMC,GAClB,OAAO,EAET,GAAoB,iBAATD,GAA8B,OAATA,GAAiC,iBAATC,GAA8B,OAATA,EAC3E,OAAO,EAET,MAAMG,EAAQF,OAAOG,KAAKL,GAC1B,GAAII,EAAME,SAAWJ,OAAOG,KAAKJ,GAAMK,OACrC,OAAO,EAET,IAAK,IAAIC,EAAI,EAAGA,EAAIH,EAAME,OAAQC,IAChC,IAAKL,OAAOM,UAAUC,eAAeC,KAAKT,EAAMG,EAAMG,MAAQL,OAAOC,GAAGH,EAAKI,EAAMG,IAAKN,EAAKG,EAAMG,KACjG,OAAO,EAGX,OAAO,CACT"}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import React, { PropsWithChildren } from 'react';
|
|
2
|
-
import { HMSStore, HMSActions, HMSNotificationInCallback, HMSNotifications, HMSStatsStore, HMSStats, HMSStoreWrapper, HMSNotificationTypeParam } from '@100mslive/hms-video-store';
|
|
3
|
-
export interface HMSRoomProviderProps {
|
|
4
|
-
actions?: HMSActions;
|
|
5
|
-
store?: HMSStoreWrapper;
|
|
6
|
-
notifications?: HMSNotifications;
|
|
7
|
-
stats?: HMSStats;
|
|
8
|
-
/**
|
|
9
|
-
* if true this will enable webrtc stats collection
|
|
10
|
-
*/
|
|
11
|
-
isHMSStatsOn?: boolean;
|
|
12
|
-
leaveOnUnload?: boolean;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* top level wrapper for using react sdk hooks. This doesn't have any mandatory arguments, if you are already
|
|
16
|
-
* initialising the sdk on your side, you can pass in the primitives from there as well to use hooks for
|
|
17
|
-
* react part of your code.
|
|
18
|
-
* @constructor
|
|
19
|
-
*/
|
|
20
|
-
export declare const HMSRoomProvider: React.FC<PropsWithChildren<HMSRoomProviderProps>>;
|
|
21
|
-
/**
|
|
22
|
-
* `useHMSStore` is a read only hook which can be passed a selector to read data.
|
|
23
|
-
* The hook can only be used in a component if HMSRoomProvider is present in its ancestors.
|
|
24
|
-
*/
|
|
25
|
-
export declare const useHMSStore: <StateSlice>(selector: import("zustand").StateSelector<HMSStore, StateSlice>, equalityFn?: import("zustand").EqualityChecker<StateSlice>) => StateSlice;
|
|
26
|
-
export declare const useHMSStatsStore: <StateSlice>(selector: import("zustand").StateSelector<HMSStatsStore, StateSlice>, equalityFn?: import("zustand").EqualityChecker<StateSlice>) => StateSlice | undefined;
|
|
27
|
-
/**
|
|
28
|
-
* `useHMSVanillaStore` is a read only hook which returns the vanilla HMSStore.
|
|
29
|
-
* Usage:
|
|
30
|
-
* ```
|
|
31
|
-
* const hmsStore = useHMSVanillaStore();
|
|
32
|
-
* const dominantSpeaker = hmsStore.getState(selectDominantSpeaker);
|
|
33
|
-
* ```
|
|
34
|
-
*
|
|
35
|
-
* Note: There's no need to use the vanilla hmsStore in React components.
|
|
36
|
-
* This is used in rare cases where the store needs to be accessed outside a React component.
|
|
37
|
-
* For almost every case, `useHMSStore` would get the job done.
|
|
38
|
-
*/
|
|
39
|
-
export declare const useHMSVanillaStore: () => import("./store").IHMSReactStore<HMSStore>;
|
|
40
|
-
export declare const useHMSVanillaNotifications: () => HMSNotifications | undefined;
|
|
41
|
-
export declare const useHMSActions: () => HMSActions;
|
|
42
|
-
/**
|
|
43
|
-
* `useHMSNotifications` is a read only hook which gives the latest notification(HMSNotification) received.
|
|
44
|
-
* @param type can be a string or an array of string for the types of notifications to listen to. If an array is passed
|
|
45
|
-
* either declare it outside the functional component or use a useMemo to make sure its reference stays same across
|
|
46
|
-
* rerenders for performance reasons.
|
|
47
|
-
*/
|
|
48
|
-
export declare const useHMSNotifications: <T extends HMSNotificationTypeParam>(type?: T | undefined) => HMSNotificationInCallback<T> | null;
|
|
49
|
-
export declare const useIsHMSStatsOn: () => boolean;
|