@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
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { EqualityChecker, StateSelector } from 'zustand';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { HMSActions, HMSStore, HMSNotifications, HMSStatsStore, IStoreReadOnly } from '@100mslive/hms-video-store';
|
|
4
|
-
export interface IHMSReactStore<S extends HMSStore | HMSStatsStore> extends IStoreReadOnly<S> {
|
|
5
|
-
<U>(selector: StateSelector<S, U>, equalityFn?: EqualityChecker<U>): U;
|
|
6
|
-
}
|
|
7
|
-
export declare const hooksErrorMessage = "It seems like you forgot to add your component within a top level HMSRoomProvider, please refer to 100ms react docs(https://docs.100ms.live/javascript/v2/features/integration#react-hooks) to check on the required steps for using this hook.";
|
|
8
|
-
export interface HMSContextProviderProps {
|
|
9
|
-
actions: HMSActions;
|
|
10
|
-
store: IHMSReactStore<HMSStore>;
|
|
11
|
-
notifications?: HMSNotifications;
|
|
12
|
-
statsStore?: IHMSReactStore<HMSStatsStore>;
|
|
13
|
-
}
|
|
14
|
-
export declare function makeHMSStoreHook(hmsContext: React.Context<HMSContextProviderProps | null>): <StateSlice>(selector: StateSelector<HMSStore, StateSlice>, equalityFn?: EqualityChecker<StateSlice>) => StateSlice;
|
|
15
|
-
export declare function makeHMSStatsStoreHook(hmsContext: React.Context<HMSContextProviderProps | null>): <StateSlice>(selector: StateSelector<HMSStatsStore, StateSlice>, equalityFn?: EqualityChecker<StateSlice>) => StateSlice | undefined;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { EqualityChecker, StateSelector } from 'zustand';
|
|
2
|
-
import { HMSStore, IStoreReadOnly, HMSStatsStore } from '@100mslive/hms-video-store';
|
|
3
|
-
export interface IHMSReactStore<S extends HMSStore | HMSStatsStore> extends IStoreReadOnly<S> {
|
|
4
|
-
<U>(selector: StateSelector<S, U>, equalityFn?: EqualityChecker<U>): U;
|
|
5
|
-
}
|
package/dist/utils/commons.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { hooksErrHandler } from '../hooks/types';
|
|
2
|
-
export declare const logErrorHandler: hooksErrHandler;
|
|
3
|
-
/**
|
|
4
|
-
* pass in this error handler to get the error thrown back to the UI for further handling, showing toast etc.
|
|
5
|
-
* @param err
|
|
6
|
-
*/
|
|
7
|
-
export declare const throwErrorHandler: hooksErrHandler;
|
package/dist/utils/groupBy.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { HMSPeer } from '@100mslive/hms-video-store';
|
|
2
|
-
/**
|
|
3
|
-
* Give array like [
|
|
4
|
-
* { name: 'peer1', id: 1, roleName: 'role1' },
|
|
5
|
-
* { name: 'peer2', id: 2, roleName: 'role2' }
|
|
6
|
-
*]
|
|
7
|
-
* the output will be
|
|
8
|
-
* {
|
|
9
|
-
* 'role1': [{'name': 'peer1', id: 1, roleName: 'role1'}],
|
|
10
|
-
* 'role2': [{ name: 'peer2', id: 2, roleName: 'role2' }]
|
|
11
|
-
* }
|
|
12
|
-
* @param {HMSPeer[]} peers
|
|
13
|
-
* @returns
|
|
14
|
-
*/
|
|
15
|
-
export declare const groupByRoles: (peers: HMSPeer[]) => Record<string, HMSPeer[]>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const isBrowser: boolean;
|
package/dist/utils/layout.d.ts
DELETED
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
import { HMSPeer, HMSTrack, HMSTrackID, HMSVideoTrack, HMSScreenVideoTrack } from '@100mslive/hms-video-store';
|
|
2
|
-
export declare const chunk: <T>(elements: T[], chunkSize: number, onlyOnePage: boolean) => T[][];
|
|
3
|
-
interface ChunkElements<T> {
|
|
4
|
-
elements: T[];
|
|
5
|
-
tilesInFirstPage: number;
|
|
6
|
-
onlyOnePage: boolean;
|
|
7
|
-
isLastPageDifferentFromFirstPage: boolean;
|
|
8
|
-
defaultWidth: number;
|
|
9
|
-
defaultHeight: number;
|
|
10
|
-
lastPageWidth: number;
|
|
11
|
-
lastPageHeight: number;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Given a list of tracks/elements and some constraints, group the tracks in separate pages.
|
|
15
|
-
* @return 2D list for every page which has the original element and height and width
|
|
16
|
-
* for its tile.
|
|
17
|
-
*/
|
|
18
|
-
export declare const chunkElements: <T>({ elements, tilesInFirstPage, onlyOnePage, isLastPageDifferentFromFirstPage, defaultWidth, defaultHeight, lastPageWidth, lastPageHeight, }: ChunkElements<T>) => (T & {
|
|
19
|
-
width: number;
|
|
20
|
-
height: number;
|
|
21
|
-
})[][];
|
|
22
|
-
/**
|
|
23
|
-
* Mathematical mode - the element with the highest occurrence in an array
|
|
24
|
-
* @param array
|
|
25
|
-
*/
|
|
26
|
-
export declare function mode(array: number[]): number | null;
|
|
27
|
-
export declare type TrackWithPeer = {
|
|
28
|
-
track?: HMSVideoTrack | HMSScreenVideoTrack;
|
|
29
|
-
peer: HMSPeer;
|
|
30
|
-
};
|
|
31
|
-
/**
|
|
32
|
-
* get the aspect ration occurring with the highest frequency
|
|
33
|
-
* @param tracks - video tracks to infer aspect ratios from
|
|
34
|
-
*/
|
|
35
|
-
export declare const getModeAspectRatio: (tracks: TrackWithPeer[]) => number | null;
|
|
36
|
-
interface GetTileSizesInList {
|
|
37
|
-
count: number;
|
|
38
|
-
parentWidth: number;
|
|
39
|
-
parentHeight: number;
|
|
40
|
-
maxTileCount?: number;
|
|
41
|
-
maxRowCount?: number;
|
|
42
|
-
maxColCount?: number;
|
|
43
|
-
aspectRatio: {
|
|
44
|
-
width: number;
|
|
45
|
-
height: number;
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
interface GetTileSizes {
|
|
49
|
-
parentWidth: number;
|
|
50
|
-
parentHeight: number;
|
|
51
|
-
count: number;
|
|
52
|
-
maxCount: number;
|
|
53
|
-
aspectRatio: {
|
|
54
|
-
width: number;
|
|
55
|
-
height: number;
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Finds the largest rectangle area when trying to place N rectangle into a containing
|
|
60
|
-
* rectangle without rotation.
|
|
61
|
-
*
|
|
62
|
-
* @param {Number} containerWidth The width of the container.
|
|
63
|
-
* @param {Number} containerHeight The height of the container.
|
|
64
|
-
* @param {Number} numRects How many rectangles must fit within.
|
|
65
|
-
* @param {Number} width The unscaled width of the rectangles to be placed.
|
|
66
|
-
* @param {Number} height The unscaled height of the rectangles to be placed.
|
|
67
|
-
* @return {Object} The area and number of rows and columns that fit.
|
|
68
|
-
*/
|
|
69
|
-
export declare const largestRect: (containerWidth: number, containerHeight: number, numRects: number, width: number | undefined, height: number | undefined) => {
|
|
70
|
-
area: number;
|
|
71
|
-
cols: number;
|
|
72
|
-
rows: number;
|
|
73
|
-
width: number;
|
|
74
|
-
height: number;
|
|
75
|
-
};
|
|
76
|
-
export declare const getTileSizesWithColConstraint: ({ parentWidth, parentHeight, count, maxCount, aspectRatio, }: GetTileSizes) => {
|
|
77
|
-
tilesInFirstPage: number;
|
|
78
|
-
defaultWidth: number;
|
|
79
|
-
defaultHeight: number;
|
|
80
|
-
lastPageWidth: number;
|
|
81
|
-
lastPageHeight: number;
|
|
82
|
-
isLastPageDifferentFromFirstPage: boolean;
|
|
83
|
-
};
|
|
84
|
-
export declare const getTileSizesWithPageConstraint: ({ parentWidth, parentHeight, count, maxCount, aspectRatio, }: GetTileSizes) => {
|
|
85
|
-
tilesInFirstPage: number;
|
|
86
|
-
defaultWidth: number;
|
|
87
|
-
defaultHeight: number;
|
|
88
|
-
lastPageWidth: number;
|
|
89
|
-
lastPageHeight: number;
|
|
90
|
-
isLastPageDifferentFromFirstPage: boolean;
|
|
91
|
-
};
|
|
92
|
-
export declare const getTileSizesWithRowConstraint: ({ parentWidth, parentHeight, count, maxCount, aspectRatio, }: GetTileSizes) => {
|
|
93
|
-
tilesInFirstPage: number;
|
|
94
|
-
defaultWidth: number;
|
|
95
|
-
defaultHeight: number;
|
|
96
|
-
lastPageWidth: number;
|
|
97
|
-
lastPageHeight: number;
|
|
98
|
-
isLastPageDifferentFromFirstPage: boolean;
|
|
99
|
-
};
|
|
100
|
-
export declare function calculateLayoutSizes({ count, parentWidth, parentHeight, maxTileCount, maxRowCount, maxColCount, aspectRatio, }: GetTileSizesInList): {
|
|
101
|
-
tilesInFirstPage: number;
|
|
102
|
-
defaultWidth: number;
|
|
103
|
-
defaultHeight: number;
|
|
104
|
-
lastPageWidth: number;
|
|
105
|
-
lastPageHeight: number;
|
|
106
|
-
isLastPageDifferentFromFirstPage: boolean;
|
|
107
|
-
};
|
|
108
|
-
/**
|
|
109
|
-
* given list of peers and all tracks in the room, get a list of tile objects to show in the UI
|
|
110
|
-
* @param peers
|
|
111
|
-
* @param tracks
|
|
112
|
-
* @param includeScreenShareForPeer - fn will be called to check whether to include screenShare for the peer in returned tiles
|
|
113
|
-
* @param filterNonPublishingPeers - by default a peer with no tracks won't be counted towards final tiles
|
|
114
|
-
*/
|
|
115
|
-
export declare const getVideoTracksFromPeers: (peers: HMSPeer[], tracks: Record<HMSTrackID, HMSTrack>, includeScreenShareForPeer: (peer: HMSPeer) => boolean, filterNonPublishingPeers?: boolean) => TrackWithPeer[];
|
|
116
|
-
export {};
|
package/dist/utils/logger.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export declare enum HMSLogLevel {
|
|
2
|
-
VERBOSE = 0,
|
|
3
|
-
DEBUG = 1,
|
|
4
|
-
INFO = 2,
|
|
5
|
-
WARN = 3,
|
|
6
|
-
ERROR = 4,
|
|
7
|
-
NONE = 5
|
|
8
|
-
}
|
|
9
|
-
export default class HMSLogger {
|
|
10
|
-
static level: HMSLogLevel;
|
|
11
|
-
static v(tag: string, ...data: any[]): void;
|
|
12
|
-
static d(tag: string, ...data: any[]): void;
|
|
13
|
-
static i(tag: string, ...data: any[]): void;
|
|
14
|
-
static w(tag: string, ...data: any[]): void;
|
|
15
|
-
static e(tag: string, ...data: any[]): void;
|
|
16
|
-
private static log;
|
|
17
|
-
}
|