@100mslive/react-sdk 0.4.3 → 0.4.5-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.
Files changed (67) hide show
  1. package/dist/hooks/types.d.ts +6 -0
  2. package/dist/hooks/useAVToggle.d.ts +24 -0
  3. package/dist/hooks/useAVToggle.js +1 -1
  4. package/dist/hooks/useAVToggle.js.map +1 -1
  5. package/dist/hooks/useAudioLevelStyles.d.ts +15 -0
  6. package/dist/hooks/useAudioLevelStyles.js.map +1 -1
  7. package/dist/hooks/useAutoplayError.d.ts +17 -0
  8. package/dist/hooks/useAutoplayError.js +1 -1
  9. package/dist/hooks/useAutoplayError.js.map +1 -1
  10. package/dist/hooks/useCustomEvent.d.ts +58 -0
  11. package/dist/hooks/useCustomEvent.js +1 -1
  12. package/dist/hooks/useCustomEvent.js.map +1 -1
  13. package/dist/hooks/useDevices.d.ts +40 -0
  14. package/dist/hooks/useDevices.js +1 -1
  15. package/dist/hooks/useDevices.js.map +1 -1
  16. package/dist/hooks/useParticipantList.d.ts +13 -0
  17. package/dist/hooks/useParticipantList.js.map +1 -1
  18. package/dist/hooks/useParticipants.d.ts +42 -0
  19. package/dist/hooks/useParticipants.js +1 -1
  20. package/dist/hooks/useParticipants.js.map +1 -1
  21. package/dist/hooks/usePreviewJoin.d.ts +58 -0
  22. package/dist/hooks/usePreviewJoin.js +1 -1
  23. package/dist/hooks/usePreviewJoin.js.map +1 -1
  24. package/dist/hooks/useRecordingStreaming.d.ts +10 -0
  25. package/dist/hooks/useRecordingStreaming.js.map +1 -1
  26. package/dist/hooks/useRemoteAVToggle.d.ts +36 -0
  27. package/dist/hooks/useRemoteAVToggle.js +1 -1
  28. package/dist/hooks/useRemoteAVToggle.js.map +1 -1
  29. package/dist/hooks/useScreenShare.d.ts +40 -0
  30. package/dist/hooks/useScreenShare.js +1 -1
  31. package/dist/hooks/useScreenShare.js.map +1 -1
  32. package/dist/hooks/useVideo.d.ts +27 -0
  33. package/dist/hooks/useVideo.js +1 -1
  34. package/dist/hooks/useVideo.js.map +1 -1
  35. package/dist/hooks/useVideoList.d.ts +68 -0
  36. package/dist/hooks/useVideoList.js.map +1 -1
  37. package/dist/index.cjs.js +1 -1
  38. package/dist/index.cjs.js.map +1 -1
  39. package/dist/index.d.ts +29 -0
  40. package/dist/node_modules/tslib/tslib.es6.js +2 -0
  41. package/dist/node_modules/tslib/tslib.es6.js.map +1 -0
  42. package/dist/{node_modules → packages/react-sdk/node_modules}/zustand/esm/shallow.js +0 -0
  43. package/dist/packages/react-sdk/node_modules/zustand/esm/shallow.js.map +1 -0
  44. package/dist/primitives/HmsRoomProvider.d.ts +49 -0
  45. package/dist/primitives/HmsRoomProvider.js +1 -1
  46. package/dist/primitives/HmsRoomProvider.js.map +1 -1
  47. package/dist/primitives/store.d.ts +15 -0
  48. package/dist/primitives/store.js +1 -1
  49. package/dist/primitives/store.js.map +1 -1
  50. package/dist/primitives/types.d.ts +5 -0
  51. package/dist/utils/commons.d.ts +7 -0
  52. package/dist/utils/commons.js.map +1 -1
  53. package/dist/utils/groupBy.d.ts +15 -0
  54. package/dist/utils/groupBy.js.map +1 -1
  55. package/dist/utils/isBrowser.d.ts +1 -0
  56. package/dist/utils/isBrowser.js.map +1 -1
  57. package/dist/utils/layout.d.ts +116 -0
  58. package/dist/utils/layout.js +1 -1
  59. package/dist/utils/layout.js.map +1 -1
  60. package/dist/utils/logger.d.ts +17 -0
  61. package/dist/utils/logger.js +1 -1
  62. package/dist/utils/logger.js.map +1 -1
  63. package/package.json +3 -4
  64. package/src/primitives/HmsRoomProvider.ts +1 -2
  65. package/dist/node_modules/zustand/esm/shallow.js.map +0 -1
  66. package/dist/package.json.js +0 -2
  67. package/dist/package.json.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"isBrowser.js","sources":["../../src/utils/isBrowser.ts"],"sourcesContent":["export const isBrowser = typeof window !== 'undefined';\n"],"names":["isBrowser","window"],"mappings":"AAAa,MAAAA,EAA8B,oBAAXC"}
1
+ {"version":3,"file":"isBrowser.js","sources":["../../src/utils/isBrowser.ts"],"sourcesContent":[null],"names":["isBrowser","window"],"mappings":"AAAa,MAAAA,EAA8B,oBAAXC"}
@@ -0,0 +1,116 @@
1
+ import { HMSPeer, HMSTrack, HMSTrackID, HMSVideoTrack, HMSScreenVideoTrack } from '@100mslive/hms-video-store';
2
+ export declare const chunk: <T>(elements: T[], chunkSize: number, onlyOnePage: boolean) => T[][];
3
+ interface ChunkElements<T> {
4
+ elements: T[];
5
+ tilesInFirstPage: number;
6
+ onlyOnePage: boolean;
7
+ isLastPageDifferentFromFirstPage: boolean;
8
+ defaultWidth: number;
9
+ defaultHeight: number;
10
+ lastPageWidth: number;
11
+ lastPageHeight: number;
12
+ }
13
+ /**
14
+ * Given a list of tracks/elements and some constraints, group the tracks in separate pages.
15
+ * @return 2D list for every page which has the original element and height and width
16
+ * for its tile.
17
+ */
18
+ export declare const chunkElements: <T>({ elements, tilesInFirstPage, onlyOnePage, isLastPageDifferentFromFirstPage, defaultWidth, defaultHeight, lastPageWidth, lastPageHeight, }: ChunkElements<T>) => (T & {
19
+ width: number;
20
+ height: number;
21
+ })[][];
22
+ /**
23
+ * Mathematical mode - the element with the highest occurrence in an array
24
+ * @param array
25
+ */
26
+ export declare function mode(array: number[]): number | null;
27
+ export declare type TrackWithPeer = {
28
+ track?: HMSVideoTrack | HMSScreenVideoTrack;
29
+ peer: HMSPeer;
30
+ };
31
+ /**
32
+ * get the aspect ration occurring with the highest frequency
33
+ * @param tracks - video tracks to infer aspect ratios from
34
+ */
35
+ export declare const getModeAspectRatio: (tracks: TrackWithPeer[]) => number | null;
36
+ interface GetTileSizesInList {
37
+ count: number;
38
+ parentWidth: number;
39
+ parentHeight: number;
40
+ maxTileCount?: number;
41
+ maxRowCount?: number;
42
+ maxColCount?: number;
43
+ aspectRatio: {
44
+ width: number;
45
+ height: number;
46
+ };
47
+ }
48
+ interface GetTileSizes {
49
+ parentWidth: number;
50
+ parentHeight: number;
51
+ count: number;
52
+ maxCount: number;
53
+ aspectRatio: {
54
+ width: number;
55
+ height: number;
56
+ };
57
+ }
58
+ /**
59
+ * Finds the largest rectangle area when trying to place N rectangle into a containing
60
+ * rectangle without rotation.
61
+ *
62
+ * @param {Number} containerWidth The width of the container.
63
+ * @param {Number} containerHeight The height of the container.
64
+ * @param {Number} numRects How many rectangles must fit within.
65
+ * @param {Number} width The unscaled width of the rectangles to be placed.
66
+ * @param {Number} height The unscaled height of the rectangles to be placed.
67
+ * @return {Object} The area and number of rows and columns that fit.
68
+ */
69
+ export declare const largestRect: (containerWidth: number, containerHeight: number, numRects: number, width: number | undefined, height: number | undefined) => {
70
+ area: number;
71
+ cols: number;
72
+ rows: number;
73
+ width: number;
74
+ height: number;
75
+ };
76
+ export declare const getTileSizesWithColConstraint: ({ parentWidth, parentHeight, count, maxCount, aspectRatio, }: GetTileSizes) => {
77
+ tilesInFirstPage: number;
78
+ defaultWidth: number;
79
+ defaultHeight: number;
80
+ lastPageWidth: number;
81
+ lastPageHeight: number;
82
+ isLastPageDifferentFromFirstPage: boolean;
83
+ };
84
+ export declare const getTileSizesWithPageConstraint: ({ parentWidth, parentHeight, count, maxCount, aspectRatio, }: GetTileSizes) => {
85
+ tilesInFirstPage: number;
86
+ defaultWidth: number;
87
+ defaultHeight: number;
88
+ lastPageWidth: number;
89
+ lastPageHeight: number;
90
+ isLastPageDifferentFromFirstPage: boolean;
91
+ };
92
+ export declare const getTileSizesWithRowConstraint: ({ parentWidth, parentHeight, count, maxCount, aspectRatio, }: GetTileSizes) => {
93
+ tilesInFirstPage: number;
94
+ defaultWidth: number;
95
+ defaultHeight: number;
96
+ lastPageWidth: number;
97
+ lastPageHeight: number;
98
+ isLastPageDifferentFromFirstPage: boolean;
99
+ };
100
+ export declare function calculateLayoutSizes({ count, parentWidth, parentHeight, maxTileCount, maxRowCount, maxColCount, aspectRatio, }: GetTileSizesInList): {
101
+ tilesInFirstPage: number;
102
+ defaultWidth: number;
103
+ defaultHeight: number;
104
+ lastPageWidth: number;
105
+ lastPageHeight: number;
106
+ isLastPageDifferentFromFirstPage: boolean;
107
+ };
108
+ /**
109
+ * given list of peers and all tracks in the room, get a list of tile objects to show in the UI
110
+ * @param peers
111
+ * @param tracks
112
+ * @param includeScreenShareForPeer - fn will be called to check whether to include screenShare for the peer in returned tiles
113
+ * @param filterNonPublishingPeers - by default a peer with no tracks won't be counted towards final tiles
114
+ */
115
+ export declare const getVideoTracksFromPeers: (peers: HMSPeer[], tracks: Record<HMSTrackID, HMSTrack>, includeScreenShareForPeer: (peer: HMSPeer) => boolean, filterNonPublishingPeers?: boolean) => TrackWithPeer[];
116
+ export {};
@@ -1,2 +1,2 @@
1
- var t=Object.defineProperty,e=Object.defineProperties,i=Object.getOwnPropertyDescriptors,a=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,h=Object.prototype.propertyIsEnumerable,n=(e,i,a)=>i in e?t(e,i,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[i]=a;const s=(t,e,i)=>t.reduce(((t,a,r)=>{const h=Math.floor(r/e);return h>0&&i||(t[h]||(t[h]=[]),t[h].push(a)),t}),[]),o=({elements:t,tilesInFirstPage:o,onlyOnePage:l,isLastPageDifferentFromFirstPage:g,defaultWidth:u,defaultHeight:d,lastPageWidth:c,lastPageHeight:f})=>{const p=s(t,o,l);return p.map(((t,s)=>t.map((t=>{const o=s===p.length-1,l=g&&o?c:u,P=g&&o?f:d;return m=((t,e)=>{for(var i in e||(e={}))r.call(e,i)&&n(t,i,e[i]);if(a)for(var i of a(e))h.call(e,i)&&n(t,i,e[i]);return t})({},t),e(m,i({height:P,width:l}));var m}))))};function l(t){if(0===t.length)return null;const e={};let i=t[0],a=1;for(let r=0;r<t.length;r++){const h=t[r];null===e[h]?e[h]=1:e[h]++,e[h]>a&&(i=h,a=e[h])}return i}const g=t=>l(t.filter((t=>{var e,i;return(null==(e=t.track)?void 0:e.width)&&(null==(i=t.track)?void 0:i.height)})).map((t=>{var e,i;return((null==(e=t.track)?void 0:e.width)||1)/((null==(i=t.track)?void 0:i.height)||1)}))),u=(t,e,i,a,r)=>{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 h=a&&r&&a/r;if(void 0!==h&&isNaN(h))throw new Error("Aspect ratio must be a number");let n={area:0,cols:0,rows:0,width:0,height:0};if(void 0!==h)for(let a=i;a>0;a+=-1){const r=Math.ceil(i/a);let s,o;t/(a*h)<=e/r?(s=t/a,o=s/h):(o=e/r,s=o*h);const l=s*o;l>n.area&&(n={area:l,width:s,height:o,rows:r,cols:a})}return n},d=({parentWidth:t,parentHeight:e,count:i,maxCount:a,aspectRatio:r})=>{let h=0,n=0,s=0,o=0,l=!1,g=0,u=0;const d=Math.min(Math.ceil(Math.sqrt(i*(t/e)/(r.width/r.height))),a);let c=t/d,f=c/(r.width/r.height);f>e&&(f=e,c=f/(r.height/r.width));const p=Math.floor(e/f);if(n=f,h=c,g=Math.min(i,p*d),u=i%(p*d),l=u>0&&i>p*d,l){let i=t/Math.min(Math.ceil(Math.sqrt(u*(t/e)/(r.width/r.height))),a),h=i/(r.width/r.height);h>e&&(h=e,i=h/(r.height/r.width)),o=h,s=i}return{tilesInFirstPage:g,defaultWidth:h,defaultHeight:n,lastPageWidth:s,lastPageHeight:o,isLastPageDifferentFromFirstPage:l}},c=({parentWidth:t,parentHeight:e,count:i,maxCount:a,aspectRatio:r})=>{let h=0,n=0,s=0,o=0,l=!1,g=0,d=0;const{width:c,height:f}=u(t,e,Math.min(i,a),r.width,r.height);if(h=c,n=f,g=Math.min(i,a),d=i%a,l=d>0&&i>a,l){const{width:i,height:a}=u(t,e,d,r.width,r.height);s=i,o=a}return{tilesInFirstPage:g,defaultWidth:h,defaultHeight:n,lastPageWidth:s,lastPageHeight:o,isLastPageDifferentFromFirstPage:l}},f=({parentWidth:t,parentHeight:e,count:i,maxCount:a,aspectRatio:r})=>{let h=0,n=0,s=0,o=0,l=!1,g=0,u=0;const d=Math.min(Math.ceil(Math.sqrt(i*(r.width/r.height)/(t/e))),a),c=e/d,f=c*(r.width/r.height),p=Math.floor(t/f);if(h=f,n=c,g=Math.min(i,d*p),u=i%(d*p),l=u>0&&i>d*p,l){const i=e/Math.min(Math.ceil(Math.sqrt(u*(r.width/r.height)/(t/e))),a);o=i,s=i*(r.width/r.height)}return{tilesInFirstPage:g,defaultWidth:h,defaultHeight:n,lastPageWidth:s,lastPageHeight:o,isLastPageDifferentFromFirstPage:l}};function p({count:t,parentWidth:e,parentHeight:i,maxTileCount:a,maxRowCount:r,maxColCount:h,aspectRatio:n}){let s=0,o=0,l=0,g=0,p=!1,P=0;if(0===t)return{tilesInFirstPage:P,defaultWidth:s,defaultHeight:o,lastPageWidth:l,lastPageHeight:g,isLastPageDifferentFromFirstPage:p};if(a)({tilesInFirstPage:P,defaultWidth:s,defaultHeight:o,lastPageWidth:l,lastPageHeight:g,isLastPageDifferentFromFirstPage:p}=c({parentWidth:e,parentHeight:i,count:t,maxCount:a,aspectRatio:n}));else if(r)({tilesInFirstPage:P,defaultWidth:s,defaultHeight:o,lastPageWidth:l,lastPageHeight:g,isLastPageDifferentFromFirstPage:p}=f({parentWidth:e,parentHeight:i,count:t,maxCount:r,aspectRatio:n}));else if(h)({tilesInFirstPage:P,defaultWidth:s,defaultHeight:o,lastPageWidth:l,lastPageHeight:g,isLastPageDifferentFromFirstPage:p}=d({parentWidth:e,parentHeight:i,count:t,maxCount:h,aspectRatio:n}));else{const{width:a,height:r}=u(e,i,t,n.width,n.height);s=a,o=r,P=t}return{tilesInFirstPage:P,defaultWidth:s,defaultHeight:o,lastPageWidth:l,lastPageHeight:g,isLastPageDifferentFromFirstPage:p}}const P=(t,e,i,a=!0)=>{if(!t||!e||!i)return[];const r=[];for(const h of t){if(void 0===h.videoTrack&&h.audioTrack&&e[h.audioTrack]?r.push({peer:h}):h.videoTrack&&e[h.videoTrack]?r.push({track:e[h.videoTrack],peer:h}):a||r.push({peer:h}),h.auxiliaryTracks.length>0&&h.auxiliaryTracks.forEach((t=>{const i=e[t];"video"===(null==i?void 0:i.type)&&"regular"===(null==i?void 0:i.source)&&r.push({track:i,peer:h})})),i(h)&&h.auxiliaryTracks.length>0){const t=h.auxiliaryTracks.find((t=>{const i=e[t];return"video"===(null==i?void 0:i.type)&&"screen"===(null==i?void 0:i.source)}));t&&r.push({track:e[t],peer:h})}}return r};export{p as calculateLayoutSizes,s as chunk,o as chunkElements,g as getModeAspectRatio,d as getTileSizesWithColConstraint,c as getTileSizesWithPageConstraint,f as getTileSizesWithRowConstraint,P as getVideoTracksFromPeers,u as largestRect,l as mode};
1
+ const t=(t,e,i)=>t.reduce(((t,a,r)=>{const h=Math.floor(r/e);return h>0&&i||(t[h]||(t[h]=[]),t[h].push(a)),t}),[]),e=({elements:e,tilesInFirstPage:i,onlyOnePage:a,isLastPageDifferentFromFirstPage:r,defaultWidth:h,defaultHeight:n,lastPageWidth:s,lastPageHeight:o})=>{const l=t(e,i,a);return l.map(((t,e)=>t.map((t=>{const i=e===l.length-1,a=r&&i?s:h,g=r&&i?o:n;return Object.assign(Object.assign({},t),{height:g,width:a})}))))};function i(t){if(0===t.length)return null;const e={};let i=t[0],a=1;for(let r=0;r<t.length;r++){const h=t[r];null===e[h]?e[h]=1:e[h]++,e[h]>a&&(i=h,a=e[h])}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)}))),r=(t,e,i,a,r)=>{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 h=a&&r&&a/r;if(void 0!==h&&isNaN(h))throw new Error("Aspect ratio must be a number");let n={area:0,cols:0,rows:0,width:0,height:0};if(void 0!==h)for(let a=i;a>0;a+=-1){const r=Math.ceil(i/a);let s,o;t/(a*h)<=e/r?(s=t/a,o=s/h):(o=e/r,s=o*h);const l=s*o;l>n.area&&(n={area:l,width:s,height:o,rows:r,cols:a})}return n},h=({parentWidth:t,parentHeight:e,count:i,maxCount:a,aspectRatio:r})=>{let h=0,n=0,s=0,o=0,l=!1,g=0,d=0;const u=Math.min(Math.ceil(Math.sqrt(i*(t/e)/(r.width/r.height))),a);let c=t/u,f=c/(r.width/r.height);f>e&&(f=e,c=f/(r.height/r.width));const P=Math.floor(e/f);if(n=f,h=c,g=Math.min(i,P*u),d=i%(P*u),l=d>0&&i>P*u,l){let i=t/Math.min(Math.ceil(Math.sqrt(d*(t/e)/(r.width/r.height))),a),h=i/(r.width/r.height);h>e&&(h=e,i=h/(r.height/r.width)),o=h,s=i}return{tilesInFirstPage:g,defaultWidth:h,defaultHeight:n,lastPageWidth:s,lastPageHeight:o,isLastPageDifferentFromFirstPage:l}},n=({parentWidth:t,parentHeight:e,count:i,maxCount:a,aspectRatio:h})=>{let n=0,s=0,o=0,l=0,g=!1,d=0,u=0;const{width:c,height:f}=r(t,e,Math.min(i,a),h.width,h.height);if(n=c,s=f,d=Math.min(i,a),u=i%a,g=u>0&&i>a,g){const{width:i,height:a}=r(t,e,u,h.width,h.height);o=i,l=a}return{tilesInFirstPage:d,defaultWidth:n,defaultHeight:s,lastPageWidth:o,lastPageHeight:l,isLastPageDifferentFromFirstPage:g}},s=({parentWidth:t,parentHeight:e,count:i,maxCount:a,aspectRatio:r})=>{let h=0,n=0,s=0,o=0,l=!1,g=0,d=0;const u=Math.min(Math.ceil(Math.sqrt(i*(r.width/r.height)/(t/e))),a),c=e/u,f=c*(r.width/r.height),P=Math.floor(t/f);if(h=f,n=c,g=Math.min(i,u*P),d=i%(u*P),l=d>0&&i>u*P,l){const i=e/Math.min(Math.ceil(Math.sqrt(d*(r.width/r.height)/(t/e))),a);o=i,s=i*(r.width/r.height)}return{tilesInFirstPage:g,defaultWidth:h,defaultHeight:n,lastPageWidth:s,lastPageHeight:o,isLastPageDifferentFromFirstPage:l}};function o({count:t,parentWidth:e,parentHeight:i,maxTileCount:a,maxRowCount:o,maxColCount:l,aspectRatio:g}){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:g}));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:g}));else if(l)({tilesInFirstPage:p,defaultWidth:d,defaultHeight:u,lastPageWidth:c,lastPageHeight:f,isLastPageDifferentFromFirstPage:P}=h({parentWidth:e,parentHeight:i,count:t,maxCount:l,aspectRatio:g}));else{const{width:a,height:h}=r(e,i,t,g.width,g.height);d=a,u=h,p=t}return{tilesInFirstPage:p,defaultWidth:d,defaultHeight:u,lastPageWidth:c,lastPageHeight:f,isLastPageDifferentFromFirstPage:P}}const l=(t,e,i,a=!0)=>{if(!t||!e||!i)return[];const r=[];for(const h of t){if(void 0===h.videoTrack&&h.audioTrack&&e[h.audioTrack]?r.push({peer:h}):h.videoTrack&&e[h.videoTrack]?r.push({track:e[h.videoTrack],peer:h}):a||r.push({peer:h}),h.auxiliaryTracks.length>0&&h.auxiliaryTracks.forEach((t=>{const i=e[t];"video"===(null==i?void 0:i.type)&&"regular"===(null==i?void 0:i.source)&&r.push({track:i,peer:h})})),i(h)&&h.auxiliaryTracks.length>0){const t=h.auxiliaryTracks.find((t=>{const i=e[t];return"video"===(null==i?void 0:i.type)&&"screen"===(null==i?void 0:i.source)}));t&&r.push({track:e[t],peer:h})}}return r};export{o as calculateLayoutSizes,t as chunk,e as chunkElements,a as getModeAspectRatio,h as getTileSizesWithColConstraint,n as getTileSizesWithPageConstraint,s as getTileSizesWithRowConstraint,l as getVideoTracksFromPeers,r as largestRect,i as mode};
2
2
  //# sourceMappingURL=layout.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"layout.js","sources":["../../src/utils/layout.ts"],"sourcesContent":["/* eslint-disable complexity */\n/* eslint-disable no-plusplus */\n/* eslint-disable @typescript-eslint/no-shadow */\nimport { HMSPeer, HMSTrack, HMSTrackID, HMSVideoTrack, HMSScreenVideoTrack } from '@100mslive/hms-video-store';\n\nexport const chunk = <T>(elements: T[], chunkSize: number, onlyOnePage: boolean) =>\n elements.reduce((resultArray: T[][], tile: T, index: number) => {\n const chunkIndex = Math.floor(index / chunkSize);\n if (chunkIndex > 0 && onlyOnePage) {\n return resultArray;\n }\n if (!resultArray[chunkIndex]) {\n resultArray[chunkIndex] = []; // start a new chunk\n }\n\n resultArray[chunkIndex].push(tile);\n return resultArray;\n }, []);\n\ninterface ChunkElements<T> {\n elements: T[];\n tilesInFirstPage: number;\n onlyOnePage: boolean;\n isLastPageDifferentFromFirstPage: boolean;\n defaultWidth: number;\n defaultHeight: number;\n lastPageWidth: number;\n lastPageHeight: number;\n}\n\n/**\n * Given a list of tracks/elements and some constraints, group the tracks in separate pages.\n * @return 2D list for every page which has the original element and height and width\n * for its tile.\n */\nexport const chunkElements = <T>({\n elements,\n tilesInFirstPage,\n onlyOnePage,\n isLastPageDifferentFromFirstPage,\n defaultWidth,\n defaultHeight,\n lastPageWidth,\n lastPageHeight,\n}: ChunkElements<T>): (T & { width: number; height: number })[][] => {\n const chunks: T[][] = chunk<T>(elements, tilesInFirstPage, onlyOnePage);\n return chunks.map((ch, page) =>\n ch.map(element => {\n const isLastPage: boolean = page === chunks.length - 1;\n const width = isLastPageDifferentFromFirstPage && isLastPage ? lastPageWidth : defaultWidth;\n const height = isLastPageDifferentFromFirstPage && isLastPage ? lastPageHeight : defaultHeight;\n return { ...element, height, width };\n }),\n );\n};\n\n/**\n * Mathematical mode - the element with the highest occurrence in an array\n * @param array\n */\nexport function mode(array: number[]): number | null {\n if (array.length === 0) {\n return null;\n }\n const modeMap: Record<number, number> = {};\n let maxEl = array[0];\n let maxCount = 1;\n for (let i = 0; i < array.length; i++) {\n const el = array[i];\n if (modeMap[el] === null) {\n modeMap[el] = 1;\n } else {\n modeMap[el]++;\n }\n if (modeMap[el] > maxCount) {\n maxEl = el;\n maxCount = modeMap[el];\n }\n }\n return maxEl;\n}\n\nexport type TrackWithPeer = { track?: HMSVideoTrack | HMSScreenVideoTrack; peer: HMSPeer };\n\n/**\n * get the aspect ration occurring with the highest frequency\n * @param tracks - video tracks to infer aspect ratios from\n */\nexport const getModeAspectRatio = (tracks: TrackWithPeer[]): number | null =>\n mode(\n tracks\n .filter(track => track.track?.width && track.track?.height)\n .map(track => {\n const width = track.track?.width;\n const height = track.track?.height;\n // Default to 1 if there are no video tracks\n return (width || 1) / (height || 1);\n }),\n );\n\ninterface GetTileSizesInList {\n count: number;\n parentWidth: number;\n parentHeight: number;\n maxTileCount?: number;\n maxRowCount?: number;\n maxColCount?: number;\n aspectRatio: {\n width: number;\n height: number;\n };\n}\n\ninterface GetTileSizes {\n parentWidth: number;\n parentHeight: number;\n count: number;\n maxCount: number;\n aspectRatio: { width: number; height: number };\n}\n\n/**\n * Finds the largest rectangle area when trying to place N rectangle into a containing\n * rectangle without rotation.\n *\n * @param {Number} containerWidth The width of the container.\n * @param {Number} containerHeight The height of the container.\n * @param {Number} numRects How many rectangles must fit within.\n * @param {Number} width The unscaled width of the rectangles to be placed.\n * @param {Number} height The unscaled height of the rectangles to be placed.\n * @return {Object} The area and number of rows and columns that fit.\n */\nexport const largestRect = (\n containerWidth: number,\n containerHeight: number,\n numRects: number,\n width: number | undefined,\n height: number | undefined,\n) => {\n if (containerWidth < 0 || containerHeight < 0) {\n throw new Error('Container must have a non-negative area');\n }\n if (numRects < 1 || !Number.isInteger(numRects)) {\n throw new Error('Number of shapes to place must be a positive integer');\n }\n const aspectRatio = width && height && width / height;\n if (aspectRatio !== undefined && isNaN(aspectRatio)) {\n throw new Error('Aspect ratio must be a number');\n }\n\n let best = { area: 0, cols: 0, rows: 0, width: 0, height: 0 };\n\n // TODO: Don't start with obviously-`ba`d candidates.\n const startCols = numRects;\n const colDelta = -1;\n\n // For each combination of rows + cols that can fit the number of rectangles,\n // place them and see the area.\n if (aspectRatio !== undefined) {\n for (let cols = startCols; cols > 0; cols += colDelta) {\n const rows = Math.ceil(numRects / cols);\n const hScale = containerWidth / (cols * aspectRatio);\n const vScale = containerHeight / rows;\n let width;\n let height;\n // Determine which axis is the constraint.\n if (hScale <= vScale) {\n width = containerWidth / cols;\n height = width / aspectRatio;\n } else {\n height = containerHeight / rows;\n width = height * aspectRatio;\n }\n const area = width * height;\n if (area > best.area) {\n best = { area, width, height, rows, cols };\n }\n }\n }\n return best;\n};\n\nexport const getTileSizesWithColConstraint = ({\n parentWidth,\n parentHeight,\n count,\n maxCount,\n aspectRatio,\n}: GetTileSizes) => {\n let defaultWidth = 0;\n let defaultHeight = 0;\n let lastPageWidth = 0;\n let lastPageHeight = 0;\n let isLastPageDifferentFromFirstPage = false;\n let tilesInFirstPage = 0;\n let tilesinLastPage = 0;\n const cols = Math.min(\n Math.ceil(Math.sqrt((count * (parentWidth / parentHeight)) / (aspectRatio.width / aspectRatio.height))),\n maxCount,\n );\n let width = parentWidth / cols;\n let height = width / (aspectRatio.width / aspectRatio.height);\n if (height > parentHeight) {\n height = parentHeight;\n width = height / (aspectRatio.height / aspectRatio.width);\n }\n const rows = Math.floor(parentHeight / height);\n defaultHeight = height;\n defaultWidth = width;\n tilesInFirstPage = Math.min(count, rows * cols);\n tilesinLastPage = count % (rows * cols);\n isLastPageDifferentFromFirstPage = tilesinLastPage > 0 && count > rows * cols;\n if (isLastPageDifferentFromFirstPage) {\n const cols = Math.min(\n Math.ceil(Math.sqrt((tilesinLastPage * (parentWidth / parentHeight)) / (aspectRatio.width / aspectRatio.height))),\n maxCount,\n );\n let width = parentWidth / cols;\n let height = width / (aspectRatio.width / aspectRatio.height);\n if (height > parentHeight) {\n height = parentHeight;\n width = height / (aspectRatio.height / aspectRatio.width);\n }\n lastPageHeight = height;\n lastPageWidth = width;\n }\n return {\n tilesInFirstPage,\n defaultWidth,\n defaultHeight,\n lastPageWidth,\n lastPageHeight,\n isLastPageDifferentFromFirstPage,\n };\n};\n\nexport const getTileSizesWithPageConstraint = ({\n parentWidth,\n parentHeight,\n count,\n maxCount,\n aspectRatio,\n}: GetTileSizes) => {\n let defaultWidth = 0;\n let defaultHeight = 0;\n let lastPageWidth = 0;\n let lastPageHeight = 0;\n let isLastPageDifferentFromFirstPage = false;\n let tilesInFirstPage = 0;\n let tilesinLastPage = 0;\n const { width: initialWidth, height: initialHeight } = largestRect(\n parentWidth,\n parentHeight,\n Math.min(count, maxCount),\n aspectRatio.width,\n aspectRatio.height,\n );\n defaultWidth = initialWidth;\n defaultHeight = initialHeight;\n tilesInFirstPage = Math.min(count, maxCount);\n tilesinLastPage = count % maxCount;\n isLastPageDifferentFromFirstPage = tilesinLastPage > 0 && count > maxCount;\n if (isLastPageDifferentFromFirstPage) {\n const { width: remWidth, height: remHeight } = largestRect(\n parentWidth,\n parentHeight,\n tilesinLastPage,\n aspectRatio.width,\n aspectRatio.height,\n );\n lastPageWidth = remWidth;\n lastPageHeight = remHeight;\n }\n return {\n tilesInFirstPage,\n defaultWidth,\n defaultHeight,\n lastPageWidth,\n lastPageHeight,\n isLastPageDifferentFromFirstPage,\n };\n};\n\nexport const getTileSizesWithRowConstraint = ({\n parentWidth,\n parentHeight,\n count,\n maxCount,\n aspectRatio,\n}: GetTileSizes) => {\n let defaultWidth = 0;\n let defaultHeight = 0;\n let lastPageWidth = 0;\n let lastPageHeight = 0;\n let isLastPageDifferentFromFirstPage = false;\n let tilesInFirstPage = 0;\n let tilesinLastPage = 0;\n const rows = Math.min(\n Math.ceil(Math.sqrt((count * (aspectRatio.width / aspectRatio.height)) / (parentWidth / parentHeight))),\n maxCount,\n );\n const height = parentHeight / rows;\n const width = height * (aspectRatio.width / aspectRatio.height);\n const cols = Math.floor(parentWidth / width);\n defaultWidth = width;\n defaultHeight = height;\n tilesInFirstPage = Math.min(count, rows * cols);\n tilesinLastPage = count % (rows * cols);\n isLastPageDifferentFromFirstPage = tilesinLastPage > 0 && count > rows * cols;\n if (isLastPageDifferentFromFirstPage) {\n const rows = Math.min(\n Math.ceil(Math.sqrt((tilesinLastPage * (aspectRatio.width / aspectRatio.height)) / (parentWidth / parentHeight))),\n maxCount,\n );\n const height = parentHeight / rows;\n const width = height * (aspectRatio.width / aspectRatio.height);\n lastPageHeight = height;\n lastPageWidth = width;\n }\n return {\n tilesInFirstPage,\n defaultWidth,\n defaultHeight,\n lastPageWidth,\n lastPageHeight,\n isLastPageDifferentFromFirstPage,\n };\n};\n\nexport function calculateLayoutSizes({\n count,\n parentWidth,\n parentHeight,\n maxTileCount,\n maxRowCount,\n maxColCount,\n aspectRatio,\n}: GetTileSizesInList) {\n let defaultWidth = 0;\n let defaultHeight = 0;\n let lastPageWidth = 0;\n let lastPageHeight = 0;\n let isLastPageDifferentFromFirstPage = false;\n let tilesInFirstPage = 0;\n\n if (count === 0) {\n // no tracks to show\n return {\n tilesInFirstPage,\n defaultWidth,\n defaultHeight,\n lastPageWidth,\n lastPageHeight,\n isLastPageDifferentFromFirstPage,\n };\n }\n\n if (maxTileCount) {\n ({\n tilesInFirstPage,\n defaultWidth,\n defaultHeight,\n lastPageWidth,\n lastPageHeight,\n isLastPageDifferentFromFirstPage,\n } = getTileSizesWithPageConstraint({\n parentWidth,\n parentHeight,\n count,\n maxCount: maxTileCount,\n aspectRatio,\n }));\n } else if (maxRowCount) {\n ({\n tilesInFirstPage,\n defaultWidth,\n defaultHeight,\n lastPageWidth,\n lastPageHeight,\n isLastPageDifferentFromFirstPage,\n } = getTileSizesWithRowConstraint({\n parentWidth,\n parentHeight,\n count,\n maxCount: maxRowCount,\n aspectRatio,\n }));\n } else if (maxColCount) {\n ({\n tilesInFirstPage,\n defaultWidth,\n defaultHeight,\n lastPageWidth,\n lastPageHeight,\n isLastPageDifferentFromFirstPage,\n } = getTileSizesWithColConstraint({\n parentWidth,\n parentHeight,\n count,\n maxCount: maxColCount,\n aspectRatio,\n }));\n } else {\n const { width, height } = largestRect(parentWidth, parentHeight, count, aspectRatio.width, aspectRatio.height);\n defaultWidth = width;\n defaultHeight = height;\n tilesInFirstPage = count;\n }\n return {\n tilesInFirstPage,\n defaultWidth,\n defaultHeight,\n lastPageWidth,\n lastPageHeight,\n isLastPageDifferentFromFirstPage,\n };\n}\n\n/**\n * given list of peers and all tracks in the room, get a list of tile objects to show in the UI\n * @param peers\n * @param tracks\n * @param includeScreenShareForPeer - fn will be called to check whether to include screenShare for the peer in returned tiles\n * @param filterNonPublishingPeers - by default a peer with no tracks won't be counted towards final tiles\n */\nexport const getVideoTracksFromPeers = (\n peers: HMSPeer[],\n tracks: Record<HMSTrackID, HMSTrack>,\n includeScreenShareForPeer: (peer: HMSPeer) => boolean,\n filterNonPublishingPeers = true,\n) => {\n if (!peers || !tracks || !includeScreenShareForPeer) {\n return [];\n }\n const peerTiles: TrackWithPeer[] = [];\n for (const peer of peers) {\n const onlyAudioTrack = peer.videoTrack === undefined && peer.audioTrack && tracks[peer.audioTrack];\n if (onlyAudioTrack) {\n peerTiles.push({ peer: peer });\n } else if (peer.videoTrack && tracks[peer.videoTrack]) {\n peerTiles.push({ track: tracks[peer.videoTrack] as HMSVideoTrack, peer: peer });\n } else if (!filterNonPublishingPeers) {\n peerTiles.push({ peer: peer });\n }\n // Handle video tracks in auxiliary tracks as well.\n if (peer.auxiliaryTracks.length > 0) {\n peer.auxiliaryTracks.forEach(trackId => {\n const track = tracks[trackId];\n if (track?.type === 'video' && track?.source === 'regular') {\n peerTiles.push({ track, peer });\n }\n });\n }\n if (includeScreenShareForPeer(peer) && peer.auxiliaryTracks.length > 0) {\n const screenShareTrackID = peer.auxiliaryTracks.find(trackID => {\n const track = tracks[trackID];\n return track?.type === 'video' && track?.source === 'screen';\n });\n // Don't show tile if screenshare only has audio\n if (screenShareTrackID) {\n peerTiles.push({ track: tracks[screenShareTrackID] as HMSScreenVideoTrack, peer: peer });\n }\n }\n }\n return peerTiles;\n};\n"],"names":["chunk","elements","chunkSize","onlyOnePage","reduce","resultArray","tile","index","chunkIndex","Math","floor","push","chunkElements","tilesInFirstPage","isLastPageDifferentFromFirstPage","defaultWidth","defaultHeight","lastPageWidth","lastPageHeight","chunks","map","ch","page","element","isLastPage","length","width","height","__spreadValues","mode","array","modeMap","maxEl","maxCount","i","el","getModeAspectRatio","tracks","filter","track","_a","_b","largestRect","containerWidth","containerHeight","numRects","Error","Number","isInteger","aspectRatio","isNaN","best","area","cols","rows","ceil","width2","height2","getTileSizesWithColConstraint","parentWidth","parentHeight","count","tilesinLastPage","min","sqrt","getTileSizesWithPageConstraint","initialWidth","initialHeight","remWidth","remHeight","getTileSizesWithRowConstraint","calculateLayoutSizes","maxTileCount","maxRowCount","maxColCount","getVideoTracksFromPeers","peers","includeScreenShareForPeer","filterNonPublishingPeers","peerTiles","peer","videoTrack","audioTrack","auxiliaryTracks","forEach","trackId","type","source","screenShareTrackID","find","trackID"],"mappings":"sRAKa,MAAAA,EAAQ,CAAIC,EAAeC,EAAmBC,IACzDF,EAASG,QAAO,CAACC,EAAoBC,EAASC,KACtC,MAAAC,EAAaC,KAAKC,MAAMH,EAAQL,GAClC,OAAAM,EAAa,GAAKL,IAGjBE,EAAYG,KACfH,EAAYG,GAAc,IAG5BH,EAAYG,GAAYG,KAAKL,IANpBD,CAOF,GACN,IAkBQO,EAAgB,EAC3BX,WACAY,mBACAV,cACAW,mCACAC,eACAC,gBACAC,gBACAC,qBAEM,MAAAC,EAAgBnB,EAASC,EAAUY,EAAkBV,GAC3D,OAAOgB,EAAOC,KAAI,CAACC,EAAIC,IACrBD,EAAGD,KAAeG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ACGd,EAAAgD,CAAA,CAEd,MAAA,CACLhD,mBACAE,eACAC,gBACAC,gBACAC,iBACAJ,mCAAA,CAWG,MAAM6D,EAA0B,CACrCC,EACAvC,EACAwC,EACAC,GAA2B,KAE3B,IAAKF,IAAUvC,IAAWwC,EACjB,MAAA,GAET,MAAME,EAA6B,GACnC,IAAA,MAAWC,KAAQJ,EAAO,CAkBxB,QAjB2C,IAApBI,EAAKC,YAA4BD,EAAKE,YAAc7C,EAAO2C,EAAKE,YAErFH,EAAUpE,KAAK,CAAEqE,SACRA,EAAKC,YAAc5C,EAAO2C,EAAKC,YACxCF,EAAUpE,KAAK,CAAE4B,MAAOF,EAAO2C,EAAKC,YAA8BD,SACxDF,GACVC,EAAUpE,KAAK,CAAEqE,SAGfA,EAAKG,gBAAgB1D,OAAS,GAC3BuD,EAAAG,gBAAgBC,SAAmBC,IACtC,MAAM9C,EAAQF,EAAOgD,GACD,WAAT,MAAA9C,OAAA,EAAAA,EAAA+C,OAAsC,aAAlB,MAAA/C,OAAA,EAAAA,EAAOgD,SAC1BR,EAAApE,KAAK,CAAE4B,QAAOyC,QAAA,IAI1BH,EAA0BG,IAASA,EAAKG,gBAAgB1D,OAAS,EAAG,CACtE,MAAM+D,EAAqBR,EAAKG,gBAAgBM,MAAgBC,IAC9D,MAAMnD,EAAQF,EAAOqD,GACrB,MAAuB,WAAT,MAAAnD,OAAA,EAAAA,EAAA+C,OAAsC,YAAlB,MAAA/C,OAAA,EAAAA,EAAOgD,OAAW,IAGlDC,GACFT,EAAUpE,KAAK,CAAE4B,MAAOF,EAAOmD,GAA4CR,QAAA,CAAA,CAI1E,OAAAD,CAAA"}
1
+ {"version":3,"file":"layout.js","sources":["../../src/utils/layout.ts"],"sourcesContent":[null],"names":["chunk","elements","chunkSize","onlyOnePage","reduce","resultArray","tile","index","chunkIndex","Math","floor","push","chunkElements","tilesInFirstPage","isLastPageDifferentFromFirstPage","defaultWidth","defaultHeight","lastPageWidth","lastPageHeight","chunks","map","ch","page","element","isLastPage","length","width","height","Object","assign","mode","array","modeMap","maxEl","maxCount","i","el","getModeAspectRatio","tracks","filter","track","_b","_a","largestRect","containerWidth","containerHeight","numRects","Error","Number","isInteger","aspectRatio","isNaN","best","area","cols","rows","ceil","width2","height2","getTileSizesWithColConstraint","parentWidth","parentHeight","count","tilesinLastPage","min","sqrt","getTileSizesWithPageConstraint","initialWidth","initialHeight","remWidth","remHeight","getTileSizesWithRowConstraint","maxTileCount","maxRowCount","maxColCount","getVideoTracksFromPeers","peers","includeScreenShareForPeer","filterNonPublishingPeers","peerTiles","peer","videoTrack","audioTrack","auxiliaryTracks","forEach","trackId","type","source","screenShareTrackID","find","trackID"],"mappings":"AAKa,MAAAA,EAAQ,CAAIC,EAAeC,EAAmBC,IACzDF,EAASG,QAAO,CAACC,EAAoBC,EAASC,KACtC,MAAAC,EAAaC,KAAKC,MAAMH,EAAQL,GAClC,OAAAM,EAAa,GAAKL,IAGjBE,EAAYG,KACfH,EAAYG,GAAc,IAG5BH,EAAYG,GAAYG,KAAKL,IANpBD,CAOF,GACN,IAkBQO,EAAgB,EAC3BX,WACAY,mBACAV,cACAW,mCACAC,eACAC,gBACAC,gBACAC,qBAEM,MAAAC,EAAgBnB,EAASC,EAAUY,EAAkBV,GAC3D,OAAOgB,EAAOC,KAAI,CAACC,EAAIC,IACrBD,EAAGD,KAAcG,IACT,MAAAC,EAAsBF,IAASH,EAAOM,OAAS,EAC/CC,EAAQZ,GAAoCU,EAAaP,EAAgBF,EACzEY,EAASb,GAAoCU,EAAaN,EAAiBF,EACjF,OAAAY,OAAAC,OAAAD,OAAAC,OAAA,CAAA,EAAYN,GAAO,CAAEI,SAAQD,SAAA,KAAA,EAS7B,SAAAI,EAAeC,GACf,GAAiB,IAAjBA,EAAMN,OACD,OAAA,KAET,MAAMO,EAAkC,CAAA,EACxC,IAAIC,EAAQF,EAAM,GACdG,EAAW,EACf,IAAA,IAASC,EAAI,EAAGA,EAAIJ,EAAMN,OAAQU,IAAK,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,EAAKG,gBAAgB1D,OAAS,GAC3BuD,EAAAG,gBAAgBC,SAAkBC,IACrC,MAAM7C,EAAQF,EAAO+C,GACD,WAAhB7C,eAAAA,EAAO8C,OAAsC,aAAlB9C,aAAK,EAALA,EAAO+C,SAC1BR,EAAApE,KAAK,CAAE6B,QAAOwC,QAAA,IAI1BH,EAA0BG,IAASA,EAAKG,gBAAgB1D,OAAS,EAAG,CACtE,MAAM+D,EAAqBR,EAAKG,gBAAgBM,MAAeC,IAC7D,MAAMlD,EAAQF,EAAOoD,GACrB,MAAuB,WAAhBlD,eAAAA,EAAO8C,OAAsC,YAAlB9C,aAAK,EAALA,EAAO+C,OAAW,IAGlDC,GACFT,EAAUpE,KAAK,CAAE6B,MAAOF,EAAOkD,GAA4CR,QAAA,CAAA,CAI1E,OAAAD,CAAA"}
@@ -0,0 +1,17 @@
1
+ export declare enum HMSLogLevel {
2
+ VERBOSE = 0,
3
+ DEBUG = 1,
4
+ INFO = 2,
5
+ WARN = 3,
6
+ ERROR = 4,
7
+ NONE = 5
8
+ }
9
+ export default class HMSLogger {
10
+ static level: HMSLogLevel;
11
+ static v(tag: string, ...data: any[]): void;
12
+ static d(tag: string, ...data: any[]): void;
13
+ static i(tag: string, ...data: any[]): void;
14
+ static w(tag: string, ...data: any[]): void;
15
+ static e(tag: string, ...data: any[]): void;
16
+ private static log;
17
+ }
@@ -1,2 +1,2 @@
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(s,...e){this.log(0,s,...e)}static d(s,...e){this.log(1,s,...e)}static i(s,...e){this.log(2,s,...e)}static w(s,...e){this.log(3,s,...e)}static e(s,...e){this.log(4,s,...e)}static log(s,e,...o){if(!(this.level.valueOf()>s.valueOf()))switch(s){case 0:console.log("HMSui-components: ",e,...o);break;case 1:console.debug("HMSui-components: ",e,...o);break;case 2:console.info("HMSui-components: ",e,...o);break;case 3:console.warn("HMSui-components: ",e,...o);break;case 4:console.error("HMSui-components: ",e,...o)}}}o.level=0;export{s as HMSLogLevel,o as default};
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};
2
2
  //# sourceMappingURL=logger.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"logger.js","sources":["../../src/utils/logger.ts"],"sourcesContent":["export enum HMSLogLevel {\n VERBOSE,\n DEBUG,\n INFO,\n WARN,\n ERROR,\n NONE,\n}\n\nexport default class HMSLogger {\n static level: HMSLogLevel = HMSLogLevel.VERBOSE;\n\n static v(tag: string, ...data: any[]) {\n this.log(HMSLogLevel.VERBOSE, tag, ...data);\n }\n\n static d(tag: string, ...data: any[]) {\n this.log(HMSLogLevel.DEBUG, tag, ...data);\n }\n\n static i(tag: string, ...data: any[]) {\n this.log(HMSLogLevel.INFO, tag, ...data);\n }\n\n static w(tag: string, ...data: any[]) {\n this.log(HMSLogLevel.WARN, tag, ...data);\n }\n\n static e(tag: string, ...data: any[]) {\n this.log(HMSLogLevel.ERROR, tag, ...data);\n }\n\n // eslint-disable-next-line complexity\n private static log(level: HMSLogLevel, tag: string, ...data: any[]) {\n if (this.level.valueOf() > level.valueOf()) {\n return;\n }\n\n switch (level) {\n case HMSLogLevel.VERBOSE: {\n console.log('HMSui-components: ', tag, ...data);\n break;\n }\n case HMSLogLevel.DEBUG: {\n console.debug('HMSui-components: ', tag, ...data);\n break;\n }\n case HMSLogLevel.INFO: {\n console.info('HMSui-components: ', tag, ...data);\n break;\n }\n case HMSLogLevel.WARN: {\n console.warn('HMSui-components: ', tag, ...data);\n break;\n }\n case HMSLogLevel.ERROR: {\n console.error('HMSui-components: ', tag, ...data);\n break;\n }\n }\n }\n}\n"],"names":["HMSLogLevel","HMSLogLevel2","HMSLogger","static","tag","data","this","log","level","valueOf","console","debug","info","warn","error"],"mappings":"AAAY,IAAAA,EAAAC,KAAAD,IAAAA,EAAA,CAAA,IACVC,EAAA,QAAA,GAAA,UACAA,EAAAA,EAAA,MAAA,GAAA,QACAA,EAAAA,EAAA,KAAA,GAAA,OACAA,EAAAA,EAAA,KAAA,GAAA,OACAA,EAAAA,EAAA,MAAA,GAAA,QACAA,EAAAA,EAAA,KAAA,GAAA,OAGF,MAA+BC,EAGtBC,SAAEC,KAAgBC,GAClBC,KAAAC,IAAI,EAAqBH,KAAQC,EAAA,CAGjCF,SAAEC,KAAgBC,GAClBC,KAAAC,IAAI,EAAmBH,KAAQC,EAAA,CAG/BF,SAAEC,KAAgBC,GAClBC,KAAAC,IAAI,EAAkBH,KAAQC,EAAA,CAG9BF,SAAEC,KAAgBC,GAClBC,KAAAC,IAAI,EAAkBH,KAAQC,EAAA,CAG9BF,SAAEC,KAAgBC,GAClBC,KAAAC,IAAI,EAAmBH,KAAQC,EAAA,CAIvBF,WAAIK,EAAoBJ,KAAgBC,GACrD,KAAIC,KAAKE,MAAMC,UAAYD,EAAMC,WAIzB,OAAAD,GAAA,KACD,EACKE,QAAAH,IAAI,qBAAsBH,KAAQC,GAC1C,MAAA,KAEG,EACKK,QAAAC,MAAM,qBAAsBP,KAAQC,GAC5C,MAAA,KAEG,EACKK,QAAAE,KAAK,qBAAsBR,KAAQC,GAC3C,MAAA,KAEG,EACKK,QAAAG,KAAK,qBAAsBT,KAAQC,GAC3C,MAAA,KAEG,EACKK,QAAAI,MAAM,qBAAsBV,KAAQC,GAC5C,EAhDRH,EACSM,MAAqB"}
1
+ {"version":3,"file":"logger.js","sources":["../../src/utils/logger.ts"],"sourcesContent":[null],"names":["HMSLogLevel","HMSLogLevel2","HMSLogger","static","tag","data","this","log","VERBOSE","DEBUG","INFO","WARN","ERROR","level","valueOf","console","debug","info","warn","error"],"mappings":"AAAY,IAAAA,EAAAC,KAAAD,IAOXA,EAAA,CAAA,IANCC,UAAA,GAAA,UACAA,EAAAA,QAAA,GAAA,QACAA,EAAAA,OAAA,GAAA,OACAA,EAAAA,OAAA,GAAA,OACAA,EAAAA,QAAA,GAAA,QACAA,EAAAA,OAAA,GAAA,OAGF,MAA8BC,EAGrBC,SAAEC,KAAgBC,GACvBC,KAAKC,IAAIP,EAAYQ,QAASJ,KAAQC,EAAA,CAGjCF,SAAEC,KAAgBC,GACvBC,KAAKC,IAAIP,EAAYS,MAAOL,KAAQC,EAAA,CAG/BF,SAAEC,KAAgBC,GACvBC,KAAKC,IAAIP,EAAYU,KAAMN,KAAQC,EAAA,CAG9BF,SAAEC,KAAgBC,GACvBC,KAAKC,IAAIP,EAAYW,KAAMP,KAAQC,EAAA,CAG9BF,SAAEC,KAAgBC,GACvBC,KAAKC,IAAIP,EAAYY,MAAOR,KAAQC,EAAA,CAIvBF,WAAIU,EAAoBT,KAAgBC,GACrD,KAAIC,KAAKO,MAAMC,UAAYD,EAAMC,WAIzB,OAAAD,GAAA,KACDb,EAAYQ,QACPO,QAAAR,IAAI,qBAAsBH,KAAQC,GAC1C,MAAA,KAEGL,EAAYS,MACPM,QAAAC,MAAM,qBAAsBZ,KAAQC,GAC5C,MAAA,KAEGL,EAAYU,KACPK,QAAAE,KAAK,qBAAsBb,KAAQC,GAC3C,MAAA,KAEGL,EAAYW,KACPI,QAAAG,KAAK,qBAAsBd,KAAQC,GAC3C,MAAA,KAEGL,EAAYY,MACPG,QAAAI,MAAM,qBAAsBf,KAAQC,GAC5C,EA/CCH,EAAAW,MAAqBb,EAAYQ"}
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "main": "dist/index.cjs.js",
5
5
  "module": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
7
- "version": "0.4.3",
7
+ "version": "0.4.5-alpha.0",
8
8
  "author": "100ms",
9
9
  "license": "MIT",
10
10
  "files": [
@@ -23,7 +23,6 @@
23
23
  },
24
24
  "devDependencies": {
25
25
  "@rollup/plugin-commonjs": "^21.0.3",
26
- "@rollup/plugin-json": "^5.0.0",
27
26
  "@rollup/plugin-node-resolve": "^13.1.3",
28
27
  "@rollup/plugin-typescript": "^8.3.1",
29
28
  "@types/react": "^18.0.8",
@@ -36,10 +35,10 @@
36
35
  "react": ">=16.8 <19.0.0"
37
36
  },
38
37
  "dependencies": {
39
- "@100mslive/hms-video-store": "0.6.3",
38
+ "@100mslive/hms-video-store": "0.6.5-alpha.0",
40
39
  "react-intersection-observer": "^8.33.1",
41
40
  "react-resize-detector": "^7.0.0",
42
41
  "zustand": "^3.6.2"
43
42
  },
44
- "gitHead": "4d8386faab9c4c833efbd01c1e53dd918cb41b9f"
43
+ "gitHead": "ed1886a2625499f5c7b5ae9191eaadf0f6c97663"
45
44
  }
@@ -13,7 +13,6 @@ import {
13
13
  import create from 'zustand';
14
14
  import { HMSContextProviderProps, makeHMSStoreHook, hooksErrorMessage, makeHMSStatsStoreHook } from './store';
15
15
  import { isBrowser } from '../utils/isBrowser';
16
- import { version as sdkVersion } from '../../package.json';
17
16
 
18
17
  export interface HMSRoomProviderProps {
19
18
  actions?: HMSActions;
@@ -103,7 +102,7 @@ export const HMSRoomProvider: React.FC<PropsWithChildren<HMSRoomProviderProps>>
103
102
  providerProps.actions.setFrameworkInfo({
104
103
  type: 'react-web',
105
104
  version: React.version,
106
- sdkVersion,
105
+ sdkVersion: require('../../package.json').version,
107
106
  });
108
107
  }
109
108
 
@@ -1 +0,0 @@
1
- {"version":3,"file":"shallow.js","sources":["../../../../node_modules/zustand/esm/shallow.js"],"sourcesContent":["function shallow(objA, objB) {\n if (Object.is(objA, objB)) {\n return true;\n }\n if (typeof objA !== \"object\" || objA === null || typeof objB !== \"object\" || objB === null) {\n return false;\n }\n const keysA = Object.keys(objA);\n if (keysA.length !== Object.keys(objB).length) {\n return false;\n }\n for (let i = 0; i < keysA.length; i++) {\n if (!Object.prototype.hasOwnProperty.call(objB, keysA[i]) || !Object.is(objA[keysA[i]], objB[keysA[i]])) {\n return false;\n }\n }\n return true;\n}\n\nexport { shallow as default };\n"],"names":["shallow","objA","objB","Object","is","keysA","keys","length","i","prototype","hasOwnProperty","call"],"mappings":"AAAA,SAASA,EAAQC,EAAMC,GACrB,GAAIC,OAAOC,GAAGH,EAAMC,GAClB,OAAO,EAET,GAAoB,iBAATD,GAA8B,OAATA,GAAiC,iBAATC,GAA8B,OAATA,EAC3E,OAAO,EAET,MAAMG,EAAQF,OAAOG,KAAKL,GAC1B,GAAII,EAAME,SAAWJ,OAAOG,KAAKJ,GAAMK,OACrC,OAAO,EAET,IAAK,IAAIC,EAAI,EAAGA,EAAIH,EAAME,OAAQC,IAChC,IAAKL,OAAOM,UAAUC,eAAeC,KAAKT,EAAMG,EAAMG,MAAQL,OAAOC,GAAGH,EAAKI,EAAMG,IAAKN,EAAKG,EAAMG,KACjG,OAAO,EAGX,OAAO,CACT"}
@@ -1,2 +0,0 @@
1
- var r="0.4.3";export{r as version};
2
- //# sourceMappingURL=package.json.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"package.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}