@100mslive/react-sdk 0.0.11-alpha.1 → 0.0.12-alpha.0

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.
@@ -0,0 +1 @@
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};
@@ -0,0 +1 @@
1
+ import{useEffect as r}from"react";import{selectTrackAudioByID as t}from"@100mslive/hms-video-store";import{useHMSVanillaStore as o}from"../primitives/HmsRoomProvider.js";function e({trackId:e,getStyle:i,ref:s}){const m=o();r((()=>m.subscribe((r=>{if(!s.current)return;const t=i(r);for(const r in t)s.current.style[r]=t[r]}),t(e))),[i,s,m,e])}export{e as useAudioLevelStyles};
@@ -0,0 +1 @@
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};
@@ -0,0 +1 @@
1
+ import{__awaiter as o}from"../node_modules/tslib/tslib.es6.js";import{useHMSActions as t,useHMSVanillaNotifications as e}from"../primitives/HmsRoomProvider.js";import{useEffect as s,useCallback as r}from"react";import{HMSNotificationTypes as n}from"@100mslive/hms-video-store";import{logErrorHandler as i}from"../utils/commons.js";const m=({type:m,onEvent:d,handleError:a=i})=>{const c=t(),l=e();s((()=>{c.ignoreMessageTypes([m])}),[c,m]),s((()=>{if(!l)return;return l.onNotification((o=>{const t=o.data;if(t&&t.type===m)try{const o=JSON.parse(t.message);null==d||d(o)}catch(o){a(o,"handleCustomEvent")}}),n.NEW_MESSAGE)}),[l,m,d,a]);return{sendEvent:r((t=>o(void 0,void 0,void 0,(function*(){try{const o=JSON.stringify(t||"");yield c.sendBroadcastMessage(o,m),null==d||d(t)}catch(o){a(o,"sendCustomEvent")}}))),[c,a,d,m])}};export{m as useCustomEvent};
@@ -0,0 +1 @@
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:c.setAudioOutputDevice(t)}}catch(e){a(e,"updateDevices")}}))),[a,c])}};export{v as DeviceType,c as useDevices};
@@ -0,0 +1 @@
1
+ import{useMemo as o}from"react";import{selectIsConnectedToRoom as r,selectPeers as t,selectRemotePeers as e,selectPeerCount as s}from"@100mslive/hms-video-store";import{useHMSStore as i}from"../primitives/HmsRoomProvider.js";import{groupByRoles as m}from"../utils/groupBy.js";const p=()=>{const p=i(r),n=i(p?t:e),c=i(s),f=o((()=>m(n)),[n]);return{roles:Object.keys(f),participantsByRoles:f,peerCount:c,isConnected:p}};export{p as useParticipantList};
@@ -22,6 +22,13 @@ export interface usePreviewInput {
22
22
  * initial settings for audio/video and device to be used.
23
23
  */
24
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;
25
32
  }
26
33
  export interface usePreviewResult {
27
34
  /**
@@ -48,4 +55,4 @@ export interface usePreviewResult {
48
55
  * muting/unmuting and useAudioLevelStyles for showing mic audio level to the user.
49
56
  * Any device change or mute/unmute will be carried across to join.
50
57
  */
51
- export declare const usePreviewJoin: ({ name, token, metadata, handleError, initEndpoint, initialSettings, }: usePreviewInput) => usePreviewResult;
58
+ export declare const usePreviewJoin: ({ name, token, metadata, handleError, initEndpoint, initialSettings, captureNetworkQualityInPreview, }: usePreviewInput) => usePreviewResult;
@@ -0,0 +1 @@
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 c=({name:c="",token:d,metadata:v,handleError:l=a,initEndpoint:p,initialSettings:u,captureNetworkQualityInPreview:f})=>{const w=m(),j=s(i),y=s(t)||!1,h=j===o.Preview,b=r((()=>({userName:c,authToken:d,metaData:v,rememberDeviceSelection:!0,settings:u,initEndpoint:p,captureNetworkQualityInPreview:f})),[c,d,v,p,u,f]),k=n((()=>{e(void 0,void 0,void 0,(function*(){if(d){j!==o.Disconnected&&(yield w.leave());try{yield w.preview(b)}catch(e){l(e,"preview")}}}))}),[w,l,d,j,b]);return{enableJoin:h,join:n((()=>{if(d)try{w.join(b)}catch(e){l(e,"join")}}),[w,b,l,d]),isConnected:y,preview:k}};export{c as usePreviewJoin};
@@ -0,0 +1 @@
1
+ import{selectRecordingState as n,selectRTMPState as r,selectHLSState as i}from"@100mslive/hms-video-store";import{useHMSStore as s}from"../primitives/HmsRoomProvider.js";const e=()=>{const e=s(n),o=s(r),g=s(i),m=e.server.running,u=e.browser.running,t=e.hls.running,R=m||u||t;return{isServerRecordingOn:m,isBrowserRecordingOn:u,isHLSRecordingOn:t,isStreamingOn:g.running||o.running,isHLSRunning:g.running,isRTMPRunning:o.running,isRecordingOn:R}};export{e as useRecordingStreaming};
@@ -0,0 +1 @@
1
+ import{__awaiter as o}from"../node_modules/tslib/tslib.es6.js";import{selectTrackByID as i,selectAudioTrackVolume as e,selectPermissions as d}from"@100mslive/hms-video-store";import{useHMSActions as l,useHMSStore as n}from"../primitives/HmsRoomProvider.js";import{useCallback as t}from"react";import{logErrorHandler as u}from"../utils/commons.js";const m=(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")}})),v=(v,r,s=u)=>{const a=l(),c=n(i(v)),b=n(i(r)),f=n(e(null==c?void 0:c.id)),g=n(d),p=(null==b?void 0:b.enabled)?null==g?void 0:g.mute:null==g?void 0:g.unmute,y=(null==c?void 0:c.enabled)?null==g?void 0:g.mute:null==g?void 0:g.unmute,V=t((()=>o(void 0,void 0,void 0,(function*(){yield m(a,c,s)}))),[a,c,s]),j=t((()=>o(void 0,void 0,void 0,(function*(){yield m(a,b,s)}))),[a,s,b]),E=t((o=>{c&&a.setVolume(o,c.id)}),[a,c]);return{isAudioEnabled:!!(null==c?void 0:c.enabled),isVideoEnabled:!!(null==b?void 0:b.enabled),volume:f,toggleAudio:c&&y?V:void 0,toggleVideo:"regular"===(null==b?void 0:b.source)&&p?j:void 0,setVolume:c?E:void 0}};export{v as useRemoteAVToggle};
@@ -14,6 +14,11 @@ export interface useScreenShareResult {
14
14
  * In case of multiple screenshares, the behaviour of which one is picked is not defined.
15
15
  */
16
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;
17
22
  /**
18
23
  * screenShare audio track id, will only be present if there is a screenshare with video track
19
24
  */
@@ -0,0 +1 @@
1
+ import{__awaiter as e}from"../node_modules/tslib/tslib.es6.js";import{selectIsLocalScreenShared as o,selectPeerScreenSharing as r,selectScreenSharesByPeerId as i}from"@100mslive/hms-video-store";import{useHMSActions as d,useHMSStore as n}from"../primitives/HmsRoomProvider.js";import{useCallback as l}from"react";import{logErrorHandler as m}from"../utils/commons.js";const s=(s=m)=>{var t,a;const v=d(),c=n(o),u=n(r),S=n(i(null==u?void 0:u.id)),h=l(((o=!1)=>e(void 0,void 0,void 0,(function*(){try{yield v.setScreenShareEnabled(!c,o)}catch(e){s(e,"toggleScreenShare")}}))),[v,c,s]);return{amIScreenSharing:c,screenSharingPeerId:null==u?void 0:u.id,screenSharingPeerName:null==u?void 0:u.name,screenShareVideoTrackId:null===(t=null==S?void 0:S.video)||void 0===t?void 0:t.id,screenShareAudioTrackId:null===(a=null==S?void 0:S.audio)||void 0===a?void 0:a.id,toggleScreenShare:h}};export{s as useScreenShare};
@@ -0,0 +1 @@
1
+ import{__awaiter as i}from"../node_modules/tslib/tslib.es6.js";import{selectTrackByID as o}from"@100mslive/hms-video-store";import{useRef as r,useCallback as e,useEffect as t}from"react";import{useInView as d}from"react-intersection-observer";import{useHMSActions as n,useHMSStore as l}from"../primitives/HmsRoomProvider.js";import c from"../utils/logger.js";const s=({trackId:s,attach:v})=>{const m=n(),u=r(null),a=l(o(s)),{ref:f,inView:h}=d({threshold:.5}),p=e((i=>{i&&(u.current=i,f(i))}),[f]);return t((()=>{i(void 0,void 0,void 0,(function*(){u.current&&(null==a?void 0:a.id)&&(h&&a.enabled&&!1!==v?yield m.attachVideo(a.id,u.current):yield m.detachVideo(a.id,u.current))}))}),[m,h,u,null==a?void 0:a.id,null==a?void 0:a.enabled,null==a?void 0:a.deviceID,null==a?void 0:a.plugins,v]),t((()=>()=>{i(void 0,void 0,void 0,(function*(){if(u.current&&a)try{yield m.detachVideo(a.id,u.current)}catch(i){c.w("detach video error for track",a.id,i)}}))}),[]),{videoRef:p}};export{s as useVideo};
@@ -0,0 +1 @@
1
+ import{selectTracksMap as t}from"@100mslive/hms-video-store";import{useMemo as e}from"react";import{getVideoTracksFromPeers as i,getModeAspectRatio as r,calculateLayoutSizes as o,chunkElements as a}from"../utils/layout.js";import{useHMSVanillaStore as s}from"../primitives/HmsRoomProvider.js";import{useResizeDetector as h}from"react-resize-detector";const n={width:1,height:1},l=({peers:l,maxTileCount:m,maxColCount:g,maxRowCount:f,includeScreenShareForPeer:u=(()=>!1),aspectRatio:d=n,filterNonPublishingPeers:P=!0,offsetY:p=0})=>{const{width:c=0,height:C=0,ref:x}=h(),F=s().getState(t),H=i(l,F,u,P),W=e((()=>{if(d)return d;return{width:r(H)||1,height:1}}),[d,H]),w=H.length,{tilesInFirstPage:R,defaultWidth:v,defaultHeight:M,lastPageWidth:S,lastPageHeight:T,isLastPageDifferentFromFirstPage:j}=e((()=>o({count:w,parentWidth:Math.floor(c),parentHeight:Math.floor(C)-Math.min(C,p),maxTileCount:m,maxRowCount:f,maxColCount:g,aspectRatio:W})),[w,c,C,m,f,g,W,p]);return{pagesWithTiles:e((()=>a({elements:H,tilesInFirstPage:R,onlyOnePage:!1,isLastPageDifferentFromFirstPage:j,defaultWidth:v,defaultHeight:M,lastPageWidth:S,lastPageHeight:T})),[H,R,j,v,M,S,T]),ref:x}};export{l as useVideoList};
package/dist/index.cjs.js CHANGED
@@ -1 +1,16 @@
1
- var Je=Object.create;var G=Object.defineProperty,Ue=Object.defineProperties,_e=Object.getOwnPropertyDescriptor,Ke=Object.getOwnPropertyDescriptors,Qe=Object.getOwnPropertyNames,ie=Object.getOwnPropertySymbols,Xe=Object.getPrototypeOf,ne=Object.prototype.hasOwnProperty,Ye=Object.prototype.propertyIsEnumerable;var ae=(t,e,o)=>e in t?G(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,q=(t,e)=>{for(var o in e||(e={}))ne.call(e,o)&&ae(t,o,e[o]);if(ie)for(var o of ie(e))Ye.call(e,o)&&ae(t,o,e[o]);return t},j=(t,e)=>Ue(t,Ke(e)),ce=t=>G(t,"__esModule",{value:!0});var Ze=(t,e)=>{ce(t);for(var o in e)G(t,o,{get:e[o],enumerable:!0})},H=(t,e,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of Qe(e))!ne.call(t,s)&&s!=="default"&&G(t,s,{get:()=>e[s],enumerable:!(o=_e(e,s))||o.enumerable});return t},m=t=>H(ce(G(t!=null?Je(Xe(t)):{},"default",t&&t.__esModule&&"default"in t?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t);var g=(t,e,o)=>new Promise((s,r)=>{var i=u=>{try{a(o.next(u))}catch(c){r(c)}},n=u=>{try{a(o.throw(u))}catch(c){r(c)}},a=u=>u.done?s(u.value):Promise.resolve(u.value).then(i,n);a((o=o.apply(t,e)).next())});Ze(exports,{DeviceType:()=>R,HMSRoomProvider:()=>Se,throwErrorHandler:()=>he,useAVToggle:()=>ge,useAudioLevelStyles:()=>De,useAutoplayError:()=>Ge,useCustomEvent:()=>je,useDevices:()=>Ne,useHMSActions:()=>M,useHMSNotifications:()=>Q,useHMSStatsStore:()=>fe,useHMSStore:()=>l,useHMSVanillaNotifications:()=>K,useHMSVanillaStore:()=>N,useParticipantList:()=>Fe,usePreviewJoin:()=>pe,useRecordingStreaming:()=>Be,useRemoteAVToggle:()=>Pe,useScreenShare:()=>ke,useVideo:()=>ve,useVideoList:()=>Ae});var b=m(require("react")),de=m(require("@100mslive/hms-video-store")),J=m(require("zustand"));var Z=m(require("react")),$=m(require("zustand/shallow"));var k;(function(n){n[n.VERBOSE=0]="VERBOSE",n[n.DEBUG=1]="DEBUG",n[n.INFO=2]="INFO",n[n.WARN=3]="WARN",n[n.ERROR=4]="ERROR",n[n.NONE=5]="NONE"})(k||(k={}));var P=class{static v(e,...o){this.log(0,e,...o)}static d(e,...o){this.log(1,e,...o)}static i(e,...o){this.log(2,e,...o)}static w(e,...o){this.log(3,e,...o)}static e(e,...o){this.log(4,e,...o)}static log(e,o,...s){if(!(this.level.valueOf()>e.valueOf()))switch(e){case 0:{console.log("HMSui-components: ",o,...s);break}case 1:{console.debug("HMSui-components: ",o,...s);break}case 2:{console.info("HMSui-components: ",o,...s);break}case 3:{console.warn("HMSui-components: ",o,...s);break}case 4:{console.error("HMSui-components: ",o,...s);break}}}};P.level=0;var I="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.";function ue(t){return(o,s=$.default)=>{o||P.w("fetching full store without passing any selector may have a heavy performance impact on your website.");let r=(0,Z.useContext)(t);if(!r)throw new Error(I);return r.store(o,s)}}function le(t){return(o,s=$.default)=>{o||P.w("fetching full store without passing any selector may have a heavy performance impact on your website.");let r=(0,Z.useContext)(t);if(!r)throw new Error(I);let i=r.statsStore;return i==null?void 0:i(o,s)}}var me=typeof window!="undefined";var A=(0,b.createContext)(null),y,Se=({children:t,actions:e,store:o,notifications:s,stats:r,isHMSStatsOn:i=!1})=>{if(!y){let n=()=>{throw new Error("modifying store is not allowed")};if(e&&o)y={actions:e,store:(0,J.default)(j(q({},o),{setState:n,destroy:n}))},s&&(y.notifications=s),r&&(y.statsStore=(0,J.default)({getState:r.getState,subscribe:r.subscribe,setState:n,destroy:n}));else{let a=new de.HMSReactiveStore;if(y={actions:a.getActions(),store:(0,J.default)(j(q({},a.getStore()),{setState:n,destroy:n})),notifications:a.getNotifications()},i){let u=a.getStats();y.statsStore=(0,J.default)({getState:u.getState,subscribe:u.subscribe,setState:n,destroy:n})}}}return(0,b.useEffect)(()=>{me&&(window.addEventListener("beforeunload",()=>y.actions.leave()),window.addEventListener("onunload",()=>y.actions.leave()))},[]),b.default.createElement(A.Provider,{value:y},t)},l=ue(A),fe=le(A),N=()=>{let t=(0,b.useContext)(A);if(!t)throw new Error(I);return t.store},K=()=>{let t=(0,b.useContext)(A);if(!t)throw new Error(I);return t.notifications},M=()=>{let t=(0,b.useContext)(A);if(!t)throw new Error(I);return t.actions},Q=t=>{let e=(0,b.useContext)(A),[o,s]=(0,b.useState)(null);if(!e)throw new Error(I);return(0,b.useEffect)(()=>e.notifications?e.notifications.onNotification(i=>s(i),t):void 0,[e.notifications,t]),o};var V=m(require("@100mslive/hms-video-store")),U=m(require("react"));var $e="react-sdk",w=(t,e)=>P.e($e,e,t),he=t=>{throw t};var pe=({name:t="",token:e,metadata:o,handleError:s=w,initEndpoint:r,initialSettings:i})=>{let n=M(),a=l(V.selectRoomState),u=l(V.selectIsConnectedToRoom)||!1,c=a===V.HMSRoomState.Preview,S=(0,U.useMemo)(()=>({userName:t,authToken:e,metaData:o,rememberDeviceSelection:!0,settings:i,initEndpoint:r}),[t,e,o,r,i]),h=(0,U.useCallback)(()=>{(()=>g(void 0,null,function*(){if(!!e){a!==V.HMSRoomState.Disconnected&&(yield n.leave());try{yield n.preview(S)}catch(d){s(d,"preview")}}}))()},[n,s,e,a,S]),f=(0,U.useCallback)(()=>{if(!!e)try{n.join(S)}catch(d){s(d,"join")}},[n,S,s,e]);return{enableJoin:c,join:f,isConnected:u,preview:h}};var L=m(require("@100mslive/hms-video-store")),ee=m(require("react"));var ge=(t=w)=>{let e=l(L.selectIsLocalAudioEnabled),o=l(L.selectIsLocalVideoEnabled),s=l(L.selectIsAllowedToPublish),r=M(),i=(0,ee.useCallback)(()=>g(void 0,null,function*(){try{yield r.setLocalAudioEnabled(!e)}catch(a){t(a,"toggleAudio")}}),[r,e,t]),n=(0,ee.useCallback)(()=>g(void 0,null,function*(){try{yield r.setLocalVideoEnabled(!o)}catch(a){t(a,"toggleVideo")}}),[r,o,t]);return{isLocalAudioEnabled:e,isLocalVideoEnabled:o,toggleAudio:(s==null?void 0:s.audio)?i:void 0,toggleVideo:(s==null?void 0:s.video)?n:void 0}};var He=m(require("@100mslive/hms-video-store")),C=m(require("react")),Me=m(require("react-intersection-observer"));var ve=({trackId:t,attach:e})=>{let o=M(),s=(0,C.useRef)(null),r=l((0,He.selectTrackByID)(t)),{ref:i,inView:n}=(0,Me.useInView)({threshold:.5}),a=(0,C.useCallback)(u=>{s.current=u,i(u)},[i]);return(0,C.useEffect)(()=>{(()=>g(void 0,null,function*(){s.current&&(r==null?void 0:r.id)&&(n&&r.enabled&&e!==!1?yield o.attachVideo(r.id,s.current):yield o.detachVideo(r.id,s.current))}))()},[o,n,s,r==null?void 0:r.id,r==null?void 0:r.enabled,r==null?void 0:r.deviceID,r==null?void 0:r.plugins,e]),(0,C.useEffect)(()=>()=>{(()=>g(void 0,null,function*(){if(s.current&&r)try{yield o.detachVideo(r.id,s.current)}catch(u){P.w("detach video error for track",r.id,u)}}))()},[]),{videoRef:a}};var W=m(require("@100mslive/hms-video-store"));var be=m(require("react")),et=t=>console.log("Error: ",t),ke=(t=et)=>{var n,a;let e=M(),o=l(W.selectIsLocalScreenShared),s=l(W.selectPeerScreenSharing),r=l((0,W.selectScreenSharesByPeerId)(s==null?void 0:s.id)),i=(0,be.useCallback)((u=!1)=>g(void 0,null,function*(){try{yield e.setScreenShareEnabled(!o,u)}catch(c){t(c)}}),[e,o,t]);return{amIScreenSharing:o,screenSharingPeerId:s==null?void 0:s.id,screenShareVideoTrackId:(n=r==null?void 0:r.video)==null?void 0:n.id,screenShareAudioTrackId:(a=r==null?void 0:r.audio)==null?void 0:a.id,toggleScreenShare:i}};var D=m(require("@100mslive/hms-video-store"));var X=m(require("react"));var Re=(t,e,o)=>g(void 0,null,function*(){if(e)try{yield t.setRemoteTrackEnabled(e.id,!e.enabled)}catch(s){o(s,"remoteToggle")}}),Pe=(t,e,o=w)=>{let s=M(),r=l((0,D.selectTrackByID)(t)),i=l((0,D.selectTrackByID)(e)),n=l((0,D.selectAudioTrackVolume)(r==null?void 0:r.id)),a=l(D.selectPermissions),u=(i==null?void 0:i.enabled)?a==null?void 0:a.mute:a==null?void 0:a.unmute,c=(r==null?void 0:r.enabled)?a==null?void 0:a.mute:a==null?void 0:a.unmute,S=(0,X.useCallback)(()=>g(void 0,null,function*(){yield Re(s,r,o)}),[s,r,o]),h=(0,X.useCallback)(()=>g(void 0,null,function*(){yield Re(s,i,o)}),[s,o,i]),f=(0,X.useCallback)(d=>{r&&s.setVolume(d,r.id)},[s,r]);return{isAudioEnabled:!!(r==null?void 0:r.enabled),isVideoEnabled:!!(i==null?void 0:i.enabled),volume:n,toggleAudio:r&&c?S:void 0,toggleVideo:(i==null?void 0:i.source)==="regular"&&u?h:void 0,setVolume:r?f:void 0}};var Ee=m(require("@100mslive/hms-video-store")),Y=m(require("react"));var tt=(t,e,o)=>t.reduce((s,r,i)=>{let n=Math.floor(i/e);return n>0&&o||(s[n]||(s[n]=[]),s[n].push(r)),s},[]),we=({elements:t,tilesInFirstPage:e,onlyOnePage:o,isLastPageDifferentFromFirstPage:s,defaultWidth:r,defaultHeight:i,lastPageWidth:n,lastPageHeight:a})=>{let u=tt(t,e,o);return u.map((c,S)=>c.map(h=>{let f=S===u.length-1,d=s&&f?n:r,p=s&&f?a:i;return j(q({},h),{height:p,width:d})}))};function ot(t){if(t.length===0)return null;let e={},o=t[0],s=1;for(let r=0;r<t.length;r++){let i=t[r];e[i]===null?e[i]=1:e[i]++,e[i]>s&&(o=i,s=e[i])}return o}var Te=t=>ot(t.filter(e=>{var o,s;return((o=e.track)==null?void 0:o.width)&&((s=e.track)==null?void 0:s.height)}).map(e=>{var r,i;let o=(r=e.track)==null?void 0:r.width,s=(i=e.track)==null?void 0:i.height;return(o||1)/(s||1)})),te=(t,e,o,s,r)=>{if(t<0||e<0)throw new Error("Container must have a non-negative area");if(o<1||!Number.isInteger(o))throw new Error("Number of shapes to place must be a positive integer");let i=s&&r&&s/r;if(i!==void 0&&isNaN(i))throw new Error("Aspect ratio must be a number");let n={area:0,cols:0,rows:0,width:0,height:0},a=o,u=-1;if(i!==void 0)for(let c=a;c>0;c+=u){let S=Math.ceil(o/c),h=t/(c*i),f=e/S,d,p;h<=f?(d=t/c,p=d/i):(p=e/S,d=p*i);let v=d*p;v>n.area&&(n={area:v,width:d,height:p,rows:S,cols:c})}return n},rt=({parentWidth:t,parentHeight:e,count:o,maxCount:s,aspectRatio:r})=>{let i=0,n=0,a=0,u=0,c=!1,S=0,h=0,f=Math.min(Math.ceil(Math.sqrt(o*(t/e)/(r.width/r.height))),s),d=t/f,p=d/(r.width/r.height);p>e&&(p=e,d=p/(r.height/r.width));let v=Math.floor(e/p);if(n=p,i=d,S=Math.min(o,v*f),h=o%(v*f),c=h>0&&o>v*f,c){let O=Math.min(Math.ceil(Math.sqrt(h*(t/e)/(r.width/r.height))),s),T=t/O,x=T/(r.width/r.height);x>e&&(x=e,T=x/(r.height/r.width)),u=x,a=T}return{tilesInFirstPage:S,defaultWidth:i,defaultHeight:n,lastPageWidth:a,lastPageHeight:u,isLastPageDifferentFromFirstPage:c}},st=({parentWidth:t,parentHeight:e,count:o,maxCount:s,aspectRatio:r})=>{let i=0,n=0,a=0,u=0,c=!1,S=0,h=0,{width:f,height:d}=te(t,e,Math.min(o,s),r.width,r.height);if(i=f,n=d,S=Math.min(o,s),h=o%s,c=h>0&&o>s,c){let{width:p,height:v}=te(t,e,h,r.width,r.height);a=p,u=v}return{tilesInFirstPage:S,defaultWidth:i,defaultHeight:n,lastPageWidth:a,lastPageHeight:u,isLastPageDifferentFromFirstPage:c}},it=({parentWidth:t,parentHeight:e,count:o,maxCount:s,aspectRatio:r})=>{let i=0,n=0,a=0,u=0,c=!1,S=0,h=0,f=Math.min(Math.ceil(Math.sqrt(o*(r.width/r.height)/(t/e))),s),d=e/f,p=d*(r.width/r.height),v=Math.floor(t/p);if(i=p,n=d,S=Math.min(o,f*v),h=o%(f*v),c=h>0&&o>f*v,c){let O=Math.min(Math.ceil(Math.sqrt(h*(r.width/r.height)/(t/e))),s),T=e/O,x=T*(r.width/r.height);u=T,a=x}return{tilesInFirstPage:S,defaultWidth:i,defaultHeight:n,lastPageWidth:a,lastPageHeight:u,isLastPageDifferentFromFirstPage:c}};function xe({count:t,parentWidth:e,parentHeight:o,maxTileCount:s,maxRowCount:r,maxColCount:i,aspectRatio:n}){let a=0,u=0,c=0,S=0,h=!1,f=0;if(t===0)return{tilesInFirstPage:f,defaultWidth:a,defaultHeight:u,lastPageWidth:c,lastPageHeight:S,isLastPageDifferentFromFirstPage:h};if(s)({tilesInFirstPage:f,defaultWidth:a,defaultHeight:u,lastPageWidth:c,lastPageHeight:S,isLastPageDifferentFromFirstPage:h}=st({parentWidth:e,parentHeight:o,count:t,maxCount:s,aspectRatio:n}));else if(r)({tilesInFirstPage:f,defaultWidth:a,defaultHeight:u,lastPageWidth:c,lastPageHeight:S,isLastPageDifferentFromFirstPage:h}=it({parentWidth:e,parentHeight:o,count:t,maxCount:r,aspectRatio:n}));else if(i)({tilesInFirstPage:f,defaultWidth:a,defaultHeight:u,lastPageWidth:c,lastPageHeight:S,isLastPageDifferentFromFirstPage:h}=rt({parentWidth:e,parentHeight:o,count:t,maxCount:i,aspectRatio:n}));else{let{width:d,height:p}=te(e,o,t,n.width,n.height);a=d,u=p,f=t}return{tilesInFirstPage:f,defaultWidth:a,defaultHeight:u,lastPageWidth:c,lastPageHeight:S,isLastPageDifferentFromFirstPage:h}}var ye=(t,e,o,s=!0)=>{if(!t||!e||!o)return[];let r=[];for(let i of t)if(i.videoTrack===void 0&&i.audioTrack&&e[i.audioTrack]?r.push({peer:i}):i.videoTrack&&e[i.videoTrack]?r.push({track:e[i.videoTrack],peer:i}):s||r.push({peer:i}),o(i)&&i.auxiliaryTracks.length>0){let a=i.auxiliaryTracks.find(u=>{let c=e[u];return(c==null?void 0:c.type)==="video"&&(c==null?void 0:c.source)==="screen"});a&&r.push({track:e[a],peer:i})}return r};var Ie=m(require("react-resize-detector")),nt={aspectRatio:{width:1,height:1}},Ae=({peers:t,maxTileCount:e,maxColCount:o,maxRowCount:s,includeScreenShareForPeer:r=()=>!1,aspectRatio:i=nt.aspectRatio,filterNonPublishingPeers:n=!0,offsetY:a=0})=>{let{width:u=0,height:c=0,ref:S}=(0,Ie.useResizeDetector)(),f=N().getState(Ee.selectTracksMap),d=ye(t,f,r,n),p=(0,Y.useMemo)(()=>i||{width:Te(d)||1,height:1},[i,d]),v=d.length,{tilesInFirstPage:O,defaultWidth:T,defaultHeight:x,lastPageWidth:oe,lastPageHeight:re,isLastPageDifferentFromFirstPage:se}=(0,Y.useMemo)(()=>xe({count:v,parentWidth:Math.floor(u),parentHeight:Math.floor(c)-Math.min(c,a),maxTileCount:e,maxRowCount:s,maxColCount:o,aspectRatio:p}),[v,u,c,e,s,o,p,a]);return{pagesWithTiles:(0,Y.useMemo)(()=>we({elements:d,tilesInFirstPage:O,onlyOnePage:!1,isLastPageDifferentFromFirstPage:se,defaultWidth:T,defaultHeight:x,lastPageWidth:oe,lastPageHeight:re}),[d,O,se,T,x,oe,re]),ref:S}};var Ve=m(require("react")),Ce=m(require("@100mslive/hms-video-store"));function De({trackId:t,getStyle:e,ref:o}){let s=N();(0,Ve.useEffect)(()=>s.subscribe(r=>{if(!o.current)return;let i=e(r);for(let n in i)o.current.style[n]=i[n]},(0,Ce.selectTrackAudioByID)(t)),[e,o,s,t])}var F=m(require("@100mslive/hms-video-store")),Oe=m(require("react"));var R;(function(s){s.videoInput="videoInput",s.audioInput="audioInput",s.audioOutput="audioOutput"})(R||(R={}));var Ne=(t=w)=>{let e=M(),o=l(F.selectDevices),s=l(F.selectLocalMediaSettings),r=l(F.selectIsAllowedToPublish),i={[R.audioOutput]:s.audioOutputDeviceId},n={[R.audioOutput]:o.audioOutput};r.video&&(n[R.videoInput]=o.videoInput,i[R.videoInput]=s.videoInputDeviceId),r.audio&&(n[R.audioInput]=o.audioInput,i[R.audioInput]=s.audioInputDeviceId);let a=(0,Oe.useCallback)(S=>g(void 0,[S],function*({deviceType:u,deviceId:c}){try{switch(u){case R.audioInput:yield e.setAudioSettings({deviceId:c});break;case R.videoInput:yield e.setVideoSettings({deviceId:c});break;case R.audioOutput:e.setAudioOutputDevice(c);break}}catch(h){t(h,"updateDevices")}}),[t,e]);return{allDevices:n,selectedDeviceIDs:i,updateDevice:a}};var We=m(require("react")),E=m(require("@100mslive/hms-video-store"));var Le=t=>!t||!Array.isArray(t)||t.length===0?{}:t.reduce((e,o)=>(o.roleName&&(e[o.roleName]||(e[o.roleName]=[]),e[o.roleName].push(o)),e),{});var Fe=()=>{let t=l(E.selectIsConnectedToRoom),e=l(t?E.selectPeers:E.selectRemotePeers),o=l(E.selectPeerCount),s=(0,We.useMemo)(()=>Le(e),[e]);return{roles:Object.keys(s),participantsByRoles:s,peerCount:o,isConnected:t}};var B=m(require("@100mslive/hms-video-store"));var Be=()=>{let t=l(B.selectRecordingState),e=l(B.selectRTMPState),o=l(B.selectHLSState),s=t.server.running,r=t.browser.running,i=t.hls.running,n=o.running||e.running,a=s||r||i;return{isServerRecordingOn:s,isBrowserRecordingOn:r,isHLSRecordingOn:i,isStreamingOn:n,isHLSRunning:o.running,isRTMPRunning:e.running,isRecordingOn:a}};var z=m(require("react")),ze=m(require("@100mslive/hms-video-store"));var Ge=()=>{let t=Q(ze.HMSNotificationTypes.ERROR),[e,o]=(0,z.useState)(""),s=M(),r=(0,z.useCallback)(()=>g(void 0,null,function*(){yield s.unblockAudio()}),[s]);return(0,z.useEffect)(()=>{(t==null?void 0:t.data.code)===3008&&o(t==null?void 0:t.data.message)},[t]),{error:e,unblockAudio:r,resetError:()=>o("")}};var _=m(require("react")),qe=m(require("@100mslive/hms-video-store"));var je=({type:t,onEvent:e,handleError:o=w})=>{let s=M(),r=K();return(0,_.useEffect)(()=>{s.ignoreMessageTypes([t])},[s,t]),(0,_.useEffect)(()=>r?r.onNotification(a=>{let u=a.data;if(u&&u.type===t)try{let c=JSON.parse(u.message);e==null||e(c)}catch(c){o(c,"handleCustomEvent")}},qe.HMSNotificationTypes.NEW_MESSAGE):void 0,[r,t,e,o]),{sendEvent:(0,_.useCallback)(n=>g(void 0,null,function*(){try{let a=JSON.stringify(n||"");yield s.sendBroadcastMessage(a,t),e==null||e(n)}catch(a){o(a,"sendCustomEvent")}}),[s,o,e,t])}};H(exports,m(require("@100mslive/hms-video-store")));
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("@100mslive/hms-video-store"),i=require("zustand"),o=require("react-intersection-observer"),n=require("react-resize-detector");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a,s,u=r(e),l=r(i);function c(e,t){if(Object.is(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;const i=Object.keys(e);if(i.length!==Object.keys(t).length)return!1;for(let o=0;o<i.length;o++)if(!Object.prototype.hasOwnProperty.call(t,i[o])||!Object.is(e[i[o]],t[i[o]]))return!1;return!0}(s=a||(a={}))[s.VERBOSE=0]="VERBOSE",s[s.DEBUG=1]="DEBUG",s[s.INFO=2]="INFO",s[s.WARN=3]="WARN",s[s.ERROR=4]="ERROR",s[s.NONE=5]="NONE";class d{static v(e,...t){this.log(a.VERBOSE,e,...t)}static d(e,...t){this.log(a.DEBUG,e,...t)}static i(e,...t){this.log(a.INFO,e,...t)}static w(e,...t){this.log(a.WARN,e,...t)}static e(e,...t){this.log(a.ERROR,e,...t)}static log(e,t,...i){if(!(this.level.valueOf()>e.valueOf()))switch(e){case a.VERBOSE:console.log("HMSui-components: ",t,...i);break;case a.DEBUG:console.debug("HMSui-components: ",t,...i);break;case a.INFO:console.info("HMSui-components: ",t,...i);break;case a.WARN:console.warn("HMSui-components: ",t,...i);break;case a.ERROR:console.error("HMSui-components: ",t,...i)}}}d.level=a.VERBOSE;const h="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.";const g="undefined"!=typeof window,f=e.createContext(null);let v;const p=(m=f,(t,i=c)=>{t||d.w("fetching full store without passing any selector may have a heavy performance impact on your website.");const o=e.useContext(m);if(!o)throw new Error(h);return(0,o.store)(t,i)});var m;const y=function(t){return(i,o=c)=>{i||d.w("fetching full store without passing any selector may have a heavy performance impact on your website.");const n=e.useContext(t);if(!n)throw new Error(h);const r=n.statsStore;return null==r?void 0:r(i,o)}}(f),w=()=>{const t=e.useContext(f);if(!t)throw new Error(h);return t.store},S=()=>{const t=e.useContext(f);if(!t)throw new Error(h);return t.notifications},P=()=>{const t=e.useContext(f);if(!t)throw new Error(h);return t.actions},b=t=>{const i=e.useContext(f),[o,n]=e.useState(null);if(!i)throw new Error(h);return e.useEffect((()=>{if(!i.notifications)return;return i.notifications.onNotification((e=>n(e)),t)}),[i.notifications,t]),o};
2
+ /*! *****************************************************************************
3
+ Copyright (c) Microsoft Corporation.
4
+
5
+ Permission to use, copy, modify, and/or distribute this software for any
6
+ purpose with or without fee is hereby granted.
7
+
8
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
9
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
10
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
11
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
+ PERFORMANCE OF THIS SOFTWARE.
15
+ ***************************************************************************** */
16
+ function E(e,t,i,o){return new(i||(i=Promise))((function(n,r){function a(e){try{u(o.next(e))}catch(e){r(e)}}function s(e){try{u(o.throw(e))}catch(e){r(e)}}function u(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,s)}u((o=o.apply(e,t||[])).next())}))}const x=(e,t)=>d.e("react-sdk",t,e),R=(e,t,i)=>E(void 0,void 0,void 0,(function*(){if(t)try{yield e.setRemoteTrackEnabled(t.id,!t.enabled)}catch(e){i(e,"remoteToggle")}})),I=({elements:e,tilesInFirstPage:t,onlyOnePage:i,isLastPageDifferentFromFirstPage:o,defaultWidth:n,defaultHeight:r,lastPageWidth:a,lastPageHeight:s})=>{const u=((e,t,i)=>e.reduce(((e,o,n)=>{const r=Math.floor(n/t);return r>0&&i||(e[r]||(e[r]=[]),e[r].push(o)),e}),[]))(e,t,i);return u.map(((e,t)=>e.map((e=>{const i=t===u.length-1,l=o&&i?a:n,c=o&&i?s:r;return Object.assign(Object.assign({},e),{height:c,width:l})}))))};const k=(e,t,i,o,n)=>{if(e<0||t<0)throw new Error("Container must have a non-negative area");if(i<1||!Number.isInteger(i))throw new Error("Number of shapes to place must be a positive integer");const r=o&&n&&o/n;if(void 0!==r&&isNaN(r))throw new Error("Aspect ratio must be a number");let a={area:0,cols:0,rows:0,width:0,height:0};if(void 0!==r)for(let o=i;o>0;o+=-1){const n=Math.ceil(i/o);let s,u;e/(o*r)<=t/n?(s=e/o,u=s/r):(u=t/n,s=u*r);const l=s*u;l>a.area&&(a={area:l,width:s,height:u,rows:n,cols:o})}return a};function M({count:e,parentWidth:t,parentHeight:i,maxTileCount:o,maxRowCount:n,maxColCount:r,aspectRatio:a}){let s=0,u=0,l=0,c=0,d=!1,h=0;if(0===e)return{tilesInFirstPage:h,defaultWidth:s,defaultHeight:u,lastPageWidth:l,lastPageHeight:c,isLastPageDifferentFromFirstPage:d};if(o)({tilesInFirstPage:h,defaultWidth:s,defaultHeight:u,lastPageWidth:l,lastPageHeight:c,isLastPageDifferentFromFirstPage:d}=(({parentWidth:e,parentHeight:t,count:i,maxCount:o,aspectRatio:n})=>{let r=0,a=0,s=0,u=0,l=!1,c=0,d=0;const{width:h,height:g}=k(e,t,Math.min(i,o),n.width,n.height);if(r=h,a=g,c=Math.min(i,o),d=i%o,l=d>0&&i>o,l){const{width:i,height:o}=k(e,t,d,n.width,n.height);s=i,u=o}return{tilesInFirstPage:c,defaultWidth:r,defaultHeight:a,lastPageWidth:s,lastPageHeight:u,isLastPageDifferentFromFirstPage:l}})({parentWidth:t,parentHeight:i,count:e,maxCount:o,aspectRatio:a}));else if(n)({tilesInFirstPage:h,defaultWidth:s,defaultHeight:u,lastPageWidth:l,lastPageHeight:c,isLastPageDifferentFromFirstPage:d}=(({parentWidth:e,parentHeight:t,count:i,maxCount:o,aspectRatio:n})=>{let r=0,a=0,s=0,u=0,l=!1,c=0,d=0;const h=Math.min(Math.ceil(Math.sqrt(i*(n.width/n.height)/(e/t))),o),g=t/h,f=g*(n.width/n.height),v=Math.floor(e/f);if(r=f,a=g,c=Math.min(i,h*v),d=i%(h*v),l=d>0&&i>h*v,l){const i=t/Math.min(Math.ceil(Math.sqrt(d*(n.width/n.height)/(e/t))),o);u=i,s=i*(n.width/n.height)}return{tilesInFirstPage:c,defaultWidth:r,defaultHeight:a,lastPageWidth:s,lastPageHeight:u,isLastPageDifferentFromFirstPage:l}})({parentWidth:t,parentHeight:i,count:e,maxCount:n,aspectRatio:a}));else if(r)({tilesInFirstPage:h,defaultWidth:s,defaultHeight:u,lastPageWidth:l,lastPageHeight:c,isLastPageDifferentFromFirstPage:d}=(({parentWidth:e,parentHeight:t,count:i,maxCount:o,aspectRatio:n})=>{let r=0,a=0,s=0,u=0,l=!1,c=0,d=0;const h=Math.min(Math.ceil(Math.sqrt(i*(e/t)/(n.width/n.height))),o);let g=e/h,f=g/(n.width/n.height);f>t&&(f=t,g=f/(n.height/n.width));const v=Math.floor(t/f);if(a=f,r=g,c=Math.min(i,v*h),d=i%(v*h),l=d>0&&i>v*h,l){let i=e/Math.min(Math.ceil(Math.sqrt(d*(e/t)/(n.width/n.height))),o),r=i/(n.width/n.height);r>t&&(r=t,i=r/(n.height/n.width)),u=r,s=i}return{tilesInFirstPage:c,defaultWidth:r,defaultHeight:a,lastPageWidth:s,lastPageHeight:u,isLastPageDifferentFromFirstPage:l}})({parentWidth:t,parentHeight:i,count:e,maxCount:r,aspectRatio:a}));else{const{width:o,height:n}=k(t,i,e,a.width,a.height);s=o,u=n,h=e}return{tilesInFirstPage:h,defaultWidth:s,defaultHeight:u,lastPageWidth:l,lastPageHeight:c,isLastPageDifferentFromFirstPage:d}}const H={width:1,height:1};var O;exports.DeviceType=void 0,(O=exports.DeviceType||(exports.DeviceType={})).videoInput="videoInput",O.audioInput="audioInput",O.audioOutput="audioOutput";exports.HMSRoomProvider=({children:i,actions:o,store:n,notifications:r,stats:a,isHMSStatsOn:s=!1})=>{if(!v){const e=()=>{throw new Error("modifying store is not allowed")};if(o&&n)v={actions:o,store:l.default(Object.assign(Object.assign({},n),{setState:e,destroy:e}))},r&&(v.notifications=r),a&&(v.statsStore=l.default({getState:a.getState,subscribe:a.subscribe,setState:e,destroy:e}));else{const i=new t.HMSReactiveStore;if(v={actions:i.getActions(),store:l.default(Object.assign(Object.assign({},i.getStore()),{setState:e,destroy:e})),notifications:i.getNotifications()},s){const t=i.getStats();v.statsStore=l.default({getState:t.getState,subscribe:t.subscribe,setState:e,destroy:e})}}}return e.useEffect((()=>{g&&(window.addEventListener("beforeunload",(()=>v.actions.leave())),window.addEventListener("onunload",(()=>v.actions.leave())))}),[]),u.default.createElement(f.Provider,{value:v},i)},exports.throwErrorHandler=e=>{throw e},exports.useAVToggle=(i=x)=>{const o=p(t.selectIsLocalAudioEnabled),n=p(t.selectIsLocalVideoEnabled),r=p(t.selectIsAllowedToPublish),a=P(),s=e.useCallback((()=>E(void 0,void 0,void 0,(function*(){try{yield a.setLocalAudioEnabled(!o)}catch(e){i(e,"toggleAudio")}}))),[a,o,i]),u=e.useCallback((()=>E(void 0,void 0,void 0,(function*(){try{yield a.setLocalVideoEnabled(!n)}catch(e){i(e,"toggleVideo")}}))),[a,n,i]);return{isLocalAudioEnabled:o,isLocalVideoEnabled:n,toggleAudio:(null==r?void 0:r.audio)?s:void 0,toggleVideo:(null==r?void 0:r.video)?u:void 0}},exports.useAudioLevelStyles=function({trackId:i,getStyle:o,ref:n}){const r=w();e.useEffect((()=>r.subscribe((e=>{if(!n.current)return;const t=o(e);for(const e in t)n.current.style[e]=t[e]}),t.selectTrackAudioByID(i))),[o,n,r,i])},exports.useAutoplayError=()=>{const i=b(t.HMSNotificationTypes.ERROR),[o,n]=e.useState(""),r=P(),a=e.useCallback((()=>E(void 0,void 0,void 0,(function*(){yield r.unblockAudio()}))),[r]);return e.useEffect((()=>{3008===(null==i?void 0:i.data.code)&&n(null==i?void 0:i.data.message)}),[i]),{error:o,unblockAudio:a,resetError:()=>n("")}},exports.useCustomEvent=({type:i,onEvent:o,handleError:n=x})=>{const r=P(),a=S();e.useEffect((()=>{r.ignoreMessageTypes([i])}),[r,i]),e.useEffect((()=>{if(!a)return;return a.onNotification((e=>{const t=e.data;if(t&&t.type===i)try{const e=JSON.parse(t.message);null==o||o(e)}catch(e){n(e,"handleCustomEvent")}}),t.HMSNotificationTypes.NEW_MESSAGE)}),[a,i,o,n]);return{sendEvent:e.useCallback((e=>E(void 0,void 0,void 0,(function*(){try{const t=JSON.stringify(e||"");yield r.sendBroadcastMessage(t,i),null==o||o(e)}catch(e){n(e,"sendCustomEvent")}}))),[r,n,o,i])}},exports.useDevices=(i=x)=>{const o=P(),n=p(t.selectDevices),r=p(t.selectLocalMediaSettings),a=p(t.selectIsAllowedToPublish),s={[exports.DeviceType.audioOutput]:r.audioOutputDeviceId},u={[exports.DeviceType.audioOutput]:n.audioOutput};a.video&&(u[exports.DeviceType.videoInput]=n.videoInput,s[exports.DeviceType.videoInput]=r.videoInputDeviceId),a.audio&&(u[exports.DeviceType.audioInput]=n.audioInput,s[exports.DeviceType.audioInput]=r.audioInputDeviceId);return{allDevices:u,selectedDeviceIDs:s,updateDevice:e.useCallback((({deviceType:e,deviceId:t})=>E(void 0,void 0,void 0,(function*(){try{switch(e){case exports.DeviceType.audioInput:yield o.setAudioSettings({deviceId:t});break;case exports.DeviceType.videoInput:yield o.setVideoSettings({deviceId:t});break;case exports.DeviceType.audioOutput:o.setAudioOutputDevice(t)}}catch(e){i(e,"updateDevices")}}))),[i,o])}},exports.useHMSActions=P,exports.useHMSNotifications=b,exports.useHMSStatsStore=y,exports.useHMSStore=p,exports.useHMSVanillaNotifications=S,exports.useHMSVanillaStore=w,exports.useParticipantList=()=>{const i=p(t.selectIsConnectedToRoom),o=p(i?t.selectPeers:t.selectRemotePeers),n=p(t.selectPeerCount),r=e.useMemo((()=>{return(e=o)&&Array.isArray(e)&&0!==e.length?e.reduce(((e,t)=>t.roleName?(e[t.roleName]||(e[t.roleName]=[]),e[t.roleName].push(t),e):e),{}):{};var e}),[o]);return{roles:Object.keys(r),participantsByRoles:r,peerCount:n,isConnected:i}},exports.usePreviewJoin=({name:i="",token:o,metadata:n,handleError:r=x,initEndpoint:a,initialSettings:s,captureNetworkQualityInPreview:u})=>{const l=P(),c=p(t.selectRoomState),d=p(t.selectIsConnectedToRoom)||!1,h=c===t.HMSRoomState.Preview,g=e.useMemo((()=>({userName:i,authToken:o,metaData:n,rememberDeviceSelection:!0,settings:s,initEndpoint:a,captureNetworkQualityInPreview:u})),[i,o,n,a,s,u]),f=e.useCallback((()=>{E(void 0,void 0,void 0,(function*(){if(o){c!==t.HMSRoomState.Disconnected&&(yield l.leave());try{yield l.preview(g)}catch(e){r(e,"preview")}}}))}),[l,r,o,c,g]);return{enableJoin:h,join:e.useCallback((()=>{if(o)try{l.join(g)}catch(e){r(e,"join")}}),[l,g,r,o]),isConnected:d,preview:f}},exports.useRecordingStreaming=()=>{const e=p(t.selectRecordingState),i=p(t.selectRTMPState),o=p(t.selectHLSState),n=e.server.running,r=e.browser.running,a=e.hls.running,s=n||r||a;return{isServerRecordingOn:n,isBrowserRecordingOn:r,isHLSRecordingOn:a,isStreamingOn:o.running||i.running,isHLSRunning:o.running,isRTMPRunning:i.running,isRecordingOn:s}},exports.useRemoteAVToggle=(i,o,n=x)=>{const r=P(),a=p(t.selectTrackByID(i)),s=p(t.selectTrackByID(o)),u=p(t.selectAudioTrackVolume(null==a?void 0:a.id)),l=p(t.selectPermissions),c=(null==s?void 0:s.enabled)?null==l?void 0:l.mute:null==l?void 0:l.unmute,d=(null==a?void 0:a.enabled)?null==l?void 0:l.mute:null==l?void 0:l.unmute,h=e.useCallback((()=>E(void 0,void 0,void 0,(function*(){yield R(r,a,n)}))),[r,a,n]),g=e.useCallback((()=>E(void 0,void 0,void 0,(function*(){yield R(r,s,n)}))),[r,n,s]),f=e.useCallback((e=>{a&&r.setVolume(e,a.id)}),[r,a]);return{isAudioEnabled:!!(null==a?void 0:a.enabled),isVideoEnabled:!!(null==s?void 0:s.enabled),volume:u,toggleAudio:a&&d?h:void 0,toggleVideo:"regular"===(null==s?void 0:s.source)&&c?g:void 0,setVolume:a?f:void 0}},exports.useScreenShare=(i=x)=>{var o,n;const r=P(),a=p(t.selectIsLocalScreenShared),s=p(t.selectPeerScreenSharing),u=p(t.selectScreenSharesByPeerId(null==s?void 0:s.id)),l=e.useCallback(((e=!1)=>E(void 0,void 0,void 0,(function*(){try{yield r.setScreenShareEnabled(!a,e)}catch(e){i(e,"toggleScreenShare")}}))),[r,a,i]);return{amIScreenSharing:a,screenSharingPeerId:null==s?void 0:s.id,screenSharingPeerName:null==s?void 0:s.name,screenShareVideoTrackId:null===(o=null==u?void 0:u.video)||void 0===o?void 0:o.id,screenShareAudioTrackId:null===(n=null==u?void 0:u.audio)||void 0===n?void 0:n.id,toggleScreenShare:l}},exports.useVideo=({trackId:i,attach:n})=>{const r=P(),a=e.useRef(null),s=p(t.selectTrackByID(i)),{ref:u,inView:l}=o.useInView({threshold:.5}),c=e.useCallback((e=>{e&&(a.current=e,u(e))}),[u]);return e.useEffect((()=>{E(void 0,void 0,void 0,(function*(){a.current&&(null==s?void 0:s.id)&&(l&&s.enabled&&!1!==n?yield r.attachVideo(s.id,a.current):yield r.detachVideo(s.id,a.current))}))}),[r,l,a,null==s?void 0:s.id,null==s?void 0:s.enabled,null==s?void 0:s.deviceID,null==s?void 0:s.plugins,n]),e.useEffect((()=>()=>{E(void 0,void 0,void 0,(function*(){if(a.current&&s)try{yield r.detachVideo(s.id,a.current)}catch(e){d.w("detach video error for track",s.id,e)}}))}),[]),{videoRef:c}},exports.useVideoList=({peers:i,maxTileCount:o,maxColCount:r,maxRowCount:a,includeScreenShareForPeer:s=(()=>!1),aspectRatio:u=H,filterNonPublishingPeers:l=!0,offsetY:c=0})=>{const{width:d=0,height:h=0,ref:g}=n.useResizeDetector(),f=((e,t,i,o=!0)=>{if(!e||!t||!i)return[];const n=[];for(const r of e)if(void 0===r.videoTrack&&r.audioTrack&&t[r.audioTrack]?n.push({peer:r}):r.videoTrack&&t[r.videoTrack]?n.push({track:t[r.videoTrack],peer:r}):o||n.push({peer:r}),i(r)&&r.auxiliaryTracks.length>0){const e=r.auxiliaryTracks.find((e=>{const i=t[e];return"video"===(null==i?void 0:i.type)&&"screen"===(null==i?void 0:i.source)}));e&&n.push({track:t[e],peer:r})}return n})(i,w().getState(t.selectTracksMap),s,l),v=e.useMemo((()=>{if(u)return u;return{width:function(e){if(0===e.length)return null;const t={};let i=e[0],o=1;for(let n=0;n<e.length;n++){const r=e[n];null===t[r]?t[r]=1:t[r]++,t[r]>o&&(i=r,o=t[r])}return i}(f.filter((e=>{var t,i;return(null===(t=e.track)||void 0===t?void 0:t.width)&&(null===(i=e.track)||void 0===i?void 0:i.height)})).map((e=>{var t,i;return((null===(t=e.track)||void 0===t?void 0:t.width)||1)/((null===(i=e.track)||void 0===i?void 0:i.height)||1)})))||1,height:1}}),[u,f]),p=f.length,{tilesInFirstPage:m,defaultWidth:y,defaultHeight:S,lastPageWidth:P,lastPageHeight:b,isLastPageDifferentFromFirstPage:E}=e.useMemo((()=>M({count:p,parentWidth:Math.floor(d),parentHeight:Math.floor(h)-Math.min(h,c),maxTileCount:o,maxRowCount:a,maxColCount:r,aspectRatio:v})),[p,d,h,o,a,r,v,c]);return{pagesWithTiles:e.useMemo((()=>I({elements:f,tilesInFirstPage:m,onlyOnePage:!1,isLastPageDifferentFromFirstPage:E,defaultWidth:y,defaultHeight:S,lastPageWidth:P,lastPageHeight:b})),[f,m,E,y,S,P,b]),ref:g}},Object.keys(t).forEach((function(e){"default"===e||exports.hasOwnProperty(e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return t[e]}})}));
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- var ce=Object.defineProperty,ue=Object.defineProperties;var le=Object.getOwnPropertyDescriptors;var G=Object.getOwnPropertySymbols;var me=Object.prototype.hasOwnProperty,de=Object.prototype.propertyIsEnumerable;var q=(r,e,t)=>e in r?ce(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,E=(r,e)=>{for(var t in e||(e={}))me.call(e,t)&&q(r,t,e[t]);if(G)for(var t of G(e))de.call(e,t)&&q(r,t,e[t]);return r},I=(r,e)=>ue(r,le(e));var p=(r,e,t)=>new Promise((s,o)=>{var i=u=>{try{a(t.next(u))}catch(c){o(c)}},n=u=>{try{a(t.throw(u))}catch(c){o(c)}},a=u=>u.done?s(u.value):Promise.resolve(u.value).then(i,n);a((t=t.apply(r,e)).next())});import Se,{createContext as fe,useContext as V,useEffect as Q,useState as he}from"react";import{HMSReactiveStore as pe}from"@100mslive/hms-video-store";import C from"zustand";import{useContext as j}from"react";import J from"zustand/shallow";var M;(function(n){n[n.VERBOSE=0]="VERBOSE",n[n.DEBUG=1]="DEBUG",n[n.INFO=2]="INFO",n[n.WARN=3]="WARN",n[n.ERROR=4]="ERROR",n[n.NONE=5]="NONE"})(M||(M={}));var b=class{static v(e,...t){this.log(0,e,...t)}static d(e,...t){this.log(1,e,...t)}static i(e,...t){this.log(2,e,...t)}static w(e,...t){this.log(3,e,...t)}static e(e,...t){this.log(4,e,...t)}static log(e,t,...s){if(!(this.level.valueOf()>e.valueOf()))switch(e){case 0:{console.log("HMSui-components: ",t,...s);break}case 1:{console.debug("HMSui-components: ",t,...s);break}case 2:{console.info("HMSui-components: ",t,...s);break}case 3:{console.warn("HMSui-components: ",t,...s);break}case 4:{console.error("HMSui-components: ",t,...s);break}}}};b.level=0;var T="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.";function U(r){return(t,s=J)=>{t||b.w("fetching full store without passing any selector may have a heavy performance impact on your website.");let o=j(r);if(!o)throw new Error(T);return o.store(t,s)}}function _(r){return(t,s=J)=>{t||b.w("fetching full store without passing any selector may have a heavy performance impact on your website.");let o=j(r);if(!o)throw new Error(T);let i=o.statsStore;return i==null?void 0:i(t,s)}}var K=typeof window!="undefined";var x=fe(null),w,ge=({children:r,actions:e,store:t,notifications:s,stats:o,isHMSStatsOn:i=!1})=>{if(!w){let n=()=>{throw new Error("modifying store is not allowed")};if(e&&t)w={actions:e,store:C(I(E({},t),{setState:n,destroy:n}))},s&&(w.notifications=s),o&&(w.statsStore=C({getState:o.getState,subscribe:o.subscribe,setState:n,destroy:n}));else{let a=new pe;if(w={actions:a.getActions(),store:C(I(E({},a.getStore()),{setState:n,destroy:n})),notifications:a.getNotifications()},i){let u=a.getStats();w.statsStore=C({getState:u.getState,subscribe:u.subscribe,setState:n,destroy:n})}}}return Q(()=>{K&&(window.addEventListener("beforeunload",()=>w.actions.leave()),window.addEventListener("onunload",()=>w.actions.leave()))},[]),Se.createElement(x.Provider,{value:w},r)},l=U(x),He=_(x),A=()=>{let r=V(x);if(!r)throw new Error(T);return r.store},D=()=>{let r=V(x);if(!r)throw new Error(T);return r.notifications},g=()=>{let r=V(x);if(!r)throw new Error(T);return r.actions},O=r=>{let e=V(x),[t,s]=he(null);if(!e)throw new Error(T);return Q(()=>e.notifications?e.notifications.onNotification(i=>s(i),r):void 0,[e.notifications,r]),t};import{HMSRoomState as X,selectIsConnectedToRoom as be,selectRoomState as ke}from"@100mslive/hms-video-store";import{useCallback as Y,useMemo as Re}from"react";var Me="react-sdk",k=(r,e)=>b.e(Me,e,r),ve=r=>{throw r};var Pe=({name:r="",token:e,metadata:t,handleError:s=k,initEndpoint:o,initialSettings:i})=>{let n=g(),a=l(ke),u=l(be)||!1,c=a===X.Preview,d=Re(()=>({userName:r,authToken:e,metaData:t,rememberDeviceSelection:!0,settings:i,initEndpoint:o}),[r,e,t,o,i]),f=Y(()=>{(()=>p(void 0,null,function*(){if(!!e){a!==X.Disconnected&&(yield n.leave());try{yield n.preview(d)}catch(m){s(m,"preview")}}}))()},[n,s,e,a,d]),S=Y(()=>{if(!!e)try{n.join(d)}catch(m){s(m,"join")}},[n,d,s,e]);return{enableJoin:c,join:S,isConnected:u,preview:f}};import{selectIsAllowedToPublish as we,selectIsLocalAudioEnabled as Te,selectIsLocalVideoEnabled as xe}from"@100mslive/hms-video-store";import{useCallback as Z}from"react";var ye=(r=k)=>{let e=l(Te),t=l(xe),s=l(we),o=g(),i=Z(()=>p(void 0,null,function*(){try{yield o.setLocalAudioEnabled(!e)}catch(a){r(a,"toggleAudio")}}),[o,e,r]),n=Z(()=>p(void 0,null,function*(){try{yield o.setLocalVideoEnabled(!t)}catch(a){r(a,"toggleVideo")}}),[o,t,r]);return{isLocalAudioEnabled:e,isLocalVideoEnabled:t,toggleAudio:(s==null?void 0:s.audio)?i:void 0,toggleVideo:(s==null?void 0:s.video)?n:void 0}};import{selectTrackByID as Ee}from"@100mslive/hms-video-store";import{useCallback as Ie,useEffect as $,useRef as Ae}from"react";import{useInView as Ve}from"react-intersection-observer";var Ce=({trackId:r,attach:e})=>{let t=g(),s=Ae(null),o=l(Ee(r)),{ref:i,inView:n}=Ve({threshold:.5}),a=Ie(u=>{s.current=u,i(u)},[i]);return $(()=>{(()=>p(void 0,null,function*(){s.current&&(o==null?void 0:o.id)&&(n&&o.enabled&&e!==!1?yield t.attachVideo(o.id,s.current):yield t.detachVideo(o.id,s.current))}))()},[t,n,s,o==null?void 0:o.id,o==null?void 0:o.enabled,o==null?void 0:o.deviceID,o==null?void 0:o.plugins,e]),$(()=>()=>{(()=>p(void 0,null,function*(){if(s.current&&o)try{yield t.detachVideo(o.id,s.current)}catch(u){b.w("detach video error for track",o.id,u)}}))()},[]),{videoRef:a}};import{selectIsLocalScreenShared as De,selectPeerScreenSharing as Oe,selectScreenSharesByPeerId as Ne}from"@100mslive/hms-video-store";import{useCallback as Le}from"react";var We=r=>console.log("Error: ",r),Fe=(r=We)=>{var n,a;let e=g(),t=l(De),s=l(Oe),o=l(Ne(s==null?void 0:s.id)),i=Le((u=!1)=>p(void 0,null,function*(){try{yield e.setScreenShareEnabled(!t,u)}catch(c){r(c)}}),[e,t,r]);return{amIScreenSharing:t,screenSharingPeerId:s==null?void 0:s.id,screenShareVideoTrackId:(n=o==null?void 0:o.video)==null?void 0:n.id,screenShareAudioTrackId:(a=o==null?void 0:o.audio)==null?void 0:a.id,toggleScreenShare:i}};import{selectAudioTrackVolume as Be,selectPermissions as ze,selectTrackByID as ee}from"@100mslive/hms-video-store";import{useCallback as N}from"react";var te=(r,e,t)=>p(void 0,null,function*(){if(e)try{yield r.setRemoteTrackEnabled(e.id,!e.enabled)}catch(s){t(s,"remoteToggle")}}),Ge=(r,e,t=k)=>{let s=g(),o=l(ee(r)),i=l(ee(e)),n=l(Be(o==null?void 0:o.id)),a=l(ze),u=(i==null?void 0:i.enabled)?a==null?void 0:a.mute:a==null?void 0:a.unmute,c=(o==null?void 0:o.enabled)?a==null?void 0:a.mute:a==null?void 0:a.unmute,d=N(()=>p(void 0,null,function*(){yield te(s,o,t)}),[s,o,t]),f=N(()=>p(void 0,null,function*(){yield te(s,i,t)}),[s,t,i]),S=N(m=>{o&&s.setVolume(m,o.id)},[s,o]);return{isAudioEnabled:!!(o==null?void 0:o.enabled),isVideoEnabled:!!(i==null?void 0:i.enabled),volume:n,toggleAudio:o&&c?d:void 0,toggleVideo:(i==null?void 0:i.source)==="regular"&&u?f:void 0,setVolume:o?S:void 0}};import{selectTracksMap as Ke}from"@100mslive/hms-video-store";import{useMemo as W}from"react";var qe=(r,e,t)=>r.reduce((s,o,i)=>{let n=Math.floor(i/e);return n>0&&t||(s[n]||(s[n]=[]),s[n].push(o)),s},[]),oe=({elements:r,tilesInFirstPage:e,onlyOnePage:t,isLastPageDifferentFromFirstPage:s,defaultWidth:o,defaultHeight:i,lastPageWidth:n,lastPageHeight:a})=>{let u=qe(r,e,t);return u.map((c,d)=>c.map(f=>{let S=d===u.length-1,m=s&&S?n:o,h=s&&S?a:i;return I(E({},f),{height:h,width:m})}))};function je(r){if(r.length===0)return null;let e={},t=r[0],s=1;for(let o=0;o<r.length;o++){let i=r[o];e[i]===null?e[i]=1:e[i]++,e[i]>s&&(t=i,s=e[i])}return t}var re=r=>je(r.filter(e=>{var t,s;return((t=e.track)==null?void 0:t.width)&&((s=e.track)==null?void 0:s.height)}).map(e=>{var o,i;let t=(o=e.track)==null?void 0:o.width,s=(i=e.track)==null?void 0:i.height;return(t||1)/(s||1)})),L=(r,e,t,s,o)=>{if(r<0||e<0)throw new Error("Container must have a non-negative area");if(t<1||!Number.isInteger(t))throw new Error("Number of shapes to place must be a positive integer");let i=s&&o&&s/o;if(i!==void 0&&isNaN(i))throw new Error("Aspect ratio must be a number");let n={area:0,cols:0,rows:0,width:0,height:0},a=t,u=-1;if(i!==void 0)for(let c=a;c>0;c+=u){let d=Math.ceil(t/c),f=r/(c*i),S=e/d,m,h;f<=S?(m=r/c,h=m/i):(h=e/d,m=h*i);let H=m*h;H>n.area&&(n={area:H,width:m,height:h,rows:d,cols:c})}return n},Je=({parentWidth:r,parentHeight:e,count:t,maxCount:s,aspectRatio:o})=>{let i=0,n=0,a=0,u=0,c=!1,d=0,f=0,S=Math.min(Math.ceil(Math.sqrt(t*(r/e)/(o.width/o.height))),s),m=r/S,h=m/(o.width/o.height);h>e&&(h=e,m=h/(o.height/o.width));let H=Math.floor(e/h);if(n=h,i=m,d=Math.min(t,H*S),f=t%(H*S),c=f>0&&t>H*S,c){let y=Math.min(Math.ceil(Math.sqrt(f*(r/e)/(o.width/o.height))),s),R=r/y,P=R/(o.width/o.height);P>e&&(P=e,R=P/(o.height/o.width)),u=P,a=R}return{tilesInFirstPage:d,defaultWidth:i,defaultHeight:n,lastPageWidth:a,lastPageHeight:u,isLastPageDifferentFromFirstPage:c}},Ue=({parentWidth:r,parentHeight:e,count:t,maxCount:s,aspectRatio:o})=>{let i=0,n=0,a=0,u=0,c=!1,d=0,f=0,{width:S,height:m}=L(r,e,Math.min(t,s),o.width,o.height);if(i=S,n=m,d=Math.min(t,s),f=t%s,c=f>0&&t>s,c){let{width:h,height:H}=L(r,e,f,o.width,o.height);a=h,u=H}return{tilesInFirstPage:d,defaultWidth:i,defaultHeight:n,lastPageWidth:a,lastPageHeight:u,isLastPageDifferentFromFirstPage:c}},_e=({parentWidth:r,parentHeight:e,count:t,maxCount:s,aspectRatio:o})=>{let i=0,n=0,a=0,u=0,c=!1,d=0,f=0,S=Math.min(Math.ceil(Math.sqrt(t*(o.width/o.height)/(r/e))),s),m=e/S,h=m*(o.width/o.height),H=Math.floor(r/h);if(i=h,n=m,d=Math.min(t,S*H),f=t%(S*H),c=f>0&&t>S*H,c){let y=Math.min(Math.ceil(Math.sqrt(f*(o.width/o.height)/(r/e))),s),R=e/y,P=R*(o.width/o.height);u=R,a=P}return{tilesInFirstPage:d,defaultWidth:i,defaultHeight:n,lastPageWidth:a,lastPageHeight:u,isLastPageDifferentFromFirstPage:c}};function se({count:r,parentWidth:e,parentHeight:t,maxTileCount:s,maxRowCount:o,maxColCount:i,aspectRatio:n}){let a=0,u=0,c=0,d=0,f=!1,S=0;if(r===0)return{tilesInFirstPage:S,defaultWidth:a,defaultHeight:u,lastPageWidth:c,lastPageHeight:d,isLastPageDifferentFromFirstPage:f};if(s)({tilesInFirstPage:S,defaultWidth:a,defaultHeight:u,lastPageWidth:c,lastPageHeight:d,isLastPageDifferentFromFirstPage:f}=Ue({parentWidth:e,parentHeight:t,count:r,maxCount:s,aspectRatio:n}));else if(o)({tilesInFirstPage:S,defaultWidth:a,defaultHeight:u,lastPageWidth:c,lastPageHeight:d,isLastPageDifferentFromFirstPage:f}=_e({parentWidth:e,parentHeight:t,count:r,maxCount:o,aspectRatio:n}));else if(i)({tilesInFirstPage:S,defaultWidth:a,defaultHeight:u,lastPageWidth:c,lastPageHeight:d,isLastPageDifferentFromFirstPage:f}=Je({parentWidth:e,parentHeight:t,count:r,maxCount:i,aspectRatio:n}));else{let{width:m,height:h}=L(e,t,r,n.width,n.height);a=m,u=h,S=r}return{tilesInFirstPage:S,defaultWidth:a,defaultHeight:u,lastPageWidth:c,lastPageHeight:d,isLastPageDifferentFromFirstPage:f}}var ie=(r,e,t,s=!0)=>{if(!r||!e||!t)return[];let o=[];for(let i of r)if(i.videoTrack===void 0&&i.audioTrack&&e[i.audioTrack]?o.push({peer:i}):i.videoTrack&&e[i.videoTrack]?o.push({track:e[i.videoTrack],peer:i}):s||o.push({peer:i}),t(i)&&i.auxiliaryTracks.length>0){let a=i.auxiliaryTracks.find(u=>{let c=e[u];return(c==null?void 0:c.type)==="video"&&(c==null?void 0:c.source)==="screen"});a&&o.push({track:e[a],peer:i})}return o};import{useResizeDetector as Qe}from"react-resize-detector";var Xe={aspectRatio:{width:1,height:1}},Ye=({peers:r,maxTileCount:e,maxColCount:t,maxRowCount:s,includeScreenShareForPeer:o=()=>!1,aspectRatio:i=Xe.aspectRatio,filterNonPublishingPeers:n=!0,offsetY:a=0})=>{let{width:u=0,height:c=0,ref:d}=Qe(),S=A().getState(Ke),m=ie(r,S,o,n),h=W(()=>i||{width:re(m)||1,height:1},[i,m]),H=m.length,{tilesInFirstPage:y,defaultWidth:R,defaultHeight:P,lastPageWidth:F,lastPageHeight:B,isLastPageDifferentFromFirstPage:z}=W(()=>se({count:H,parentWidth:Math.floor(u),parentHeight:Math.floor(c)-Math.min(c,a),maxTileCount:e,maxRowCount:s,maxColCount:t,aspectRatio:h}),[H,u,c,e,s,t,h,a]);return{pagesWithTiles:W(()=>oe({elements:m,tilesInFirstPage:y,onlyOnePage:!1,isLastPageDifferentFromFirstPage:z,defaultWidth:R,defaultHeight:P,lastPageWidth:F,lastPageHeight:B}),[m,y,z,R,P,F,B]),ref:d}};import{useEffect as Ze}from"react";import{selectTrackAudioByID as $e}from"@100mslive/hms-video-store";function et({trackId:r,getStyle:e,ref:t}){let s=A();Ze(()=>s.subscribe(o=>{if(!t.current)return;let i=e(o);for(let n in i)t.current.style[n]=i[n]},$e(r)),[e,t,s,r])}import{selectDevices as tt,selectIsAllowedToPublish as ot,selectLocalMediaSettings as rt}from"@100mslive/hms-video-store";import{useCallback as st}from"react";var v;(function(s){s.videoInput="videoInput",s.audioInput="audioInput",s.audioOutput="audioOutput"})(v||(v={}));var it=(r=k)=>{let e=g(),t=l(tt),s=l(rt),o=l(ot),i={[v.audioOutput]:s.audioOutputDeviceId},n={[v.audioOutput]:t.audioOutput};o.video&&(n[v.videoInput]=t.videoInput,i[v.videoInput]=s.videoInputDeviceId),o.audio&&(n[v.audioInput]=t.audioInput,i[v.audioInput]=s.audioInputDeviceId);let a=st(d=>p(void 0,[d],function*({deviceType:u,deviceId:c}){try{switch(u){case v.audioInput:yield e.setAudioSettings({deviceId:c});break;case v.videoInput:yield e.setVideoSettings({deviceId:c});break;case v.audioOutput:e.setAudioOutputDevice(c);break}}catch(f){r(f,"updateDevices")}}),[r,e]);return{allDevices:n,selectedDeviceIDs:i,updateDevice:a}};import{useMemo as nt}from"react";import{selectIsConnectedToRoom as at,selectPeerCount as ct,selectPeers as ut,selectRemotePeers as lt}from"@100mslive/hms-video-store";var ne=r=>!r||!Array.isArray(r)||r.length===0?{}:r.reduce((e,t)=>(t.roleName&&(e[t.roleName]||(e[t.roleName]=[]),e[t.roleName].push(t)),e),{});var mt=()=>{let r=l(at),e=l(r?ut:lt),t=l(ct),s=nt(()=>ne(e),[e]);return{roles:Object.keys(s),participantsByRoles:s,peerCount:t,isConnected:r}};import{selectHLSState as dt,selectRecordingState as St,selectRTMPState as ft}from"@100mslive/hms-video-store";var ht=()=>{let r=l(St),e=l(ft),t=l(dt),s=r.server.running,o=r.browser.running,i=r.hls.running,n=t.running||e.running,a=s||o||i;return{isServerRecordingOn:s,isBrowserRecordingOn:o,isHLSRecordingOn:i,isStreamingOn:n,isHLSRunning:t.running,isRTMPRunning:e.running,isRecordingOn:a}};import{useCallback as pt,useEffect as gt,useState as Ht}from"react";import{HMSNotificationTypes as Mt}from"@100mslive/hms-video-store";var vt=()=>{let r=O(Mt.ERROR),[e,t]=Ht(""),s=g(),o=pt(()=>p(void 0,null,function*(){yield s.unblockAudio()}),[s]);return gt(()=>{(r==null?void 0:r.data.code)===3008&&t(r==null?void 0:r.data.message)},[r]),{error:e,unblockAudio:o,resetError:()=>t("")}};import{useCallback as bt,useEffect as ae}from"react";import{HMSNotificationTypes as kt}from"@100mslive/hms-video-store";var Rt=({type:r,onEvent:e,handleError:t=k})=>{let s=g(),o=D();return ae(()=>{s.ignoreMessageTypes([r])},[s,r]),ae(()=>o?o.onNotification(a=>{let u=a.data;if(u&&u.type===r)try{let c=JSON.parse(u.message);e==null||e(c)}catch(c){t(c,"handleCustomEvent")}},kt.NEW_MESSAGE):void 0,[o,r,e,t]),{sendEvent:bt(n=>p(void 0,null,function*(){try{let a=JSON.stringify(n||"");yield s.sendBroadcastMessage(a,r),e==null||e(n)}catch(a){t(a,"sendCustomEvent")}}),[s,t,e,r])}};export*from"@100mslive/hms-video-store";export{v as DeviceType,ge as HMSRoomProvider,ve as throwErrorHandler,ye as useAVToggle,et as useAudioLevelStyles,vt as useAutoplayError,Rt as useCustomEvent,it as useDevices,g as useHMSActions,O as useHMSNotifications,He as useHMSStatsStore,l as useHMSStore,D as useHMSVanillaNotifications,A as useHMSVanillaStore,mt as useParticipantList,Pe as usePreviewJoin,ht as useRecordingStreaming,Ge as useRemoteAVToggle,Fe as useScreenShare,Ce as useVideo,Ye as useVideoList};
1
+ export{HMSRoomProvider,useHMSActions,useHMSNotifications,useHMSStatsStore,useHMSStore,useHMSVanillaNotifications,useHMSVanillaStore}from"./primitives/HmsRoomProvider.js";export{usePreviewJoin}from"./hooks/usePreviewJoin.js";export{useAVToggle}from"./hooks/useAVToggle.js";export{useVideo}from"./hooks/useVideo.js";export{useScreenShare}from"./hooks/useScreenShare.js";export{useRemoteAVToggle}from"./hooks/useRemoteAVToggle.js";export{useVideoList}from"./hooks/useVideoList.js";export{useAudioLevelStyles}from"./hooks/useAudioLevelStyles.js";export{DeviceType,useDevices}from"./hooks/useDevices.js";export{useParticipantList}from"./hooks/useParticipantList.js";export{useRecordingStreaming}from"./hooks/useRecordingStreaming.js";export{useAutoplayError}from"./hooks/useAutoplayError.js";export{useCustomEvent}from"./hooks/useCustomEvent.js";export{throwErrorHandler}from"./utils/commons.js";export*from"@100mslive/hms-video-store";
@@ -0,0 +1,15 @@
1
+ /*! *****************************************************************************
2
+ Copyright (c) Microsoft Corporation.
3
+
4
+ Permission to use, copy, modify, and/or distribute this software for any
5
+ purpose with or without fee is hereby granted.
6
+
7
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
8
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
9
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
10
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
11
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
12
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
13
+ PERFORMANCE OF THIS SOFTWARE.
14
+ ***************************************************************************** */
15
+ 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};
@@ -0,0 +1 @@
1
+ function t(t,e){if(Object.is(t,e))return!0;if("object"!=typeof t||null===t||"object"!=typeof e||null===e)return!1;const r=Object.keys(t);if(r.length!==Object.keys(e).length)return!1;for(let n=0;n<r.length;n++)if(!Object.prototype.hasOwnProperty.call(e,r[n])||!Object.is(t[r[n]],e[r[n]]))return!1;return!0}export{t as default};
@@ -0,0 +1 @@
1
+ import t,{createContext as e,useEffect as o,useContext as s,useState as r}from"react";import{HMSReactiveStore as i}from"@100mslive/hms-video-store";import n from"zustand";import{makeHMSStoreHook as a,makeHMSStatsStoreHook as c,hooksErrorMessage as f}from"./store.js";import{isBrowser as d}from"../utils/isBrowser.js";const u=e(null);let l;const w=({children:e,actions:s,store:r,notifications:a,stats:c,isHMSStatsOn:f=!1})=>{if(!l){const t=()=>{throw new Error("modifying store is not allowed")};if(s&&r)l={actions:s,store:n(Object.assign(Object.assign({},r),{setState:t,destroy:t}))},a&&(l.notifications=a),c&&(l.statsStore=n({getState:c.getState,subscribe:c.subscribe,setState:t,destroy:t}));else{const e=new i;if(l={actions:e.getActions(),store:n(Object.assign(Object.assign({},e.getStore()),{setState:t,destroy:t})),notifications:e.getNotifications()},f){const o=e.getStats();l.statsStore=n({getState:o.getState,subscribe:o.subscribe,setState:t,destroy:t})}}}return o((()=>{d&&(window.addEventListener("beforeunload",(()=>l.actions.leave())),window.addEventListener("onunload",(()=>l.actions.leave())))}),[]),t.createElement(u.Provider,{value:l},e)},m=a(u),S=c(u),b=()=>{const t=s(u);if(!t)throw new Error(f);return t.store},g=()=>{const t=s(u);if(!t)throw new Error(f);return t.notifications},v=()=>{const t=s(u);if(!t)throw new Error(f);return t.actions},E=t=>{const e=s(u),[i,n]=r(null);if(!e)throw new Error(f);return o((()=>{if(!e.notifications)return;return e.notifications.onNotification((t=>n(t)),t)}),[e.notifications,t]),i};export{w as HMSRoomProvider,v as useHMSActions,E as useHMSNotifications,S as useHMSStatsStore,m as useHMSStore,g as useHMSVanillaNotifications,b as useHMSVanillaStore};
@@ -0,0 +1 @@
1
+ import{useContext as o}from"react";import e from"../node_modules/zustand/esm/shallow.js";import t from"../utils/logger.js";const r="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.";function s(s){return(n,i=e)=>{n||t.w("fetching full store without passing any selector may have a heavy performance impact on your website.");const a=o(s);if(!a)throw new Error(r);return(0,a.store)(n,i)}}function n(s){return(n,i=e)=>{n||t.w("fetching full store without passing any selector may have a heavy performance impact on your website.");const a=o(s);if(!a)throw new Error(r);const c=a.statsStore;return null==c?void 0:c(n,i)}}export{r as hooksErrorMessage,n as makeHMSStatsStoreHook,s as makeHMSStoreHook};
@@ -0,0 +1 @@
1
+ import o from"./logger.js";const r=(r,t)=>o.e("react-sdk",t,r),t=o=>{throw o};export{r as logErrorHandler,t as throwErrorHandler};
@@ -0,0 +1 @@
1
+ const e=e=>e&&Array.isArray(e)&&0!==e.length?e.reduce(((e,r)=>r.roleName?(e[r.roleName]||(e[r.roleName]=[]),e[r.roleName].push(r),e):e),{}):{};export{e as groupByRoles};
@@ -0,0 +1 @@
1
+ const e="undefined"!=typeof window;export{e as isBrowser};
@@ -0,0 +1 @@
1
+ const t=(t,e,i)=>t.reduce(((t,a,h)=>{const r=Math.floor(h/e);return r>0&&i||(t[r]||(t[r]=[]),t[r].push(a)),t}),[]),e=({elements:e,tilesInFirstPage:i,onlyOnePage:a,isLastPageDifferentFromFirstPage:h,defaultWidth:r,defaultHeight:n,lastPageWidth:s,lastPageHeight:o})=>{const g=t(e,i,a);return g.map(((t,e)=>t.map((t=>{const i=e===g.length-1,a=h&&i?s:r,l=h&&i?o:n;return Object.assign(Object.assign({},t),{height:l,width:a})}))))};function i(t){if(0===t.length)return null;const e={};let i=t[0],a=1;for(let h=0;h<t.length;h++){const r=t[h];null===e[r]?e[r]=1:e[r]++,e[r]>a&&(i=r,a=e[r])}return i}const a=t=>i(t.filter((t=>{var e,i;return(null===(e=t.track)||void 0===e?void 0:e.width)&&(null===(i=t.track)||void 0===i?void 0:i.height)})).map((t=>{var e,i;return((null===(e=t.track)||void 0===e?void 0:e.width)||1)/((null===(i=t.track)||void 0===i?void 0:i.height)||1)}))),h=(t,e,i,a,h)=>{if(t<0||e<0)throw new Error("Container must have a non-negative area");if(i<1||!Number.isInteger(i))throw new Error("Number of shapes to place must be a positive integer");const r=a&&h&&a/h;if(void 0!==r&&isNaN(r))throw new Error("Aspect ratio must be a number");let n={area:0,cols:0,rows:0,width:0,height:0};if(void 0!==r)for(let a=i;a>0;a+=-1){const h=Math.ceil(i/a);let s,o;t/(a*r)<=e/h?(s=t/a,o=s/r):(o=e/h,s=o*r);const g=s*o;g>n.area&&(n={area:g,width:s,height:o,rows:h,cols:a})}return n},r=({parentWidth:t,parentHeight:e,count:i,maxCount:a,aspectRatio:h})=>{let r=0,n=0,s=0,o=0,g=!1,l=0,d=0;const u=Math.min(Math.ceil(Math.sqrt(i*(t/e)/(h.width/h.height))),a);let c=t/u,f=c/(h.width/h.height);f>e&&(f=e,c=f/(h.height/h.width));const P=Math.floor(e/f);if(n=f,r=c,l=Math.min(i,P*u),d=i%(P*u),g=d>0&&i>P*u,g){let i=t/Math.min(Math.ceil(Math.sqrt(d*(t/e)/(h.width/h.height))),a),r=i/(h.width/h.height);r>e&&(r=e,i=r/(h.height/h.width)),o=r,s=i}return{tilesInFirstPage:l,defaultWidth:r,defaultHeight:n,lastPageWidth:s,lastPageHeight:o,isLastPageDifferentFromFirstPage:g}},n=({parentWidth:t,parentHeight:e,count:i,maxCount:a,aspectRatio:r})=>{let n=0,s=0,o=0,g=0,l=!1,d=0,u=0;const{width:c,height:f}=h(t,e,Math.min(i,a),r.width,r.height);if(n=c,s=f,d=Math.min(i,a),u=i%a,l=u>0&&i>a,l){const{width:i,height:a}=h(t,e,u,r.width,r.height);o=i,g=a}return{tilesInFirstPage:d,defaultWidth:n,defaultHeight:s,lastPageWidth:o,lastPageHeight:g,isLastPageDifferentFromFirstPage:l}},s=({parentWidth:t,parentHeight:e,count:i,maxCount:a,aspectRatio:h})=>{let r=0,n=0,s=0,o=0,g=!1,l=0,d=0;const u=Math.min(Math.ceil(Math.sqrt(i*(h.width/h.height)/(t/e))),a),c=e/u,f=c*(h.width/h.height),P=Math.floor(t/f);if(r=f,n=c,l=Math.min(i,u*P),d=i%(u*P),g=d>0&&i>u*P,g){const i=e/Math.min(Math.ceil(Math.sqrt(d*(h.width/h.height)/(t/e))),a);o=i,s=i*(h.width/h.height)}return{tilesInFirstPage:l,defaultWidth:r,defaultHeight:n,lastPageWidth:s,lastPageHeight:o,isLastPageDifferentFromFirstPage:g}};function o({count:t,parentWidth:e,parentHeight:i,maxTileCount:a,maxRowCount:o,maxColCount:g,aspectRatio:l}){let d=0,u=0,c=0,f=0,P=!1,p=0;if(0===t)return{tilesInFirstPage:p,defaultWidth:d,defaultHeight:u,lastPageWidth:c,lastPageHeight:f,isLastPageDifferentFromFirstPage:P};if(a)({tilesInFirstPage:p,defaultWidth:d,defaultHeight:u,lastPageWidth:c,lastPageHeight:f,isLastPageDifferentFromFirstPage:P}=n({parentWidth:e,parentHeight:i,count:t,maxCount:a,aspectRatio:l}));else if(o)({tilesInFirstPage:p,defaultWidth:d,defaultHeight:u,lastPageWidth:c,lastPageHeight:f,isLastPageDifferentFromFirstPage:P}=s({parentWidth:e,parentHeight:i,count:t,maxCount:o,aspectRatio:l}));else if(g)({tilesInFirstPage:p,defaultWidth:d,defaultHeight:u,lastPageWidth:c,lastPageHeight:f,isLastPageDifferentFromFirstPage:P}=r({parentWidth:e,parentHeight:i,count:t,maxCount:g,aspectRatio:l}));else{const{width:a,height:r}=h(e,i,t,l.width,l.height);d=a,u=r,p=t}return{tilesInFirstPage:p,defaultWidth:d,defaultHeight:u,lastPageWidth:c,lastPageHeight:f,isLastPageDifferentFromFirstPage:P}}const g=(t,e,i,a=!0)=>{if(!t||!e||!i)return[];const h=[];for(const r of t){if(void 0===r.videoTrack&&r.audioTrack&&e[r.audioTrack]?h.push({peer:r}):r.videoTrack&&e[r.videoTrack]?h.push({track:e[r.videoTrack],peer:r}):a||h.push({peer:r}),i(r)&&r.auxiliaryTracks.length>0){const t=r.auxiliaryTracks.find((t=>{const i=e[t];return"video"===(null==i?void 0:i.type)&&"screen"===(null==i?void 0:i.source)}));t&&h.push({track:e[t],peer:r})}}return h};export{o as calculateLayoutSizes,t as chunk,e as chunkElements,a as getModeAspectRatio,r as getTileSizesWithColConstraint,n as getTileSizesWithPageConstraint,s as getTileSizesWithRowConstraint,g as getVideoTracksFromPeers,h as largestRect,i as mode};
@@ -0,0 +1 @@
1
+ var s,e;(e=s||(s={}))[e.VERBOSE=0]="VERBOSE",e[e.DEBUG=1]="DEBUG",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR",e[e.NONE=5]="NONE";class o{static v(e,...o){this.log(s.VERBOSE,e,...o)}static d(e,...o){this.log(s.DEBUG,e,...o)}static i(e,...o){this.log(s.INFO,e,...o)}static w(e,...o){this.log(s.WARN,e,...o)}static e(e,...o){this.log(s.ERROR,e,...o)}static log(e,o,...t){if(!(this.level.valueOf()>e.valueOf()))switch(e){case s.VERBOSE:console.log("HMSui-components: ",o,...t);break;case s.DEBUG:console.debug("HMSui-components: ",o,...t);break;case s.INFO:console.info("HMSui-components: ",o,...t);break;case s.WARN:console.warn("HMSui-components: ",o,...t);break;case s.ERROR:console.error("HMSui-components: ",o,...t)}}}o.level=s.VERBOSE;export{s as HMSLogLevel,o as default};
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.0.11-alpha.1",
7
+ "version": "0.0.12-alpha.0",
8
8
  "author": "100ms",
9
9
  "license": "MIT",
10
10
  "files": [
@@ -12,30 +12,32 @@
12
12
  ],
13
13
  "sideEffects": false,
14
14
  "scripts": {
15
- "prestart": "rm -rf dist && yarn types:build",
16
- "start": "concurrently \"yarn dev\" \"yarn types\"",
17
- "dev": "node ../../scripts/dev-react-sdk",
18
- "build:only": "node ../../scripts/build",
19
- "build": "yarn build:only && yarn types:build",
20
- "types": "tsc -w",
21
- "types:build": "tsc -p tsconfig.build.json",
15
+ "prestart": "rm -rf dist",
16
+ "start": "rollup -c -w",
17
+ "build": "rm -rf dist && NODE_ENV=production rollup -c",
22
18
  "lint": "eslint src/**",
23
19
  "lint:fix": "eslint src/** --fix",
24
20
  "format": "prettier -w src/**",
25
21
  "docs": "typedoc src/index.ts --plugin none"
26
22
  },
27
23
  "devDependencies": {
24
+ "@rollup/plugin-commonjs": "^21.0.3",
25
+ "@rollup/plugin-node-resolve": "^13.1.3",
26
+ "@rollup/plugin-typescript": "^8.3.1",
28
27
  "@types/react": "^17.0.38",
29
- "react": "^17.0.2"
28
+ "react": "^17.0.2",
29
+ "rollup": "^2.70.1",
30
+ "rollup-plugin-esbuild": "^4.9.1",
31
+ "rollup-plugin-terser": "^7.0.2"
30
32
  },
31
33
  "peerDependencies": {
32
- "react": "^17.0.1"
34
+ "react": "^17.0.2"
33
35
  },
34
36
  "dependencies": {
35
- "@100mslive/hms-video-store": "0.2.94-alpha.1",
37
+ "@100mslive/hms-video-store": "0.2.95-alpha.0",
36
38
  "react-intersection-observer": "^8.33.1",
37
39
  "react-resize-detector": "^7.0.0",
38
40
  "zustand": "^3.6.2"
39
41
  },
40
- "gitHead": "89fcc9bc1b16eddd27f0714c74b4cef567cab961"
42
+ "gitHead": "d45b16b746060715c7a0449ab450959ca6276cc5"
41
43
  }