@100mslive/roomkit-react 0.2.8-alpha.10 → 0.2.8-alpha.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -62,7 +62,7 @@ import {
62
62
  theme,
63
63
  useBorderAudioLevel,
64
64
  useTheme
65
- } from "./chunk-R2JJJQR3.js";
65
+ } from "./chunk-YFJQ4B6X.js";
66
66
  export {
67
67
  Accordion,
68
68
  AudioLevel,
@@ -5935,7 +5935,7 @@
5935
5935
  "format": "esm"
5936
5936
  },
5937
5937
  "src/Prebuilt/components/Footer/RoleOptions.tsx": {
5938
- "bytes": 7053,
5938
+ "bytes": 7089,
5939
5939
  "imports": [
5940
5940
  {
5941
5941
  "path": "react",
@@ -10846,7 +10846,7 @@
10846
10846
  "format": "esm"
10847
10847
  },
10848
10848
  "src/Prebuilt/components/HMSVideo/HMSVideo.jsx": {
10849
- "bytes": 1301,
10849
+ "bytes": 1333,
10850
10850
  "imports": [
10851
10851
  {
10852
10852
  "path": "react",
@@ -11315,7 +11315,7 @@
11315
11315
  "format": "esm"
11316
11316
  },
11317
11317
  "src/Prebuilt/layouts/HLSView.jsx": {
11318
- "bytes": 25579,
11318
+ "bytes": 26172,
11319
11319
  "imports": [
11320
11320
  {
11321
11321
  "path": "react",
@@ -13602,7 +13602,7 @@
13602
13602
  "imports": [],
13603
13603
  "exports": [],
13604
13604
  "inputs": {},
13605
- "bytes": 3259526
13605
+ "bytes": 3260721
13606
13606
  },
13607
13607
  "dist/index.cjs.js": {
13608
13608
  "imports": [
@@ -16506,7 +16506,7 @@
16506
16506
  "entryPoint": "src/index.ts",
16507
16507
  "inputs": {
16508
16508
  "<define:process.env>": {
16509
- "bytesInOutput": 18240
16509
+ "bytesInOutput": 18242
16510
16510
  },
16511
16511
  "src/Theme/base.config.ts": {
16512
16512
  "bytesInOutput": 6104
@@ -17079,7 +17079,7 @@
17079
17079
  "bytesInOutput": 1694
17080
17080
  },
17081
17081
  "src/Prebuilt/components/Footer/RoleOptions.tsx": {
17082
- "bytesInOutput": 8483
17082
+ "bytesInOutput": 8531
17083
17083
  },
17084
17084
  "src/Prebuilt/components/Footer/RoleAccordion.tsx": {
17085
17085
  "bytesInOutput": 5338
@@ -17370,7 +17370,7 @@
17370
17370
  "bytesInOutput": 656
17371
17371
  },
17372
17372
  "src/Prebuilt/components/HMSVideo/HMSVideo.jsx": {
17373
- "bytesInOutput": 1860
17373
+ "bytesInOutput": 1903
17374
17374
  },
17375
17375
  "src/Prebuilt/components/HMSVideo/PlayerContext.tsx": {
17376
17376
  "bytesInOutput": 489
@@ -17412,7 +17412,7 @@
17412
17412
  "bytesInOutput": 2852
17413
17413
  },
17414
17414
  "src/Prebuilt/layouts/HLSView.jsx": {
17415
- "bytesInOutput": 29703
17415
+ "bytesInOutput": 30579
17416
17416
  },
17417
17417
  "src/Prebuilt/layouts/VideoStreamingSection.tsx": {
17418
17418
  "bytesInOutput": 5017
@@ -17550,7 +17550,7 @@
17550
17550
  "bytesInOutput": 2980
17551
17551
  }
17552
17552
  },
17553
- "bytes": 1547557
17553
+ "bytes": 1548526
17554
17554
  }
17555
17555
  }
17556
17556
  }
@@ -5935,7 +5935,7 @@
5935
5935
  "format": "esm"
5936
5936
  },
5937
5937
  "src/Prebuilt/components/Footer/RoleOptions.tsx": {
5938
- "bytes": 7053,
5938
+ "bytes": 7089,
5939
5939
  "imports": [
5940
5940
  {
5941
5941
  "path": "react",
@@ -10846,7 +10846,7 @@
10846
10846
  "format": "esm"
10847
10847
  },
10848
10848
  "src/Prebuilt/components/HMSVideo/HMSVideo.jsx": {
10849
- "bytes": 1301,
10849
+ "bytes": 1333,
10850
10850
  "imports": [
10851
10851
  {
10852
10852
  "path": "react",
@@ -11315,7 +11315,7 @@
11315
11315
  "format": "esm"
11316
11316
  },
11317
11317
  "src/Prebuilt/layouts/HLSView.jsx": {
11318
- "bytes": 25579,
11318
+ "bytes": 26172,
11319
11319
  "imports": [
11320
11320
  {
11321
11321
  "path": "react",
@@ -13607,7 +13607,7 @@
13607
13607
  "dist/index.js": {
13608
13608
  "imports": [
13609
13609
  {
13610
- "path": "dist/chunk-R2JJJQR3.js",
13610
+ "path": "dist/chunk-YFJQ4B6X.js",
13611
13611
  "kind": "import-statement"
13612
13612
  }
13613
13613
  ],
@@ -13680,16 +13680,16 @@
13680
13680
  "inputs": {},
13681
13681
  "bytes": 1822
13682
13682
  },
13683
- "dist/HLSView-FBEGJ3L7.js.map": {
13683
+ "dist/HLSView-EDROW5VZ.js.map": {
13684
13684
  "imports": [],
13685
13685
  "exports": [],
13686
13686
  "inputs": {},
13687
- "bytes": 87085
13687
+ "bytes": 88190
13688
13688
  },
13689
- "dist/HLSView-FBEGJ3L7.js": {
13689
+ "dist/HLSView-EDROW5VZ.js": {
13690
13690
  "imports": [
13691
13691
  {
13692
- "path": "dist/chunk-R2JJJQR3.js",
13692
+ "path": "dist/chunk-YFJQ4B6X.js",
13693
13693
  "kind": "import-statement"
13694
13694
  },
13695
13695
  {
@@ -13849,7 +13849,7 @@
13849
13849
  "entryPoint": "src/Prebuilt/layouts/HLSView.jsx",
13850
13850
  "inputs": {
13851
13851
  "src/Prebuilt/layouts/HLSView.jsx": {
13852
- "bytesInOutput": 24391
13852
+ "bytesInOutput": 25088
13853
13853
  },
13854
13854
  "src/Prebuilt/components/HlsStatsOverlay.jsx": {
13855
13855
  "bytesInOutput": 3521
@@ -13861,7 +13861,7 @@
13861
13861
  "bytesInOutput": 416
13862
13862
  },
13863
13863
  "src/Prebuilt/components/HMSVideo/HMSVideo.jsx": {
13864
- "bytesInOutput": 1425
13864
+ "bytesInOutput": 1464
13865
13865
  },
13866
13866
  "src/Prebuilt/components/HMSVideo/PlayPauseButton.tsx": {
13867
13867
  "bytesInOutput": 851
@@ -13900,15 +13900,15 @@
13900
13900
  "bytesInOutput": 2067
13901
13901
  }
13902
13902
  },
13903
- "bytes": 53355
13903
+ "bytes": 54098
13904
13904
  },
13905
- "dist/chunk-R2JJJQR3.js.map": {
13905
+ "dist/chunk-YFJQ4B6X.js.map": {
13906
13906
  "imports": [],
13907
13907
  "exports": [],
13908
13908
  "inputs": {},
13909
- "bytes": 3167900
13909
+ "bytes": 3167979
13910
13910
  },
13911
- "dist/chunk-R2JJJQR3.js": {
13911
+ "dist/chunk-YFJQ4B6X.js": {
13912
13912
  "imports": [
13913
13913
  {
13914
13914
  "path": "react",
@@ -16276,7 +16276,7 @@
16276
16276
  "external": true
16277
16277
  },
16278
16278
  {
16279
- "path": "dist/HLSView-FBEGJ3L7.js",
16279
+ "path": "dist/HLSView-EDROW5VZ.js",
16280
16280
  "kind": "dynamic-import"
16281
16281
  },
16282
16282
  {
@@ -16691,6 +16691,8 @@
16691
16691
  "Link",
16692
16692
  "Loading",
16693
16693
  "Logo",
16694
+ "POLL_STATE",
16695
+ "POLL_VIEWS",
16694
16696
  "PasswordInput",
16695
16697
  "Popover",
16696
16698
  "Progress",
@@ -16741,7 +16743,6 @@
16741
16743
  "useBorderAudioLevel",
16742
16744
  "useIsLandscape",
16743
16745
  "useIsSidepaneTypeOpen",
16744
- "usePollViewToggle",
16745
16746
  "useRoomLayoutConferencingScreen",
16746
16747
  "useRoomLayoutHeader",
16747
16748
  "useSidepaneToggle",
@@ -16749,7 +16750,7 @@
16749
16750
  ],
16750
16751
  "inputs": {
16751
16752
  "<define:process.env>": {
16752
- "bytesInOutput": 18240
16753
+ "bytesInOutput": 18242
16753
16754
  },
16754
16755
  "../../node_modules/lodash/lodash.js": {
16755
16756
  "bytesInOutput": 224291
@@ -17304,7 +17305,7 @@
17304
17305
  "bytesInOutput": 4229
17305
17306
  },
17306
17307
  "src/Prebuilt/components/Footer/RoleOptions.tsx": {
17307
- "bytesInOutput": 7290
17308
+ "bytesInOutput": 7326
17308
17309
  },
17309
17310
  "src/Prebuilt/components/Footer/PollsToggle.tsx": {
17310
17311
  "bytesInOutput": 1073
@@ -17703,7 +17704,7 @@
17703
17704
  "bytesInOutput": 651
17704
17705
  }
17705
17706
  },
17706
- "bytes": 1297975
17707
+ "bytes": 1298020
17707
17708
  }
17708
17709
  }
17709
17710
  }
package/package.json CHANGED
@@ -10,7 +10,7 @@
10
10
  "prebuilt",
11
11
  "roomkit"
12
12
  ],
13
- "version": "0.2.8-alpha.10",
13
+ "version": "0.2.8-alpha.11",
14
14
  "author": "100ms",
15
15
  "license": "MIT",
16
16
  "repository": {
@@ -82,11 +82,11 @@
82
82
  "react": ">=17.0.2 <19.0.0"
83
83
  },
84
84
  "dependencies": {
85
- "@100mslive/hls-player": "0.2.8-alpha.10",
85
+ "@100mslive/hls-player": "0.2.8-alpha.11",
86
86
  "@100mslive/hms-noise-cancellation": "0.0.0-alpha.1",
87
- "@100mslive/hms-virtual-background": "1.12.8-alpha.10",
88
- "@100mslive/react-icons": "0.9.8-alpha.10",
89
- "@100mslive/react-sdk": "0.9.8-alpha.10",
87
+ "@100mslive/hms-virtual-background": "1.12.8-alpha.11",
88
+ "@100mslive/react-icons": "0.9.8-alpha.11",
89
+ "@100mslive/react-sdk": "0.9.8-alpha.11",
90
90
  "@100mslive/types-prebuilt": "0.12.7",
91
91
  "@emoji-mart/data": "^1.0.6",
92
92
  "@emoji-mart/react": "^1.0.1",
@@ -122,5 +122,5 @@
122
122
  "uuid": "^8.3.2",
123
123
  "worker-timers": "^7.0.40"
124
124
  },
125
- "gitHead": "741a12014783f22c7302df3cbd3b01f2e343c16f"
125
+ "gitHead": "c02dfafa58072004d8d90ee521240e46452b564c"
126
126
  }
@@ -80,9 +80,12 @@ export const RoleOptions = ({ roleName, peerList }: { roleName: string; peerList
80
80
  const { on_stage_role, off_stage_roles = [] } = (elements as DefaultConferencingScreen_Elements)?.on_stage_exp || {};
81
81
  const canRemoveRoleFromStage = permissions?.changeRole && roleName === on_stage_role;
82
82
  const role = useHMSStore(selectRoleByRoleName(roleName));
83
+ const tracks = useHMSStore(selectTracksMap);
84
+ if (!role) {
85
+ return null;
86
+ }
83
87
  const canPublishAudio = role.publishParams.allowed.includes('audio');
84
88
  const canPublishVideo = role.publishParams.allowed.includes('video');
85
- const tracks = useHMSStore(selectTracksMap);
86
89
 
87
90
  let isVideoOnForSomePeers = false;
88
91
  let isAudioOnForSomePeers = false;
@@ -46,6 +46,7 @@ export const HMSVideo = forwardRef(({ children, ...props }, videoRef) => {
46
46
  }}
47
47
  ref={videoRef}
48
48
  playsInline
49
+ disablePictureInPicture
49
50
  />
50
51
  {children}
51
52
  </Flex>
@@ -33,20 +33,32 @@ import { Loading } from '../../Loading';
33
33
  import { Text } from '../../Text';
34
34
  import { config, theme, useTheme } from '../../Theme';
35
35
  import { Tooltip } from '../../Tooltip';
36
- import { usePollViewToggle, useSidepaneToggle } from '../components/AppData/useSidepane';
36
+ import { useSidepaneToggle } from '../components/AppData/useSidepane';
37
37
  import { useRoomLayoutConferencingScreen } from '../provider/roomLayoutProvider/hooks/useRoomLayoutScreen';
38
38
  import { useIsLandscape } from '../common/hooks';
39
- import { APP_DATA, EMOJI_REACTION_TYPE, SIDE_PANE_OPTIONS } from '../common/constants';
39
+ import { APP_DATA, EMOJI_REACTION_TYPE, POLL_STATE, POLL_VIEWS, SIDE_PANE_OPTIONS } from '../common/constants';
40
40
 
41
41
  let hlsPlayer;
42
42
  const toastMap = {};
43
43
 
44
+ const ToggleChat = () => {
45
+ const { elements } = useRoomLayoutConferencingScreen();
46
+ const sidepane = useHMSStore(selectAppData(APP_DATA.sidePane));
47
+ const toggleChat = useSidepaneToggle(SIDE_PANE_OPTIONS.CHAT);
48
+ const showChat = !!elements?.chat;
49
+ const isMobile = useMedia(config.media.md);
50
+ useEffect(() => {
51
+ if (!sidepane && isMobile && showChat) {
52
+ toggleChat();
53
+ }
54
+ }, [sidepane, isMobile, toggleChat, showChat]);
55
+ return null;
56
+ };
44
57
  const HLSView = () => {
45
58
  const videoRef = useRef(null);
46
59
  const hlsViewRef = useRef();
47
60
  const hlsState = useHMSStore(selectHLSState);
48
61
  const enablHlsStats = useHMSStore(selectAppData(APP_DATA.hlsStats));
49
- const { elements, screenType } = useRoomLayoutConferencingScreen();
50
62
  const notification = useHMSNotifications(HMSNotificationTypes.POLL_STOPPED);
51
63
  const hmsActions = useHMSActions();
52
64
  const { themeType } = useTheme();
@@ -63,17 +75,13 @@ const HLSView = () => {
63
75
  const [isPaused, setIsPaused] = useState(false);
64
76
  const [show, toggle] = useToggle(false);
65
77
  const lastHlsUrl = usePrevious(hlsUrl);
66
- const togglePollView = usePollViewToggle();
67
78
  const vanillaStore = useHMSVanillaStore();
68
79
  const [controlsVisible, setControlsVisible] = useState(true);
69
80
  const [isUserSelectedAuto, setIsUserSelectedAuto] = useState(true);
70
81
  const [qualityDropDownOpen, setQualityDropDownOpen] = useState(false);
71
82
  const controlsRef = useRef(null);
72
83
  const controlsTimerRef = useRef();
73
- const sidepane = useHMSStore(selectAppData(APP_DATA.sidePane));
74
- const toggleChat = useSidepaneToggle(SIDE_PANE_OPTIONS.CHAT);
75
84
  const [seekProgress, setSeekProgress] = useState(false);
76
- const showChat = !!elements?.chat;
77
85
  const isFullScreenSupported = screenfull.isEnabled;
78
86
 
79
87
  const isMobile = useMedia(config.media.md);
@@ -84,13 +92,6 @@ const HLSView = () => {
84
92
  });
85
93
  const [showLoader, setShowLoader] = useState(false);
86
94
 
87
- const isMwebHLSStream = screenType === 'hls_live_streaming' && isMobile;
88
-
89
- useEffect(() => {
90
- if (sidepane === '' && isMwebHLSStream && showChat) {
91
- toggleChat();
92
- }
93
- }, [sidepane, isMwebHLSStream, toggleChat, showChat]);
94
95
  // FIXME: move this logic to player controller in next release
95
96
  useEffect(() => {
96
97
  /**
@@ -176,7 +177,12 @@ const HLSView = () => {
176
177
  title: `${pollStartedBy} started a ${poll.type}: ${poll.title}`,
177
178
  action: (
178
179
  <Button
179
- onClick={() => togglePollView(pollId)}
180
+ onClick={() => {
181
+ hmsActions.setAppData({
182
+ [POLL_STATE.pollInView]: pollId,
183
+ [POLL_STATE.view]: POLL_VIEWS.VOTE,
184
+ });
185
+ }}
180
186
  variant="standard"
181
187
  css={{
182
188
  backgroundColor: '$surface_bright',
@@ -246,7 +252,7 @@ const HLSView = () => {
246
252
  hlsPlayer.reset();
247
253
  };
248
254
  }
249
- }, [hlsUrl, togglePollView, vanillaStore]);
255
+ }, [hlsUrl, vanillaStore, hmsActions]);
250
256
 
251
257
  /**
252
258
  * initialize and subscribe to hlsState
@@ -352,28 +358,36 @@ const HLSView = () => {
352
358
 
353
359
  if (!hlsUrl || streamEnded) {
354
360
  return (
355
- <Flex
356
- key="hls-viewer"
357
- id={`hls-viewer-${themeType}`}
358
- ref={hlsViewRef}
359
- direction={isMobile || isLandscape ? 'column' : 'row'}
360
- justify="center"
361
- css={{
362
- flex: isLandscape ? '2 1 0' : '1 1 0',
363
- }}
364
- >
365
- <Flex align="center" justify="center" direction="column" css={{ size: '100%', px: '$10' }}>
366
- <Flex css={{ c: '$on_surface_high', r: '$round', bg: '$surface_default', p: '$2' }}>
367
- {streamEnded ? <ColoredHandIcon height={56} width={56} /> : <GoLiveIcon height={56} width={56} />}
361
+ <>
362
+ <ToggleChat />
363
+ {hlsViewRef.current && (isMobile || isLandscape) && (
364
+ <Box css={{ position: 'fixed', left: '$4', top: '$4', zIndex: 11 }}>
365
+ <LeaveRoom screenType="hls_live_streaming" container={hlsViewRef.current} />
366
+ </Box>
367
+ )}
368
+ <Flex
369
+ key="hls-viewer"
370
+ id={`hls-viewer-${themeType}`}
371
+ ref={hlsViewRef}
372
+ direction={isMobile || isLandscape ? 'column' : 'row'}
373
+ justify="center"
374
+ css={{
375
+ flex: isLandscape ? '2 1 0' : '1 1 0',
376
+ }}
377
+ >
378
+ <Flex align="center" justify="center" direction="column" css={{ size: '100%', px: '$10' }}>
379
+ <Flex css={{ c: '$on_surface_high', r: '$round', bg: '$surface_default', p: '$2' }}>
380
+ {streamEnded ? <ColoredHandIcon height={56} width={56} /> : <GoLiveIcon height={56} width={56} />}
381
+ </Flex>
382
+ <Text variant="h5" css={{ c: '$on_surface_high', mt: '$10', mb: 0, textAlign: 'center' }}>
383
+ {streamEnded ? 'Stream has ended' : 'Stream yet to start'}
384
+ </Text>
385
+ <Text variant="md" css={{ textAlign: 'center', mt: '$4', c: '$on_surface_medium' }}>
386
+ {streamEnded ? 'Have a nice day!' : 'Sit back and relax'}
387
+ </Text>
368
388
  </Flex>
369
- <Text variant="h5" css={{ c: '$on_surface_high', mt: '$10', mb: 0, textAlign: 'center' }}>
370
- {streamEnded ? 'Stream has ended' : 'Stream yet to start'}
371
- </Text>
372
- <Text variant="md" css={{ textAlign: 'center', mt: '$4', c: '$on_surface_medium' }}>
373
- {streamEnded ? 'Have a nice day!' : 'Sit back and relax'}
374
- </Text>
375
389
  </Flex>
376
- </Flex>
390
+ </>
377
391
  );
378
392
  }
379
393
  return (
@@ -385,11 +399,16 @@ const HLSView = () => {
385
399
  justify="center"
386
400
  css={{
387
401
  flex: isLandscape ? '2 1 0' : '1 1 0',
402
+ '&:fullscreen': {
403
+ '& video': {
404
+ height: 'unset !important',
405
+ },
406
+ },
388
407
  }}
389
408
  >
390
409
  {hlsViewRef.current && (isMobile || isLandscape) && (
391
410
  <Box css={{ position: 'fixed', left: '$4', top: '$4', zIndex: 11 }}>
392
- <LeaveRoom screenType={screenType} container={hlsViewRef.current} />
411
+ <LeaveRoom screenType="hls_live_streaming" container={hlsViewRef.current} />
393
412
  </Box>
394
413
  )}
395
414
 
@@ -638,7 +657,7 @@ const HLSView = () => {
638
657
  </HMSVideoPlayer.Root>
639
658
  </Flex>
640
659
  </HMSPlayerContext.Provider>
641
-
660
+ <ToggleChat />
642
661
  {isMobile && !isFullScreen && <HLSViewTitle />}
643
662
  </Flex>
644
663
  );