@100mslive/react-sdk 0.4.3 → 0.4.4
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/types.d.ts +6 -0
- package/dist/hooks/useAVToggle.d.ts +24 -0
- package/dist/hooks/useAVToggle.js +1 -1
- package/dist/hooks/useAVToggle.js.map +1 -1
- package/dist/hooks/useAudioLevelStyles.d.ts +15 -0
- package/dist/hooks/useAudioLevelStyles.js.map +1 -1
- package/dist/hooks/useAutoplayError.d.ts +17 -0
- package/dist/hooks/useAutoplayError.js +1 -1
- package/dist/hooks/useAutoplayError.js.map +1 -1
- package/dist/hooks/useCustomEvent.d.ts +58 -0
- package/dist/hooks/useCustomEvent.js +1 -1
- package/dist/hooks/useCustomEvent.js.map +1 -1
- package/dist/hooks/useDevices.d.ts +40 -0
- package/dist/hooks/useDevices.js +1 -1
- package/dist/hooks/useDevices.js.map +1 -1
- package/dist/hooks/useParticipantList.d.ts +13 -0
- package/dist/hooks/useParticipantList.js.map +1 -1
- package/dist/hooks/useParticipants.d.ts +42 -0
- package/dist/hooks/useParticipants.js +1 -1
- package/dist/hooks/useParticipants.js.map +1 -1
- package/dist/hooks/usePreviewJoin.d.ts +58 -0
- package/dist/hooks/usePreviewJoin.js +1 -1
- package/dist/hooks/usePreviewJoin.js.map +1 -1
- package/dist/hooks/useRecordingStreaming.d.ts +10 -0
- package/dist/hooks/useRecordingStreaming.js.map +1 -1
- package/dist/hooks/useRemoteAVToggle.d.ts +36 -0
- package/dist/hooks/useRemoteAVToggle.js +1 -1
- package/dist/hooks/useRemoteAVToggle.js.map +1 -1
- package/dist/hooks/useScreenShare.d.ts +40 -0
- package/dist/hooks/useScreenShare.js +1 -1
- package/dist/hooks/useScreenShare.js.map +1 -1
- package/dist/hooks/useVideo.d.ts +27 -0
- package/dist/hooks/useVideo.js +1 -1
- package/dist/hooks/useVideo.js.map +1 -1
- package/dist/hooks/useVideoList.d.ts +68 -0
- 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/index.d.ts +29 -0
- package/dist/node_modules/tslib/tslib.es6.js +2 -0
- package/dist/node_modules/tslib/tslib.es6.js.map +1 -0
- package/dist/{node_modules → packages/react-sdk/node_modules}/zustand/esm/shallow.js +0 -0
- package/dist/packages/react-sdk/node_modules/zustand/esm/shallow.js.map +1 -0
- package/dist/primitives/HmsRoomProvider.d.ts +49 -0
- package/dist/primitives/HmsRoomProvider.js +1 -1
- package/dist/primitives/HmsRoomProvider.js.map +1 -1
- package/dist/primitives/store.d.ts +15 -0
- package/dist/primitives/store.js +1 -1
- package/dist/primitives/store.js.map +1 -1
- package/dist/primitives/types.d.ts +5 -0
- package/dist/utils/commons.d.ts +7 -0
- package/dist/utils/commons.js.map +1 -1
- package/dist/utils/groupBy.d.ts +15 -0
- package/dist/utils/groupBy.js.map +1 -1
- package/dist/utils/isBrowser.d.ts +1 -0
- package/dist/utils/isBrowser.js.map +1 -1
- package/dist/utils/layout.d.ts +116 -0
- package/dist/utils/layout.js +1 -1
- package/dist/utils/layout.js.map +1 -1
- package/dist/utils/logger.d.ts +17 -0
- package/dist/utils/logger.js +1 -1
- package/dist/utils/logger.js.map +1 -1
- package/package.json +3 -4
- package/src/primitives/HmsRoomProvider.ts +1 -2
- package/dist/node_modules/zustand/esm/shallow.js.map +0 -1
- package/dist/package.json.js +0 -2
- package/dist/package.json.js.map +0 -1
|
@@ -0,0 +1,6 @@
|
|
|
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;
|
|
@@ -0,0 +1,24 @@
|
|
|
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,2 +1,2 @@
|
|
|
1
|
-
import{selectIsLocalAudioEnabled as
|
|
1
|
+
import{__awaiter as o}from"../node_modules/tslib/tslib.es6.js";import{selectIsLocalAudioEnabled as i,selectIsLocalVideoEnabled as d,selectIsAllowedToPublish as e}from"@100mslive/hms-video-store";import{useCallback as t}from"react";import{useHMSStore as l,useHMSActions as r}from"../primitives/HmsRoomProvider.js";import{logErrorHandler as s}from"../utils/commons.js";const m=(m=s)=>{const n=l(i),v=l(d),c=l(e),a=r(),u=t((()=>o(void 0,void 0,void 0,(function*(){try{yield a.setLocalAudioEnabled(!n)}catch(o){m(o,"toggleAudio")}}))),[a,n,m]),g=t((()=>o(void 0,void 0,void 0,(function*(){try{yield a.setLocalVideoEnabled(!v)}catch(o){m(o,"toggleVideo")}}))),[a,v,m]);return{isLocalAudioEnabled:n,isLocalVideoEnabled:v,toggleAudio:(null==c?void 0:c.audio)?u:void 0,toggleVideo:(null==c?void 0:c.video)?g:void 0}};export{m as useAVToggle};
|
|
2
2
|
//# sourceMappingURL=useAVToggle.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAVToggle.js","sources":["../../src/hooks/useAVToggle.ts"],"sourcesContent":[
|
|
1
|
+
{"version":3,"file":"useAVToggle.js","sources":["../../src/hooks/useAVToggle.ts"],"sourcesContent":[null],"names":["useAVToggle","handleError","logErrorHandler","isLocalAudioEnabled","useHMSStore","selectIsLocalAudioEnabled","isLocalVideoEnabled","selectIsLocalVideoEnabled","isAllowedToPublish","selectIsAllowedToPublish","actions","useHMSActions","toggleAudio","useCallback","__awaiter","setLocalAudioEnabled","err","toggleVideo","setLocalVideoEnabled","audio","video"],"mappings":"+WAiCa,MAAAA,EAAc,CAACC,EAA+BC,KACzD,MAAMC,EAAsBC,EAAYC,GAClCC,EAAsBF,EAAYG,GAClCC,EAAqBJ,EAAYK,GACjCC,EAAUC,IAEVC,EAAcC,GAAY,IAAWC,OAAA,OAAA,OAAA,GAAA,YACrC,UACIJ,EAAQK,sBAAsBZ,EAEV,CAFU,MAC7Ba,GACPf,EAAYe,EAAc,cAAA,CAE3B,KAAA,CAACN,EAASP,EAAqBF,IAE5BgB,EAAcJ,GAAY,IAAWC,OAAA,OAAA,OAAA,GAAA,YACrC,UACIJ,EAAQQ,sBAAsBZ,EAEV,CAFU,MAC7BU,GACPf,EAAYe,EAAc,cAAA,CAE3B,KAAA,CAACN,EAASJ,EAAqBL,IAE3B,MAAA,CACLE,sBACAG,sBACAM,4BAAaJ,EAAoBW,OAAQP,OAAc,EACvDK,4BAAaT,EAAoBY,OAAQH,OAAc,EAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAudioLevelStyles.js","sources":["../../src/hooks/useAudioLevelStyles.ts"],"sourcesContent":[
|
|
1
|
+
{"version":3,"file":"useAudioLevelStyles.js","sources":["../../src/hooks/useAudioLevelStyles.ts"],"sourcesContent":[null],"names":["useAudioLevelStyles","trackId","getStyle","ref","store","useHMSVanillaStore","useEffect","subscribe","level","current","styles","key","style","selectTrackAudioByID"],"mappings":"0KAaM,SAA8BA,GAAAC,QAClCA,EACAC,SAAAA,EAAAC,IACAA,IAMA,MAAMC,EAAQC,IAEZC,GAAA,IACEF,EAAMG,WAAkBC,IAClB,IAACL,EAAIM,QACP,OAEF,MAAMC,EAASR,EAASM,GACxB,IAAA,MAAWG,KAAOD,EACZP,EAAAM,QAAQG,MAAMD,GAAOD,EAAOC,EAAA,GAEjCE,EAAqBZ,KAC1B,CAACC,EAAUC,EAAKC,EAAOH,GAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
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,2 +1,2 @@
|
|
|
1
|
-
import{useState as
|
|
1
|
+
import{__awaiter as o}from"../node_modules/tslib/tslib.es6.js";import{useState as r,useCallback as i,useEffect as e}from"react";import{HMSNotificationTypes as t}from"@100mslive/hms-video-store";import{useHMSNotifications as s,useHMSActions as d}from"../primitives/HmsRoomProvider.js";const m=()=>{const m=s(t.ERROR),[l,n]=r(""),u=d(),v=i((()=>o(void 0,void 0,void 0,(function*(){yield u.unblockAudio()}))),[u]);return e((()=>{3008===(null==m?void 0:m.data.code)&&n(null==m?void 0:m.data.message)}),[m]),{error:l,unblockAudio:v,resetError:()=>n("")}};export{m as useAutoplayError};
|
|
2
2
|
//# sourceMappingURL=useAutoplayError.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAutoplayError.js","sources":["../../src/hooks/useAutoplayError.ts"],"sourcesContent":[
|
|
1
|
+
{"version":3,"file":"useAutoplayError.js","sources":["../../src/hooks/useAutoplayError.ts"],"sourcesContent":[null],"names":["useAutoplayError","notification","useHMSNotifications","HMSNotificationTypes","ERROR","error","setError","useState","actions","useHMSActions","unblockAudio","useCallback","__awaiter","useEffect","data","code","message","resetError"],"mappings":"4RAwBO,MAAMA,EAAmB,KACxB,MAAAC,EAAeC,EAAoBC,EAAqBC,QACvDC,EAAOC,GAAYC,EAAS,IAC7BC,EAAUC,IAEVC,EAAeC,GAAY,IAAWC,OAAA,OAAA,OAAA,GAAA,kBACpCJ,EAAQE,cAAA,KACb,CAACF,IAQJ,OANAK,GAAU,KACwB,QAA5BZ,aAAA,EAAAA,EAAca,KAAKC,OACrBT,EAASL,aAAY,EAAZA,EAAca,KAAKE,QAAA,GAE7B,CAACf,IAEG,CAAEI,QAAOK,eAAcO,WAAY,IAAMX,EAAS,IAAA"}
|
|
@@ -0,0 +1,58 @@
|
|
|
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,2 +1,2 @@
|
|
|
1
|
-
import{useHMSActions as
|
|
1
|
+
import{__awaiter as e}from"../node_modules/tslib/tslib.es6.js";import{useHMSActions as s,useHMSVanillaNotifications as o}from"../primitives/HmsRoomProvider.js";import{useEffect as r,useCallback as t}from"react";import{HMSNotificationTypes as i}from"@100mslive/hms-video-store";import{logErrorHandler as n}from"../utils/commons.js";const m=({type:m,json:d=!0,onEvent:a,handleError:l=n})=>{const c=s(),p=o();r((()=>{c.ignoreMessageTypes([m])}),[c,m]),r((()=>{if(!p)return;return p.onNotification((e=>{const s=e.data;if(s&&s.type===m)try{const e=d?JSON.parse(s.message):s.message;null==a||a(e)}catch(e){l(e,"handleCustomEvent")}}),i.NEW_MESSAGE)}),[p,m,d,a,l]);return{sendEvent:t(((s,o)=>e(void 0,void 0,void 0,(function*(){try{const e=((e,s)=>s?JSON.stringify(e||""):e)(s,d);o&&Array.isArray(null==o?void 0:o.roleNames)?yield c.sendGroupMessage(e,o.roleNames,m):"string"==typeof(null==o?void 0:o.peerId)?yield c.sendDirectMessage(e,o.peerId,m):yield c.sendBroadcastMessage(e,m),null==a||a(s)}catch(e){l(e,"sendCustomEvent")}}))),[c,l,a,m,d])}};export{m as useCustomEvent};
|
|
2
2
|
//# sourceMappingURL=useCustomEvent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCustomEvent.js","sources":["../../src/hooks/useCustomEvent.ts"],"sourcesContent":[
|
|
1
|
+
{"version":3,"file":"useCustomEvent.js","sources":["../../src/hooks/useCustomEvent.ts"],"sourcesContent":[null],"names":["useCustomEvent","type","json","onEvent","handleError","logErrorHandler","actions","useHMSActions","notifications","useHMSVanillaNotifications","useEffect","ignoreMessageTypes","onNotification","notification","msg","data","JSON","parse","message","err","HMSNotificationTypes","NEW_MESSAGE","sendEvent","useCallback","receiver","__awaiter","dataStr","stringify","stringifyData","Array","isArray","roleNames","sendGroupMessage","peerId","sendDirectMessage","sendBroadcastMessage"],"mappings":"2UA2DA,MAOaA,EAAiB,EAC5BC,OACAC,QAAO,EACPC,UACAC,cAAcC,MAEd,MAAMC,EAAUC,IACVC,EAAgBC,IAEtBC,GAAU,KAERJ,EAAQK,mBAAmB,CAACV,GAAA,GAC3B,CAACK,EAASL,IAGbS,GAAU,KACR,IAAKF,EACH,OAaK,OAXaA,EAAcI,gBAA8BC,IAC9D,MAAMC,EAAMD,EAAaE,KACrB,GAAAD,GAAOA,EAAIb,OAASA,EAClB,IACF,MAAMc,EAAOb,EAAOc,KAAKC,MAAMH,EAAII,SAAWJ,EAAII,QAClDf,SAAAA,EAAUY,EAEgB,CAFhB,MACHI,GACPf,EAAYe,EAAc,oBAAA,CAAA,GAG7BC,EAAqBC,YACjB,GACN,CAACb,EAAeP,EAAMC,EAAMC,EAASC,IAsBxC,MAAO,CAAEkB,UAnBSC,GAChB,CAAOR,EAASS,IAA4BC,OAAA,OAAA,OAAA,GAAA,YACtC,IACI,MAAAC,EA5CQ,EAAIX,EAASb,IAAmBA,EAAOc,KAAKW,UAAUZ,GAAQ,IAAOA,EA4CnEa,CAAiBb,EAAMb,GACnCsB,GAAYK,MAAMC,QAAQN,aAAA,EAAAA,EAAUO,iBAChCzB,EAAQ0B,iBAAiBN,EAASF,EAASO,UAAW9B,GACvB,8BAAb,EAARuB,EAAUS,cACpB3B,EAAQ4B,kBAAkBR,EAASF,EAASS,OAAQhC,SAEpDK,EAAQ6B,qBAAqBT,EAASzB,GAE9CE,SAAAA,EAAUY,EAEgB,CAFhB,MACHI,GACPf,EAAYe,EAAc,kBAAA,CAAA,KAG9B,CAACb,EAASF,EAAaD,EAASF,EAAMC,IAG/B"}
|
|
@@ -0,0 +1,40 @@
|
|
|
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;
|
package/dist/hooks/useDevices.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{selectDevices as
|
|
1
|
+
import{__awaiter as e}from"../node_modules/tslib/tslib.es6.js";import{selectDevices as i,selectLocalMediaSettings as t,selectIsAllowedToPublish as u}from"@100mslive/hms-video-store";import{useCallback as o}from"react";import{useHMSActions as d,useHMSStore as p}from"../primitives/HmsRoomProvider.js";import{logErrorHandler as s}from"../utils/commons.js";var v,a;(a=v||(v={})).videoInput="videoInput",a.audioInput="audioInput",a.audioOutput="audioOutput";const c=(a=s)=>{const c=d(),n=p(i),r=p(t),I=p(u),m={[v.audioOutput]:r.audioOutputDeviceId},l={[v.audioOutput]:n.audioOutput};I.video&&(l[v.videoInput]=n.videoInput,m[v.videoInput]=r.videoInputDeviceId),I.audio&&(l[v.audioInput]=n.audioInput,m[v.audioInput]=r.audioInputDeviceId);return{allDevices:l,selectedDeviceIDs:m,updateDevice:o((({deviceType:i,deviceId:t})=>e(void 0,void 0,void 0,(function*(){try{switch(i){case v.audioInput:yield c.setAudioSettings({deviceId:t});break;case v.videoInput:yield c.setVideoSettings({deviceId:t});break;case v.audioOutput:yield c.setAudioOutputDevice(t)}}catch(e){a(e,"updateDevices")}}))),[a,c])}};export{v as DeviceType,c as useDevices};
|
|
2
2
|
//# sourceMappingURL=useDevices.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDevices.js","sources":["../../src/hooks/useDevices.ts"],"sourcesContent":[
|
|
1
|
+
{"version":3,"file":"useDevices.js","sources":["../../src/hooks/useDevices.ts"],"sourcesContent":[null],"names":["DeviceType","DeviceType2","useDevices","handleError","logErrorHandler","actions","useHMSActions","sdkAllDevices","useHMSStore","selectDevices","sdkSelectedDevices","selectLocalMediaSettings","isAllowedToPublish","selectIsAllowedToPublish","selectedDeviceIDs","audioOutput","audioOutputDeviceId","allDevices","video","videoInput","videoInputDeviceId","audio","audioInput","audioInputDeviceId","updateDevice","useCallback","deviceType","deviceId","__awaiter","setAudioSettings","setVideoSettings","setAudioOutputDevice","err"],"mappings":"kWAMY,IAAAA,EAAAC,KAAAD,IAIXA,EAAA,CAAA,IAHC,WAAA,aACAC,EAAA,WAAA,aACAA,EAAA,YAAA,cAmCW,MAAAC,EAAa,CAACC,EAA+BC,KACxD,MAAMC,EAAUC,IACVC,EAAsDC,EAAYC,GAClEC,EAAqBF,EAAYG,GACjCC,EAAqBJ,EAAYK,GAEjCC,EAA+C,CAClD,CAAAd,EAAWe,aAAcL,EAAmBM,qBAEzCC,EAAmD,CACtD,CAAAjB,EAAWe,aAAcR,EAAcQ,aAGtCH,EAAmBM,QACVD,EAAAjB,EAAWmB,YAAcZ,EAAcY,WAChCL,EAAAd,EAAWmB,YAAcT,EAAmBU,oBAE5DR,EAAmBS,QACVJ,EAAAjB,EAAWsB,YAAcf,EAAce,WAChCR,EAAAd,EAAWsB,YAAcZ,EAAmBa,oBAwBzD,MAAA,CACLN,aACAH,oBACAU,aAxBmBC,GACnB,EAASC,aAAYC,cAA4DC,OAAA,OAAA,OAAA,GAAA,YAC3E,IACM,OAAAF,GAAA,KACD1B,EAAWsB,iBACRjB,EAAQwB,iBAAiB,CAAEF,aACjC,MAAA,KACG3B,EAAWmB,iBACRd,EAAQyB,iBAAiB,CAAEH,aACjC,MAAA,KACG3B,EAAWe,kBACRV,EAAQ0B,qBAAqBJ,GAIb,CAHtB,MAEGK,GACP7B,EAAY6B,EAAc,gBAAA,CAAA,KAG9B,CAAC7B,EAAaE,IAMd"}
|
|
@@ -0,0 +1,13 @@
|
|
|
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useParticipantList.js","sources":["../../src/hooks/useParticipantList.ts"],"sourcesContent":[
|
|
1
|
+
{"version":3,"file":"useParticipantList.js","sources":["../../src/hooks/useParticipantList.ts"],"sourcesContent":[null],"names":["useParticipantList","isConnected","useHMSStore","selectIsConnectedToRoom","participantList","selectPeers","selectRemotePeers","peerCount","selectPeerCount","participantsByRoles","useMemo","groupByRoles","roles","Object","keys"],"mappings":"oRAmBO,MAAMA,EAAqB,KAChC,MAAMC,EAAcC,EAAYC,GAC1BC,EAAkBF,EAAYD,EAAcI,EAAcC,GAC1DC,EAAYL,EAAYM,GACxBC,EAAsBC,GAAQ,IAAMC,EAAaP,IAAkB,CAACA,IAEnE,MAAA,CAAEQ,MADKC,OAAOC,KAAKL,GACVA,sBAAqBF,YAAWN,cAAA"}
|
|
@@ -0,0 +1,42 @@
|
|
|
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,2 +1,2 @@
|
|
|
1
|
-
import{selectIsConnectedToRoom as e,selectPeerCount as
|
|
1
|
+
import{selectIsConnectedToRoom as e,selectPeerCount as o,selectAvailableRoleNames as r,selectPeers as i,selectRemotePeers as t,selectPeerMetadata as s}from"@100mslive/hms-video-store";import{useHMSStore as a,useHMSVanillaStore as l}from"../primitives/HmsRoomProvider.js";const n=n=>{var d;const m=a(e),v=a(o),c=a(r);let u=a(m?i:t);const p=Array.from(new Set(u.map((e=>e.roleName)))),f=l();if((null===(d=null==n?void 0:n.metadata)||void 0===d?void 0:d.isHandRaised)&&(u=u.filter((e=>f.getState(s(e.id)).isHandRaised))),(null==n?void 0:n.role)&&c.includes(n.role)&&(u=u.filter((e=>e.roleName===n.role))),null==n?void 0:n.search){const e=n.search.toLowerCase();u=u.filter((o=>{var r;return(null===(r=o.roleName)||void 0===r?void 0:r.toLowerCase().includes(e))||o.name.toLowerCase().includes(e)}))}return{participants:u,isConnected:m,peerCount:v,rolesWithParticipants:p}};export{n as useParticipants};
|
|
2
2
|
//# sourceMappingURL=useParticipants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useParticipants.js","sources":["../../src/hooks/useParticipants.ts"],"sourcesContent":[
|
|
1
|
+
{"version":3,"file":"useParticipants.js","sources":["../../src/hooks/useParticipants.ts"],"sourcesContent":[null],"names":["useParticipants","params","isConnected","useHMSStore","selectIsConnectedToRoom","peerCount","selectPeerCount","availableRoles","selectAvailableRoleNames","participantList","selectPeers","selectRemotePeers","rolesWithParticipants","Array","from","Set","map","peer","roleName","vanillaStore","useHMSVanillaStore","_a","metadata","isHandRaised","filter","getState","selectPeerMetadata","id","role","includes","search","toLowerCase","_a2","name","participants"],"mappings":"+QAiDa,MAAAA,EAAmBC,UAC9B,MAAMC,EAAcC,EAAYC,GAC1BC,EAAYF,EAAYG,GACxBC,EAAiBJ,EAAYK,GAC/B,IAAAC,EAAkBN,EAAYD,EAAcQ,EAAcC,GACxD,MAAAC,EAAwBC,MAAMC,KAAK,IAAIC,IAAIN,EAAgBO,QAAYC,EAAKC,aAC5EC,EAAeC,IASrB,IARsB,QAAlBC,EAAApB,aAAM,EAANA,EAAQqB,gBAAU,IAAAD,OAAA,EAAAA,EAAAE,gBACFd,EAAAA,EAAgBe,QAAcP,GACvCE,EAAaM,SAASC,EAAmBT,EAAKU,KAAKJ,iBAG1DtB,aAAM,EAANA,EAAQ2B,OAAQrB,EAAesB,SAAS5B,EAAO2B,QACjDnB,EAAkBA,EAAgBe,QAAeP,GAAAA,EAAKC,WAAajB,EAAO2B,QAExE3B,eAAAA,EAAQ6B,OAAQ,CACZ,MAAAA,EAAS7B,EAAO6B,OAAOC,cACXtB,EAAAA,EAAgBe,QACxBP,IAAA,IAAAe,EAAA,eAAAA,EAAAf,EAAKC,+BAAUa,cAAcF,SAASC,KAAWb,EAAKgB,KAAKF,cAAcF,SAASC,EAAA,GAAA,CAG9F,MAAO,CAAEI,aAAczB,EAAiBP,cAAaG,YAAWO,wBAAA"}
|
|
@@ -0,0 +1,58 @@
|
|
|
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,2 +1,2 @@
|
|
|
1
|
-
import{selectRoomState as
|
|
1
|
+
import{__awaiter as e}from"../node_modules/tslib/tslib.es6.js";import{selectRoomState as i,selectIsConnectedToRoom as t,HMSRoomState as o}from"@100mslive/hms-video-store";import{useMemo as r,useCallback as n}from"react";import{useHMSActions as m,useHMSStore as s}from"../primitives/HmsRoomProvider.js";import{logErrorHandler as a}from"../utils/commons.js";const d=({name:d="",token:v,metadata:c,handleError:l=a,initEndpoint:p,initialSettings:u,captureNetworkQualityInPreview:f})=>{const w=m(),y=s(i),j=s(t)||!1,h=y===o.Preview,b=r((()=>({userName:d,authToken:v,metaData:c,rememberDeviceSelection:!0,settings:u,initEndpoint:p,captureNetworkQualityInPreview:f})),[d,v,c,p,u,f]),k=n((()=>e(void 0,void 0,void 0,(function*(){if(v&&y===o.Disconnected){j&&(yield w.leave());try{yield w.preview(b)}catch(e){l(e,"preview")}}}))),[w,l,v,y,b,j]);return{enableJoin:h,join:n((()=>e(void 0,void 0,void 0,(function*(){if(v)try{yield w.join(b)}catch(e){l(e,"join")}}))),[w,b,l,v]),isConnected:j,preview:k}};export{d as usePreviewJoin};
|
|
2
2
|
//# sourceMappingURL=usePreviewJoin.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePreviewJoin.js","sources":["../../src/hooks/usePreviewJoin.ts"],"sourcesContent":[
|
|
1
|
+
{"version":3,"file":"usePreviewJoin.js","sources":["../../src/hooks/usePreviewJoin.ts"],"sourcesContent":[null],"names":["usePreviewJoin","name","token","metadata","handleError","logErrorHandler","initEndpoint","initialSettings","captureNetworkQualityInPreview","actions","useHMSActions","roomState","useHMSStore","selectRoomState","isConnected","selectIsConnectedToRoom","enableJoin","HMSRoomState","Preview","config","useMemo","userName","authToken","metaData","rememberDeviceSelection","settings","preview","useCallback","__awaiter","Disconnected","leave","err","join"],"mappings":"oWAqEa,MAAAA,EAAiB,EAC5BC,OAAO,GACPC,QACAC,WACAC,cAAcC,EACdC,eACAC,kBACAC,qCAEA,MAAMC,EAAUC,IACVC,EAAYC,EAAYC,GACxBC,EAAcF,EAAYG,KAA4B,EACtDC,EAAaL,IAAcM,EAAaC,QAExCC,EAAoBC,GAAQ,KACzB,CACLC,SAAUpB,EACVqB,UAAWpB,EACXqB,SAAUpB,EACVqB,yBAAyB,EACzBC,SAAUlB,EACVD,eACAE,oCAED,CAACP,EAAMC,EAAOC,EAAUG,EAAcC,EAAiBC,IAEpDkB,EAAUC,GAAY,IAAWC,OAAA,OAAA,OAAA,GAAA,YACrC,GAAK1B,GAGDS,IAAcM,EAAaY,aAA3B,CAGAf,UACIL,EAAQqB,SAEZ,UACIrB,EAAQiB,QAAQP,EAEI,CAFJ,MACfY,GACP3B,EAAY2B,EAAc,UAAA,CAR1B,CAQ0B,KAE3B,CAACtB,EAASL,EAAaF,EAAOS,EAAWQ,EAAQL,IAa7C,MAAA,CACLE,aACAgB,KAbWL,GAAY,IAAWC,OAAA,OAAA,OAAA,GAAA,YAClC,GAAK1B,EAGD,UACIO,EAAQuB,KAAKb,EAEO,CAFP,MACZY,GACP3B,EAAY2B,EAAc,OAAA,CAAA,KAE3B,CAACtB,EAASU,EAAQf,EAAaF,IAKhCY,cACAY,UAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRecordingStreaming.js","sources":["../../src/hooks/useRecordingStreaming.ts"],"sourcesContent":[
|
|
1
|
+
{"version":3,"file":"useRecordingStreaming.js","sources":["../../src/hooks/useRecordingStreaming.ts"],"sourcesContent":[null],"names":["useRecordingStreaming","recording","useHMSStore","selectRecordingState","rtmp","selectRTMPState","hls","selectHLSState","isServerRecordingOn","server","running","isBrowserRecordingOn","browser","isHLSRecordingOn","isRecordingOn","isStreamingOn","isHLSRunning","isRTMPRunning"],"mappings":"0KAaO,MAAMA,EAAwB,KACnC,MAAMC,EAAYC,EAAYC,GACxBC,EAAOF,EAAYG,GACnBC,EAAMJ,EAAYK,GAElBC,EAAsBP,EAAUQ,OAAOC,QACvCC,EAAuBV,EAAUW,QAAQF,QACzCG,EAAmBZ,EAAUK,IAAII,QAEjCI,EAAgBN,GAAuBG,GAAwBE,EAE9D,MAAA,CACLL,sBACAG,uBACAE,mBACAE,cAPoBT,EAAII,SAAWN,EAAKM,QAQxCM,aAAcV,EAAII,QAClBO,cAAeb,EAAKM,QACpBI,gBAAA"}
|
|
@@ -0,0 +1,36 @@
|
|
|
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,2 +1,2 @@
|
|
|
1
|
-
import{selectAudioTrackByID as
|
|
1
|
+
import{__awaiter as o}from"../node_modules/tslib/tslib.es6.js";import{selectAudioTrackByID as i,selectVideoTrackByID as e,selectAudioTrackVolume as d,selectPermissions as l}from"@100mslive/hms-video-store";import{useHMSActions as n,useHMSStore as t}from"../primitives/HmsRoomProvider.js";import{useCallback as u}from"react";import{logErrorHandler as m}from"../utils/commons.js";const v=(i,e,d)=>o(void 0,void 0,void 0,(function*(){if(e)try{yield i.setRemoteTrackEnabled(e.id,!e.enabled)}catch(o){d(o,"remoteToggle")}})),r=(r,s,a=m)=>{const c=n(),b=t(i(r)),f=t(e(s)),g=t(d(null==b?void 0:b.id)),p=t(l),y=(null==f?void 0:f.enabled)?null==p?void 0:p.mute:null==p?void 0:p.unmute,V=(null==b?void 0:b.enabled)?null==p?void 0:p.mute:null==p?void 0:p.unmute,j=u((()=>o(void 0,void 0,void 0,(function*(){yield v(c,b,a)}))),[c,b,a]),E=u((()=>o(void 0,void 0,void 0,(function*(){yield v(c,f,a)}))),[c,a,f]),h=u((o=>{b&&c.setVolume(o,b.id)}),[c,b]);return{isAudioEnabled:!!(null==b?void 0:b.enabled),isVideoEnabled:!!(null==f?void 0:f.enabled),volume:g,toggleAudio:b&&V?j:void 0,toggleVideo:"regular"===(null==f?void 0:f.source)&&y?E:void 0,setVolume:b?h:void 0}};export{r as useRemoteAVToggle};
|
|
2
2
|
//# sourceMappingURL=useRemoteAVToggle.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRemoteAVToggle.js","sources":["../../src/hooks/useRemoteAVToggle.ts"],"sourcesContent":[
|
|
1
|
+
{"version":3,"file":"useRemoteAVToggle.js","sources":["../../src/hooks/useRemoteAVToggle.ts"],"sourcesContent":[null],"names":["toggleTrackEnabled","actions","track","handleError","__awaiter","setRemoteTrackEnabled","id","enabled","err","useRemoteAVToggle","audioTrackId","videoTrackId","logErrorHandler","useHMSActions","audioTrack","useHMSStore","selectAudioTrackByID","videoTrack","selectVideoTrackByID","volume","selectAudioTrackVolume","permissions","selectPermissions","canToggleVideo","mute","unmute","canToggleAudio","toggleAudio","useCallback","toggleVideo","setVolume","volume2","isAudioEnabled","isVideoEnabled","source"],"mappings":"0XA0CA,MAAMA,EAAqB,CACzBC,EACAC,EACAC,IACEC,OAAA,OAAA,OAAA,GAAA,YACF,GAAIF,EACE,UACID,EAAQI,sBAAsBH,EAAMI,IAAKJ,EAAMK,QAE3B,CAF2B,MAC9CC,GACPL,EAAYK,EAAc,eAAA,CAAA,IAYnBC,EAAoB,CAC/BC,EACAC,EACAR,EAA+BS,KAE/B,MAAMX,EAAUY,IACVC,EAAaC,EAAYC,EAAqBN,IAC9CO,EAAaF,EAAYG,EAAqBP,IAC9CQ,EAASJ,EAAYK,EAAuBN,eAAAA,EAAYR,KACxDe,EAAcN,EAAYO,GAC1BC,gBAAiB,EAAAN,EAAYV,SAAUc,aAAW,EAAXA,EAAaG,KAAOH,aAAW,EAAXA,EAAaI,OACxEC,gBAAiB,EAAAZ,EAAYP,SAAUc,aAAW,EAAXA,EAAaG,KAAOH,aAAW,EAAXA,EAAaI,OAExEE,EAAcC,GAAY,IAAWxB,OAAA,OAAA,OAAA,GAAA,kBACnCJ,EAAmBC,EAASa,EAAYX,EAC7C,KAAA,CAACF,EAASa,EAAYX,IAEnB0B,EAAcD,GAAY,IAAWxB,OAAA,OAAA,OAAA,GAAA,kBACnCJ,EAAmBC,EAASgB,EAAYd,EAC7C,KAAA,CAACF,EAASE,EAAac,IAEpBa,EAAYF,GACfG,IACKjB,GACMb,EAAA6B,UAAUC,EAAQjB,EAAWR,GAAA,GAGzC,CAACL,EAASa,IAGL,MAAA,CACLkB,kBAAkBlB,aAAA,EAAAA,EAAYP,SAC9B0B,kBAAkBhB,aAAA,EAAAA,EAAYV,SAC9BY,SACAQ,YAAab,GAAcY,EAAiBC,OAAc,EAC1DE,YAAoC,aAAbZ,aAAV,EAAAA,EAAYiB,SAAwBX,EAAiBM,OAAc,EAChFC,UAAWhB,EAAagB,OAAY,EAAA"}
|