From 797326fd1ef1374a96c19617528794e8a15ce06e Mon Sep 17 00:00:00 2001 From: Ravi theja Date: Tue, 5 Mar 2024 12:30:39 +0530 Subject: [PATCH 01/27] revert: polling device change for mweb --- .../src/audio-sink-manager/AudioSinkManager.ts | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/packages/hms-video-store/src/audio-sink-manager/AudioSinkManager.ts b/packages/hms-video-store/src/audio-sink-manager/AudioSinkManager.ts index 83bc2085f5..647ffb7fd3 100644 --- a/packages/hms-video-store/src/audio-sink-manager/AudioSinkManager.ts +++ b/packages/hms-video-store/src/audio-sink-manager/AudioSinkManager.ts @@ -47,7 +47,6 @@ export class AudioSinkManager { this.eventBus.audioTrackRemoved.subscribe(this.handleTrackRemove); this.eventBus.audioTrackUpdate.subscribe(this.handleTrackUpdate); this.eventBus.deviceChange.subscribe(this.handleAudioDeviceChange); - this.startPollingForDevices(); } setListener(listener?: HMSUpdateListener) { @@ -267,19 +266,6 @@ export class AudioSinkManager { } }; - private startPollingForDevices = () => { - // device change supported, no polling needed - if ('ondevicechange' in navigator.mediaDevices) { - return; - } - this.timer = setInterval(() => { - (async () => { - await this.deviceManager.init(true, false); - await this.autoSelectAudioOutput(); - })(); - }, 5000); - }; - /** * Mweb is not able to play via call channel by default, this is to switch from media channel to call channel */ @@ -308,10 +294,6 @@ export class AudioSinkManager { const localAudioTrack = this.store.getLocalPeer()?.audioTrack; if (localAudioTrack && earpiece) { const externalDeviceID = bluetoothDevice?.deviceId || wired?.deviceId || speakerPhone?.deviceId; - // already selected appropriate device - if (localAudioTrack.settings.deviceId === externalDeviceID) { - return; - } await localAudioTrack.setSettings({ deviceId: earpiece?.deviceId }); await localAudioTrack.setSettings({ deviceId: externalDeviceID, From eaed700cd6f04214d3aa7a691c3f1bd603e1ce0e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 5 Mar 2024 14:48:31 +0530 Subject: [PATCH 02/27] build: update versions for release --- examples/prebuilt-react-integration/package.json | 2 +- packages/hls-player/package.json | 4 ++-- packages/hls-stats/package.json | 2 +- packages/hms-video-store/package.json | 2 +- packages/hms-virtual-background/package.json | 6 +++--- packages/react-icons/package.json | 2 +- packages/react-sdk/package.json | 4 ++-- packages/roomkit-react/package.json | 10 +++++----- packages/roomkit-web/package.json | 4 ++-- 9 files changed, 18 insertions(+), 18 deletions(-) diff --git a/examples/prebuilt-react-integration/package.json b/examples/prebuilt-react-integration/package.json index 2971f27f84..75bb20f0d3 100644 --- a/examples/prebuilt-react-integration/package.json +++ b/examples/prebuilt-react-integration/package.json @@ -10,7 +10,7 @@ "preview": "vite preview" }, "dependencies": { - "@100mslive/roomkit-react": "0.2.7", + "@100mslive/roomkit-react": "0.3.0", "react": "^18.2.0", "react-dom": "^18.2.0" }, diff --git a/packages/hls-player/package.json b/packages/hls-player/package.json index 5262f0be19..2dde4ae91c 100644 --- a/packages/hls-player/package.json +++ b/packages/hls-player/package.json @@ -1,6 +1,6 @@ { "name": "@100mslive/hls-player", - "version": "0.2.7", + "version": "0.3.0", "description": "HLS client library which uses HTML5 Video element and Media Source Extension for playback", "main": "dist/index.cjs.js", "module": "dist/index.js", @@ -36,7 +36,7 @@ "author": "100ms", "license": "MIT", "dependencies": { - "@100mslive/hls-stats": "0.3.7", + "@100mslive/hls-stats": "0.4.0", "eventemitter2": "^6.4.9", "hls.js": "1.4.12" } diff --git a/packages/hls-stats/package.json b/packages/hls-stats/package.json index 08888a103f..1ee33d0b28 100644 --- a/packages/hls-stats/package.json +++ b/packages/hls-stats/package.json @@ -1,6 +1,6 @@ { "name": "@100mslive/hls-stats", - "version": "0.3.7", + "version": "0.4.0", "description": "A simple library that provides stats for your hls stream", "main": "dist/index.cjs.js", "module": "dist/index.js", diff --git a/packages/hms-video-store/package.json b/packages/hms-video-store/package.json index ed9100be96..c1b0d41263 100644 --- a/packages/hms-video-store/package.json +++ b/packages/hms-video-store/package.json @@ -1,5 +1,5 @@ { - "version": "0.11.7", + "version": "0.12.0", "license": "MIT", "repository": { "type": "git", diff --git a/packages/hms-virtual-background/package.json b/packages/hms-virtual-background/package.json index 023b2eee1d..4320686d79 100755 --- a/packages/hms-virtual-background/package.json +++ b/packages/hms-virtual-background/package.json @@ -1,5 +1,5 @@ { - "version": "1.12.7", + "version": "1.13.0", "license": "MIT", "name": "@100mslive/hms-virtual-background", "author": "100ms", @@ -32,10 +32,10 @@ "format": "prettier --write src/**/*.ts" }, "peerDependencies": { - "@100mslive/hms-video-store": "0.11.7" + "@100mslive/hms-video-store": "0.12.0" }, "devDependencies": { - "@100mslive/hms-video-store": "0.11.7" + "@100mslive/hms-video-store": "0.12.0" }, "dependencies": { "@mediapipe/selfie_segmentation": "^0.1.1632777926", diff --git a/packages/react-icons/package.json b/packages/react-icons/package.json index 1c0ae04953..5a3f260f0c 100644 --- a/packages/react-icons/package.json +++ b/packages/react-icons/package.json @@ -4,7 +4,7 @@ "main": "dist/index.cjs.js", "module": "dist/index.js", "typings": "dist/index.d.ts", - "version": "0.9.7", + "version": "0.10.0", "author": "100ms", "license": "MIT", "repository": { diff --git a/packages/react-sdk/package.json b/packages/react-sdk/package.json index 3654af9307..c66f7fe009 100644 --- a/packages/react-sdk/package.json +++ b/packages/react-sdk/package.json @@ -4,7 +4,7 @@ "main": "dist/index.cjs.js", "module": "dist/index.js", "typings": "dist/index.d.ts", - "version": "0.9.7", + "version": "0.10.0", "author": "100ms", "license": "MIT", "repository": { @@ -48,7 +48,7 @@ "react": ">=16.8 <19.0.0" }, "dependencies": { - "@100mslive/hms-video-store": "0.11.7", + "@100mslive/hms-video-store": "0.12.0", "react-resize-detector": "^7.0.0", "zustand": "^3.6.2" } diff --git a/packages/roomkit-react/package.json b/packages/roomkit-react/package.json index 371f3df135..4b42128539 100644 --- a/packages/roomkit-react/package.json +++ b/packages/roomkit-react/package.json @@ -10,7 +10,7 @@ "prebuilt", "roomkit" ], - "version": "0.2.7", + "version": "0.3.0", "author": "100ms", "license": "MIT", "repository": { @@ -82,11 +82,11 @@ "react": ">=17.0.2 <19.0.0" }, "dependencies": { - "@100mslive/hls-player": "0.2.7", + "@100mslive/hls-player": "0.3.0", "@100mslive/hms-noise-cancellation": "0.0.0-alpha.1", - "@100mslive/hms-virtual-background": "1.12.7", - "@100mslive/react-icons": "0.9.7", - "@100mslive/react-sdk": "0.9.7", + "@100mslive/hms-virtual-background": "1.13.0", + "@100mslive/react-icons": "0.10.0", + "@100mslive/react-sdk": "0.10.0", "@100mslive/types-prebuilt": "0.12.7", "@emoji-mart/data": "^1.0.6", "@emoji-mart/react": "^1.0.1", diff --git a/packages/roomkit-web/package.json b/packages/roomkit-web/package.json index 1e1f741553..6f66c69d8f 100644 --- a/packages/roomkit-web/package.json +++ b/packages/roomkit-web/package.json @@ -1,6 +1,6 @@ { "name": "@100mslive/roomkit-web", - "version": "0.1.7", + "version": "0.2.0", "description": "A web component implementation of 100ms Prebuilt component", "keywords": [ "web-components", @@ -33,7 +33,7 @@ "build": "rm -rf dist && node ../../scripts/build-webapp" }, "dependencies": { - "@100mslive/roomkit-react": "0.2.7", + "@100mslive/roomkit-react": "0.3.0", "@r2wc/react-to-web-component": "2.0.2" } } From 4ccc77e356363deda260bc9e6edc4306aefbd3f8 Mon Sep 17 00:00:00 2001 From: "Eswar Prasad Clinton. A" <64120992+eswarclynn@users.noreply.github.com> Date: Tue, 5 Mar 2024 14:56:41 +0530 Subject: [PATCH 03/27] fix: frozen stats --- .../src/analytics/stats/BaseStatsAnalytics.ts | 4 ++++ .../src/analytics/stats/PublishStatsAnalytics.ts | 7 +++++++ .../src/analytics/stats/SubscribeStatsAnalytics.ts | 7 +++++++ 3 files changed, 18 insertions(+) diff --git a/packages/hms-video-store/src/analytics/stats/BaseStatsAnalytics.ts b/packages/hms-video-store/src/analytics/stats/BaseStatsAnalytics.ts index 6a0dc26cc3..179815a397 100644 --- a/packages/hms-video-store/src/analytics/stats/BaseStatsAnalytics.ts +++ b/packages/hms-video-store/src/analytics/stats/BaseStatsAnalytics.ts @@ -113,6 +113,10 @@ export abstract class RunningTrackAnalytics { } createSample() { + if (this.tempStats.length === 0) { + return; + } + this.samples.push(this.collateSample()); this.tempStats.length = 0; } diff --git a/packages/hms-video-store/src/analytics/stats/PublishStatsAnalytics.ts b/packages/hms-video-store/src/analytics/stats/PublishStatsAnalytics.ts index bd3e6c4356..8f6df60b07 100644 --- a/packages/hms-video-store/src/analytics/stats/PublishStatsAnalytics.ts +++ b/packages/hms-video-store/src/analytics/stats/PublishStatsAnalytics.ts @@ -84,6 +84,13 @@ export class PublishStatsAnalytics extends BaseStatsAnalytics { }); }); + // delete track analytics if track is not present in store and no samples are present + this.trackAnalytics.forEach(trackAnalytic => { + if (!this.store.hasTrack(trackAnalytic.track) && !(trackAnalytic.samples.length > 0)) { + this.trackAnalytics.delete(trackAnalytic.track_id); + } + }); + if (shouldCreateSample) { this.trackAnalytics.forEach(trackAnalytic => { trackAnalytic.createSample(); diff --git a/packages/hms-video-store/src/analytics/stats/SubscribeStatsAnalytics.ts b/packages/hms-video-store/src/analytics/stats/SubscribeStatsAnalytics.ts index b96ae023c7..5c44720388 100644 --- a/packages/hms-video-store/src/analytics/stats/SubscribeStatsAnalytics.ts +++ b/packages/hms-video-store/src/analytics/stats/SubscribeStatsAnalytics.ts @@ -76,6 +76,13 @@ export class SubscribeStatsAnalytics extends BaseStatsAnalytics { } }); + // delete track analytics if track is not present in store and no samples are present + this.trackAnalytics.forEach(trackAnalytic => { + if (!this.store.hasTrack(trackAnalytic.track) && !(trackAnalytic.samples.length > 0)) { + this.trackAnalytics.delete(trackAnalytic.track_id); + } + }); + if (shouldCreateSample) { this.trackAnalytics.forEach(trackAnalytic => { trackAnalytic.createSample(); From 43ac361dc5ca569d323435b9df10ea5b048fbc99 Mon Sep 17 00:00:00 2001 From: Kaustubh Kumar Date: Wed, 6 Mar 2024 13:35:31 +0530 Subject: [PATCH 04/27] fix: trim input for polls --- .../Prebuilt/components/Polls/CreatePollQuiz/PollsQuizMenu.tsx | 2 +- .../Prebuilt/components/Polls/CreateQuestions/QuestionForm.tsx | 2 +- .../Prebuilt/components/Polls/common/OptionInputWithDelete.tsx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/roomkit-react/src/Prebuilt/components/Polls/CreatePollQuiz/PollsQuizMenu.tsx b/packages/roomkit-react/src/Prebuilt/components/Polls/CreatePollQuiz/PollsQuizMenu.tsx index ab9a1b9166..7250ea303b 100644 --- a/packages/roomkit-react/src/Prebuilt/components/Polls/CreatePollQuiz/PollsQuizMenu.tsx +++ b/packages/roomkit-react/src/Prebuilt/components/Polls/CreatePollQuiz/PollsQuizMenu.tsx @@ -140,7 +140,7 @@ const AddMenu = () => { type="text" placeholder="Enter a name to continue" value={title} - onChange={event => setTitle(event.target.value)} + onChange={event => setTitle(event.target.value.trimStart())} css={{ backgroundColor: '$surface_bright', border: '1px solid $border_default', diff --git a/packages/roomkit-react/src/Prebuilt/components/Polls/CreateQuestions/QuestionForm.tsx b/packages/roomkit-react/src/Prebuilt/components/Polls/CreateQuestions/QuestionForm.tsx index badfab2247..d305716d5b 100644 --- a/packages/roomkit-react/src/Prebuilt/components/Polls/CreateQuestions/QuestionForm.tsx +++ b/packages/roomkit-react/src/Prebuilt/components/Polls/CreateQuestions/QuestionForm.tsx @@ -159,7 +159,7 @@ export const QuestionForm = ({ maxHeight: '$32', }} value={text} - onChange={event => setText(event.target.value)} + onChange={event => setText(event.target.value.trimStart())} /> {text?.length || 0}/1024 diff --git a/packages/roomkit-react/src/Prebuilt/components/Polls/common/OptionInputWithDelete.tsx b/packages/roomkit-react/src/Prebuilt/components/Polls/common/OptionInputWithDelete.tsx index 451edf13cd..5f4f4b9bbf 100644 --- a/packages/roomkit-react/src/Prebuilt/components/Polls/common/OptionInputWithDelete.tsx +++ b/packages/roomkit-react/src/Prebuilt/components/Polls/common/OptionInputWithDelete.tsx @@ -27,7 +27,7 @@ export const OptionInputWithDelete = ({ }} value={option?.text || ''} key={index} - onChange={event => handleOptionTextChange(index, event.target.value)} + onChange={event => handleOptionTextChange(index, event.target.value.trimStart())} /> removeOption(index)} css={{ bg: 'transparent', border: 'none' }}> From 7a9cfa2bb6c23d9d80d8fe3472df9b6d33f863af Mon Sep 17 00:00:00 2001 From: Kaustubh Kumar Date: Wed, 6 Mar 2024 13:36:19 +0530 Subject: [PATCH 05/27] fix: color tokens for pinned messages --- .../src/Prebuilt/components/Chat/PinnedMessage.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/roomkit-react/src/Prebuilt/components/Chat/PinnedMessage.tsx b/packages/roomkit-react/src/Prebuilt/components/Chat/PinnedMessage.tsx index 7537b1602f..ee9ea2d3f9 100644 --- a/packages/roomkit-react/src/Prebuilt/components/Chat/PinnedMessage.tsx +++ b/packages/roomkit-react/src/Prebuilt/components/Chat/PinnedMessage.tsx @@ -71,13 +71,14 @@ export const PinnedMessage = () => { { > From 74a4d1fc68dc58ecfa481567a0ec505dc7530394 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 6 Mar 2024 13:36:44 +0530 Subject: [PATCH 06/27] build(deps): bump axios from 1.4.0 to 1.6.7 --- yarn.lock | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/yarn.lock b/yarn.lock index 7d88a16922..df9c962f3c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6682,11 +6682,11 @@ axe-core@^4.2.0, axe-core@^4.6.2: integrity sha512-zIURGIS1E1Q4pcrMjp+nnEh+16G56eG/MUllJH8yEvw7asDo7Ac9uhC9KIH5jzpITueEZolfYglnCGIuSBz39g== axios@^1.0.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/axios/-/axios-1.4.0.tgz#38a7bf1224cd308de271146038b551d725f0be1f" - integrity sha512-S4XCWMEmzvo64T9GfvQDOXgYRDJ/wsSZc7Jvdgx5u1sd0JwsuPLqb3SYmusag+edF6ziyMensPVqLTSc1PiSEA== + version "1.6.7" + resolved "https://registry.yarnpkg.com/axios/-/axios-1.6.7.tgz#7b48c2e27c96f9c68a2f8f31e2ab19f59b06b0a7" + integrity sha512-/hDJGff6/c7u0hDkvkGxR/oy6CbCs8ziCsC7SqmhjfozqiJGc8Z11wrv9z9lYfY4K8l+H9TpjcMDX0xOZmx+RA== dependencies: - follow-redirects "^1.15.0" + follow-redirects "^1.15.4" form-data "^4.0.0" proxy-from-env "^1.1.0" @@ -9763,10 +9763,10 @@ flow-parser@0.*: resolved "https://registry.yarnpkg.com/flow-parser/-/flow-parser-0.214.0.tgz#455efc841ec015c62f6dec022cf6c61480f231a2" integrity sha512-RW1Dh6BuT14DA7+gtNRKzgzvG3GTPdrceHCi4ddZ9VFGQ9HtO5L8wzxMGsor7XtInIrbWZZCSak0oxnBF7tApw== -follow-redirects@^1.15.0: - version "1.15.2" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.2.tgz#b460864144ba63f2681096f274c4e57026da2c13" - integrity sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA== +follow-redirects@^1.15.4: + version "1.15.5" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.5.tgz#54d4d6d062c0fa7d9d17feb008461550e3ba8020" + integrity sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw== for-each@^0.3.3: version "0.3.3" From a5de3955147d40fa3fe53d6ff20aa79e172d2224 Mon Sep 17 00:00:00 2001 From: Ravi theja Date: Wed, 6 Mar 2024 13:39:04 +0530 Subject: [PATCH 07/27] feat: add test logs to debug screenshare --- .../src/Prebuilt/components/VideoLayouts/ProminenceLayout.tsx | 1 + .../src/Prebuilt/components/VideoLayouts/ScreenshareLayout.tsx | 2 ++ packages/roomkit-react/src/Prebuilt/layouts/SidePane.tsx | 1 + 3 files changed, 4 insertions(+) diff --git a/packages/roomkit-react/src/Prebuilt/components/VideoLayouts/ProminenceLayout.tsx b/packages/roomkit-react/src/Prebuilt/components/VideoLayouts/ProminenceLayout.tsx index 6ae278df87..7e372076b9 100644 --- a/packages/roomkit-react/src/Prebuilt/components/VideoLayouts/ProminenceLayout.tsx +++ b/packages/roomkit-react/src/Prebuilt/components/VideoLayouts/ProminenceLayout.tsx @@ -36,6 +36,7 @@ const SecondarySection = ({ hasSidebar, }: React.PropsWithChildren<{ tiles: TrackWithPeerAndDimensions[]; edgeToEdge?: boolean; hasSidebar?: boolean }>) => { const tileLayoutProps = useVideoTileContext(); + console.log('secondary section', { tilesLength: tiles?.length }); if (!tiles?.length) { return null; } diff --git a/packages/roomkit-react/src/Prebuilt/components/VideoLayouts/ScreenshareLayout.tsx b/packages/roomkit-react/src/Prebuilt/components/VideoLayouts/ScreenshareLayout.tsx index c2fd7a8bf6..0fb034bafc 100644 --- a/packages/roomkit-react/src/Prebuilt/components/VideoLayouts/ScreenshareLayout.tsx +++ b/packages/roomkit-react/src/Prebuilt/components/VideoLayouts/ScreenshareLayout.tsx @@ -55,6 +55,8 @@ export const ScreenshareLayout = ({ peers, onPageChange, onPageSize, edgeToEdge }; }, [activeSharePeer?.id, isMobile, setActiveScreenSharePeer]); + console.log({ activeSharePeer, secondaryPeers }); + return ( diff --git a/packages/roomkit-react/src/Prebuilt/layouts/SidePane.tsx b/packages/roomkit-react/src/Prebuilt/layouts/SidePane.tsx index 3225467f98..5b4066b683 100644 --- a/packages/roomkit-react/src/Prebuilt/layouts/SidePane.tsx +++ b/packages/roomkit-react/src/Prebuilt/layouts/SidePane.tsx @@ -193,6 +193,7 @@ const SidePane = ({ }); if (!trackId && !SidepaneComponent) { + console.log('sidepane not rendered', { trackId, SidepaneComponent }); return null; } From aa448dc3530c849ac63200ed13c9b07cb2537f63 Mon Sep 17 00:00:00 2001 From: Amar Bathwal <110378139+amar-1995@users.noreply.github.com> Date: Wed, 6 Mar 2024 16:14:32 +0530 Subject: [PATCH 08/27] fix: added keyboard interaction --- .../src/Prebuilt/common/hooks.ts | 28 ++++++++++++++++++- .../src/Prebuilt/layouts/HLSView.jsx | 11 +++++++- 2 files changed, 37 insertions(+), 2 deletions(-) diff --git a/packages/roomkit-react/src/Prebuilt/common/hooks.ts b/packages/roomkit-react/src/Prebuilt/common/hooks.ts index 5f2690cb1a..80575ca970 100644 --- a/packages/roomkit-react/src/Prebuilt/common/hooks.ts +++ b/packages/roomkit-react/src/Prebuilt/common/hooks.ts @@ -1,5 +1,6 @@ -import { useEffect, useRef, useState } from 'react'; +import { useCallback, useEffect, useRef, useState } from 'react'; import { useMedia } from 'react-use'; +import { HMSHLSPlayer } from '@100mslive/hls-player'; import { JoinForm_JoinBtnType } from '@100mslive/types-prebuilt/elements/join_form'; import { parsedUserAgent, @@ -121,3 +122,28 @@ export const useMobileHLSStream = () => { const { screenType } = useRoomLayoutConferencingScreen(); return isMobile && screenType === 'hls_live_streaming'; }; + +export const useKeyboardHandler = (isPaused: boolean, hlsPlayer: HMSHLSPlayer) => { + const handleKeyEvent = useCallback( + async (event: KeyboardEvent) => { + switch (event.key) { + case ' ': + if (isPaused) { + await hlsPlayer?.play(); + } else { + hlsPlayer?.pause(); + } + break; + case 'ArrowRight': + hlsPlayer?.seekTo(hlsPlayer?.getVideoElement().currentTime + 10); + break; + case 'ArrowLeft': + hlsPlayer?.seekTo(hlsPlayer?.getVideoElement().currentTime - 10); + break; + } + }, + [hlsPlayer, isPaused], + ); + + return handleKeyEvent; +}; diff --git a/packages/roomkit-react/src/Prebuilt/layouts/HLSView.jsx b/packages/roomkit-react/src/Prebuilt/layouts/HLSView.jsx index e1327df85c..e754cf4958 100644 --- a/packages/roomkit-react/src/Prebuilt/layouts/HLSView.jsx +++ b/packages/roomkit-react/src/Prebuilt/layouts/HLSView.jsx @@ -36,7 +36,7 @@ import { config, theme, useTheme } from '../../Theme'; import { Tooltip } from '../../Tooltip'; import { useSidepaneToggle } from '../components/AppData/useSidepane'; import { useRoomLayoutConferencingScreen } from '../provider/roomLayoutProvider/hooks/useRoomLayoutScreen'; -import { useIsLandscape } from '../common/hooks'; +import { useIsLandscape, useKeyboardHandler } from '../common/hooks'; import { APP_DATA, EMOJI_REACTION_TYPE, POLL_STATE, POLL_VIEWS, SIDE_PANE_OPTIONS } from '../common/constants'; let hlsPlayer; @@ -367,6 +367,8 @@ const HLSView = () => { [controlsVisible, isLandscape, isMobile, qualityDropDownOpen, seekProgress], ); + const keyHandler = useKeyboardHandler(isPaused, hlsPlayer); + if (!hlsUrl || streamEnded) { return ( <> @@ -437,7 +439,14 @@ const HLSView = () => { '@md': { height: 'auto', }, + outline: 'none', + }} + onKeyDown={async event => { + if (hlsState?.variants[0]?.playlist_type === HLSPlaylistType.DVR) { + await keyHandler(event); + } }} + tabIndex="0" > {!(isMobile || isLandscape) && ( From 0ba32b04d54228eb79d3f7cf21c1b1778fb2ef62 Mon Sep 17 00:00:00 2001 From: Ravi theja Date: Wed, 6 Mar 2024 16:15:50 +0530 Subject: [PATCH 09/27] fix: sidebar peers not shown in recording --- .../src/Prebuilt/components/VideoLayouts/ProminenceLayout.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/roomkit-react/src/Prebuilt/components/VideoLayouts/ProminenceLayout.tsx b/packages/roomkit-react/src/Prebuilt/components/VideoLayouts/ProminenceLayout.tsx index 7e372076b9..3c96afa9a4 100644 --- a/packages/roomkit-react/src/Prebuilt/components/VideoLayouts/ProminenceLayout.tsx +++ b/packages/roomkit-react/src/Prebuilt/components/VideoLayouts/ProminenceLayout.tsx @@ -45,6 +45,8 @@ const SecondarySection = ({ gridTemplateColumns: '1fr', gridTemplateRows: `repeat(${tiles.length}, minmax(0, 1fr))`, maxHeight: '100%', + width: 240, + height: '100%', } : { gridTemplateRows: React.Children.count(children) > 0 ? '136px auto' : '154px', From ccb00042e202fb064045c6651b88a08125667e3d Mon Sep 17 00:00:00 2001 From: Ravi theja Date: Wed, 6 Mar 2024 17:34:57 +0530 Subject: [PATCH 10/27] fix: screen peers in sidepane --- .../src/Prebuilt/components/VideoLayouts/ProminenceLayout.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/roomkit-react/src/Prebuilt/components/VideoLayouts/ProminenceLayout.tsx b/packages/roomkit-react/src/Prebuilt/components/VideoLayouts/ProminenceLayout.tsx index 3c96afa9a4..b0d053c565 100644 --- a/packages/roomkit-react/src/Prebuilt/components/VideoLayouts/ProminenceLayout.tsx +++ b/packages/roomkit-react/src/Prebuilt/components/VideoLayouts/ProminenceLayout.tsx @@ -72,7 +72,6 @@ const SecondarySection = ({ rootCSS={{ padding: 0, maxWidth: 240, - h: '100%', aspectRatio: 16 / 9, '@md': { aspectRatio: 1 }, }} From 711d3fdcde3bef957175cbac3edec12e8ee34de2 Mon Sep 17 00:00:00 2001 From: Ravi theja Date: Wed, 6 Mar 2024 21:39:01 +0530 Subject: [PATCH 11/27] fix: screenshare sidebar --- .../src/Prebuilt/components/VideoLayouts/ProminenceLayout.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/roomkit-react/src/Prebuilt/components/VideoLayouts/ProminenceLayout.tsx b/packages/roomkit-react/src/Prebuilt/components/VideoLayouts/ProminenceLayout.tsx index b0d053c565..fdc10e4c77 100644 --- a/packages/roomkit-react/src/Prebuilt/components/VideoLayouts/ProminenceLayout.tsx +++ b/packages/roomkit-react/src/Prebuilt/components/VideoLayouts/ProminenceLayout.tsx @@ -46,7 +46,6 @@ const SecondarySection = ({ gridTemplateRows: `repeat(${tiles.length}, minmax(0, 1fr))`, maxHeight: '100%', width: 240, - height: '100%', } : { gridTemplateRows: React.Children.count(children) > 0 ? '136px auto' : '154px', From 3e415026b68857f268c14d24c38b6bbf2059ab9f Mon Sep 17 00:00:00 2001 From: Ravi theja Date: Thu, 7 Mar 2024 10:48:04 +0530 Subject: [PATCH 12/27] revert: height for video tiles in sidebar --- .../src/Prebuilt/components/VideoLayouts/ProminenceLayout.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/roomkit-react/src/Prebuilt/components/VideoLayouts/ProminenceLayout.tsx b/packages/roomkit-react/src/Prebuilt/components/VideoLayouts/ProminenceLayout.tsx index fdc10e4c77..04ed4de230 100644 --- a/packages/roomkit-react/src/Prebuilt/components/VideoLayouts/ProminenceLayout.tsx +++ b/packages/roomkit-react/src/Prebuilt/components/VideoLayouts/ProminenceLayout.tsx @@ -72,6 +72,7 @@ const SecondarySection = ({ padding: 0, maxWidth: 240, aspectRatio: 16 / 9, + h: '100%', '@md': { aspectRatio: 1 }, }} objectFit="contain" From c68522d957946ea473a355a75ed6031971fbdf50 Mon Sep 17 00:00:00 2001 From: raviteja83 Date: Thu, 7 Mar 2024 10:57:02 +0530 Subject: [PATCH 13/27] feat: patch release --- .../src/Prebuilt/components/VideoLayouts/ProminenceLayout.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/roomkit-react/src/Prebuilt/components/VideoLayouts/ProminenceLayout.tsx b/packages/roomkit-react/src/Prebuilt/components/VideoLayouts/ProminenceLayout.tsx index 6ae278df87..655f5103a7 100644 --- a/packages/roomkit-react/src/Prebuilt/components/VideoLayouts/ProminenceLayout.tsx +++ b/packages/roomkit-react/src/Prebuilt/components/VideoLayouts/ProminenceLayout.tsx @@ -44,6 +44,7 @@ const SecondarySection = ({ gridTemplateColumns: '1fr', gridTemplateRows: `repeat(${tiles.length}, minmax(0, 1fr))`, maxHeight: '100%', + width: 240, } : { gridTemplateRows: React.Children.count(children) > 0 ? '136px auto' : '154px', From d0dca194522ebfe9aae7c933377dd45a040357aa Mon Sep 17 00:00:00 2001 From: raviteja83 Date: Thu, 7 Mar 2024 11:01:26 +0530 Subject: [PATCH 14/27] build: update versions for release --- examples/prebuilt-react-integration/package.json | 2 +- packages/hls-player/package.json | 4 ++-- packages/hls-stats/package.json | 2 +- packages/hms-video-store/package.json | 2 +- packages/hms-virtual-background/package.json | 6 +++--- packages/react-icons/package.json | 2 +- packages/react-sdk/package.json | 4 ++-- packages/roomkit-react/package.json | 10 +++++----- packages/roomkit-web/package.json | 4 ++-- 9 files changed, 18 insertions(+), 18 deletions(-) diff --git a/examples/prebuilt-react-integration/package.json b/examples/prebuilt-react-integration/package.json index 75bb20f0d3..f44041a923 100644 --- a/examples/prebuilt-react-integration/package.json +++ b/examples/prebuilt-react-integration/package.json @@ -10,7 +10,7 @@ "preview": "vite preview" }, "dependencies": { - "@100mslive/roomkit-react": "0.3.0", + "@100mslive/roomkit-react": "0.3.1-alpha.5", "react": "^18.2.0", "react-dom": "^18.2.0" }, diff --git a/packages/hls-player/package.json b/packages/hls-player/package.json index 2dde4ae91c..ec0d206217 100644 --- a/packages/hls-player/package.json +++ b/packages/hls-player/package.json @@ -1,6 +1,6 @@ { "name": "@100mslive/hls-player", - "version": "0.3.0", + "version": "0.3.1-alpha.5", "description": "HLS client library which uses HTML5 Video element and Media Source Extension for playback", "main": "dist/index.cjs.js", "module": "dist/index.js", @@ -36,7 +36,7 @@ "author": "100ms", "license": "MIT", "dependencies": { - "@100mslive/hls-stats": "0.4.0", + "@100mslive/hls-stats": "0.4.1-alpha.5", "eventemitter2": "^6.4.9", "hls.js": "1.4.12" } diff --git a/packages/hls-stats/package.json b/packages/hls-stats/package.json index 1ee33d0b28..1493719da7 100644 --- a/packages/hls-stats/package.json +++ b/packages/hls-stats/package.json @@ -1,6 +1,6 @@ { "name": "@100mslive/hls-stats", - "version": "0.4.0", + "version": "0.4.1-alpha.5", "description": "A simple library that provides stats for your hls stream", "main": "dist/index.cjs.js", "module": "dist/index.js", diff --git a/packages/hms-video-store/package.json b/packages/hms-video-store/package.json index c1b0d41263..34601f68c1 100644 --- a/packages/hms-video-store/package.json +++ b/packages/hms-video-store/package.json @@ -1,5 +1,5 @@ { - "version": "0.12.0", + "version": "0.12.1-alpha.5", "license": "MIT", "repository": { "type": "git", diff --git a/packages/hms-virtual-background/package.json b/packages/hms-virtual-background/package.json index 4320686d79..653a508cc8 100755 --- a/packages/hms-virtual-background/package.json +++ b/packages/hms-virtual-background/package.json @@ -1,5 +1,5 @@ { - "version": "1.13.0", + "version": "1.13.1-alpha.5", "license": "MIT", "name": "@100mslive/hms-virtual-background", "author": "100ms", @@ -32,10 +32,10 @@ "format": "prettier --write src/**/*.ts" }, "peerDependencies": { - "@100mslive/hms-video-store": "0.12.0" + "@100mslive/hms-video-store": "0.12.1-alpha.5" }, "devDependencies": { - "@100mslive/hms-video-store": "0.12.0" + "@100mslive/hms-video-store": "0.12.1-alpha.5" }, "dependencies": { "@mediapipe/selfie_segmentation": "^0.1.1632777926", diff --git a/packages/react-icons/package.json b/packages/react-icons/package.json index 5a3f260f0c..6557596997 100644 --- a/packages/react-icons/package.json +++ b/packages/react-icons/package.json @@ -4,7 +4,7 @@ "main": "dist/index.cjs.js", "module": "dist/index.js", "typings": "dist/index.d.ts", - "version": "0.10.0", + "version": "0.10.1-alpha.5", "author": "100ms", "license": "MIT", "repository": { diff --git a/packages/react-sdk/package.json b/packages/react-sdk/package.json index c66f7fe009..2d4e005302 100644 --- a/packages/react-sdk/package.json +++ b/packages/react-sdk/package.json @@ -4,7 +4,7 @@ "main": "dist/index.cjs.js", "module": "dist/index.js", "typings": "dist/index.d.ts", - "version": "0.10.0", + "version": "0.10.1-alpha.5", "author": "100ms", "license": "MIT", "repository": { @@ -48,7 +48,7 @@ "react": ">=16.8 <19.0.0" }, "dependencies": { - "@100mslive/hms-video-store": "0.12.0", + "@100mslive/hms-video-store": "0.12.1-alpha.5", "react-resize-detector": "^7.0.0", "zustand": "^3.6.2" } diff --git a/packages/roomkit-react/package.json b/packages/roomkit-react/package.json index 4b42128539..becb0e0066 100644 --- a/packages/roomkit-react/package.json +++ b/packages/roomkit-react/package.json @@ -10,7 +10,7 @@ "prebuilt", "roomkit" ], - "version": "0.3.0", + "version": "0.3.1-alpha.5", "author": "100ms", "license": "MIT", "repository": { @@ -82,11 +82,11 @@ "react": ">=17.0.2 <19.0.0" }, "dependencies": { - "@100mslive/hls-player": "0.3.0", + "@100mslive/hls-player": "0.3.1-alpha.5", "@100mslive/hms-noise-cancellation": "0.0.0-alpha.1", - "@100mslive/hms-virtual-background": "1.13.0", - "@100mslive/react-icons": "0.10.0", - "@100mslive/react-sdk": "0.10.0", + "@100mslive/hms-virtual-background": "1.13.1-alpha.5", + "@100mslive/react-icons": "0.10.1-alpha.5", + "@100mslive/react-sdk": "0.10.1-alpha.5", "@100mslive/types-prebuilt": "0.12.7", "@emoji-mart/data": "^1.0.6", "@emoji-mart/react": "^1.0.1", diff --git a/packages/roomkit-web/package.json b/packages/roomkit-web/package.json index 6f66c69d8f..c208ba3809 100644 --- a/packages/roomkit-web/package.json +++ b/packages/roomkit-web/package.json @@ -1,6 +1,6 @@ { "name": "@100mslive/roomkit-web", - "version": "0.2.0", + "version": "0.2.1-alpha.5", "description": "A web component implementation of 100ms Prebuilt component", "keywords": [ "web-components", @@ -33,7 +33,7 @@ "build": "rm -rf dist && node ../../scripts/build-webapp" }, "dependencies": { - "@100mslive/roomkit-react": "0.3.0", + "@100mslive/roomkit-react": "0.3.1-alpha.5", "@r2wc/react-to-web-component": "2.0.2" } } From 190087f587ca1fec25453976b938b733ebce8d45 Mon Sep 17 00:00:00 2001 From: raviteja83 Date: Thu, 7 Mar 2024 11:19:28 +0530 Subject: [PATCH 15/27] fix: remove height of the tile for sidebar --- .../src/Prebuilt/components/VideoLayouts/ProminenceLayout.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/roomkit-react/src/Prebuilt/components/VideoLayouts/ProminenceLayout.tsx b/packages/roomkit-react/src/Prebuilt/components/VideoLayouts/ProminenceLayout.tsx index 655f5103a7..9ed895d2d8 100644 --- a/packages/roomkit-react/src/Prebuilt/components/VideoLayouts/ProminenceLayout.tsx +++ b/packages/roomkit-react/src/Prebuilt/components/VideoLayouts/ProminenceLayout.tsx @@ -70,7 +70,7 @@ const SecondarySection = ({ rootCSS={{ padding: 0, maxWidth: 240, - h: '100%', + h: hasSidebar ? undefined : '100%', aspectRatio: 16 / 9, '@md': { aspectRatio: 1 }, }} From 26d1da9289ab9502147a574572ff5b903dbf6e4a Mon Sep 17 00:00:00 2001 From: raviteja83 Date: Thu, 7 Mar 2024 11:21:05 +0530 Subject: [PATCH 16/27] build: update versions for release --- examples/prebuilt-react-integration/package.json | 2 +- packages/hls-player/package.json | 4 ++-- packages/hls-stats/package.json | 2 +- packages/hms-video-store/package.json | 2 +- packages/hms-virtual-background/package.json | 6 +++--- packages/react-icons/package.json | 2 +- packages/react-sdk/package.json | 4 ++-- packages/roomkit-react/package.json | 10 +++++----- packages/roomkit-web/package.json | 4 ++-- 9 files changed, 18 insertions(+), 18 deletions(-) diff --git a/examples/prebuilt-react-integration/package.json b/examples/prebuilt-react-integration/package.json index f44041a923..022c0b186a 100644 --- a/examples/prebuilt-react-integration/package.json +++ b/examples/prebuilt-react-integration/package.json @@ -10,7 +10,7 @@ "preview": "vite preview" }, "dependencies": { - "@100mslive/roomkit-react": "0.3.1-alpha.5", + "@100mslive/roomkit-react": "0.3.1-alpha.6", "react": "^18.2.0", "react-dom": "^18.2.0" }, diff --git a/packages/hls-player/package.json b/packages/hls-player/package.json index ec0d206217..f24f0efb91 100644 --- a/packages/hls-player/package.json +++ b/packages/hls-player/package.json @@ -1,6 +1,6 @@ { "name": "@100mslive/hls-player", - "version": "0.3.1-alpha.5", + "version": "0.3.1-alpha.6", "description": "HLS client library which uses HTML5 Video element and Media Source Extension for playback", "main": "dist/index.cjs.js", "module": "dist/index.js", @@ -36,7 +36,7 @@ "author": "100ms", "license": "MIT", "dependencies": { - "@100mslive/hls-stats": "0.4.1-alpha.5", + "@100mslive/hls-stats": "0.4.1-alpha.6", "eventemitter2": "^6.4.9", "hls.js": "1.4.12" } diff --git a/packages/hls-stats/package.json b/packages/hls-stats/package.json index 1493719da7..bedcac0215 100644 --- a/packages/hls-stats/package.json +++ b/packages/hls-stats/package.json @@ -1,6 +1,6 @@ { "name": "@100mslive/hls-stats", - "version": "0.4.1-alpha.5", + "version": "0.4.1-alpha.6", "description": "A simple library that provides stats for your hls stream", "main": "dist/index.cjs.js", "module": "dist/index.js", diff --git a/packages/hms-video-store/package.json b/packages/hms-video-store/package.json index 34601f68c1..e802a18fcf 100644 --- a/packages/hms-video-store/package.json +++ b/packages/hms-video-store/package.json @@ -1,5 +1,5 @@ { - "version": "0.12.1-alpha.5", + "version": "0.12.1-alpha.6", "license": "MIT", "repository": { "type": "git", diff --git a/packages/hms-virtual-background/package.json b/packages/hms-virtual-background/package.json index 653a508cc8..038de009b6 100755 --- a/packages/hms-virtual-background/package.json +++ b/packages/hms-virtual-background/package.json @@ -1,5 +1,5 @@ { - "version": "1.13.1-alpha.5", + "version": "1.13.1-alpha.6", "license": "MIT", "name": "@100mslive/hms-virtual-background", "author": "100ms", @@ -32,10 +32,10 @@ "format": "prettier --write src/**/*.ts" }, "peerDependencies": { - "@100mslive/hms-video-store": "0.12.1-alpha.5" + "@100mslive/hms-video-store": "0.12.1-alpha.6" }, "devDependencies": { - "@100mslive/hms-video-store": "0.12.1-alpha.5" + "@100mslive/hms-video-store": "0.12.1-alpha.6" }, "dependencies": { "@mediapipe/selfie_segmentation": "^0.1.1632777926", diff --git a/packages/react-icons/package.json b/packages/react-icons/package.json index 6557596997..a7f5c394e9 100644 --- a/packages/react-icons/package.json +++ b/packages/react-icons/package.json @@ -4,7 +4,7 @@ "main": "dist/index.cjs.js", "module": "dist/index.js", "typings": "dist/index.d.ts", - "version": "0.10.1-alpha.5", + "version": "0.10.1-alpha.6", "author": "100ms", "license": "MIT", "repository": { diff --git a/packages/react-sdk/package.json b/packages/react-sdk/package.json index 2d4e005302..3fb511dadf 100644 --- a/packages/react-sdk/package.json +++ b/packages/react-sdk/package.json @@ -4,7 +4,7 @@ "main": "dist/index.cjs.js", "module": "dist/index.js", "typings": "dist/index.d.ts", - "version": "0.10.1-alpha.5", + "version": "0.10.1-alpha.6", "author": "100ms", "license": "MIT", "repository": { @@ -48,7 +48,7 @@ "react": ">=16.8 <19.0.0" }, "dependencies": { - "@100mslive/hms-video-store": "0.12.1-alpha.5", + "@100mslive/hms-video-store": "0.12.1-alpha.6", "react-resize-detector": "^7.0.0", "zustand": "^3.6.2" } diff --git a/packages/roomkit-react/package.json b/packages/roomkit-react/package.json index becb0e0066..ba822c73e2 100644 --- a/packages/roomkit-react/package.json +++ b/packages/roomkit-react/package.json @@ -10,7 +10,7 @@ "prebuilt", "roomkit" ], - "version": "0.3.1-alpha.5", + "version": "0.3.1-alpha.6", "author": "100ms", "license": "MIT", "repository": { @@ -82,11 +82,11 @@ "react": ">=17.0.2 <19.0.0" }, "dependencies": { - "@100mslive/hls-player": "0.3.1-alpha.5", + "@100mslive/hls-player": "0.3.1-alpha.6", "@100mslive/hms-noise-cancellation": "0.0.0-alpha.1", - "@100mslive/hms-virtual-background": "1.13.1-alpha.5", - "@100mslive/react-icons": "0.10.1-alpha.5", - "@100mslive/react-sdk": "0.10.1-alpha.5", + "@100mslive/hms-virtual-background": "1.13.1-alpha.6", + "@100mslive/react-icons": "0.10.1-alpha.6", + "@100mslive/react-sdk": "0.10.1-alpha.6", "@100mslive/types-prebuilt": "0.12.7", "@emoji-mart/data": "^1.0.6", "@emoji-mart/react": "^1.0.1", diff --git a/packages/roomkit-web/package.json b/packages/roomkit-web/package.json index c208ba3809..3fac3e60d3 100644 --- a/packages/roomkit-web/package.json +++ b/packages/roomkit-web/package.json @@ -1,6 +1,6 @@ { "name": "@100mslive/roomkit-web", - "version": "0.2.1-alpha.5", + "version": "0.2.1-alpha.6", "description": "A web component implementation of 100ms Prebuilt component", "keywords": [ "web-components", @@ -33,7 +33,7 @@ "build": "rm -rf dist && node ../../scripts/build-webapp" }, "dependencies": { - "@100mslive/roomkit-react": "0.3.1-alpha.5", + "@100mslive/roomkit-react": "0.3.1-alpha.6", "@r2wc/react-to-web-component": "2.0.2" } } From 939bce5ec26f722d2c916d86e4bda9dd9908fa45 Mon Sep 17 00:00:00 2001 From: raviteja83 Date: Thu, 7 Mar 2024 13:22:17 +0530 Subject: [PATCH 17/27] build: update versions for release - alpha --- examples/prebuilt-react-integration/package.json | 2 +- packages/hls-player/package.json | 4 ++-- packages/hls-stats/package.json | 2 +- packages/hms-video-store/package.json | 2 +- packages/hms-virtual-background/package.json | 6 +++--- packages/react-icons/package.json | 2 +- packages/react-sdk/package.json | 4 ++-- packages/roomkit-react/package.json | 10 +++++----- packages/roomkit-web/package.json | 4 ++-- 9 files changed, 18 insertions(+), 18 deletions(-) diff --git a/examples/prebuilt-react-integration/package.json b/examples/prebuilt-react-integration/package.json index 022c0b186a..445e164f8a 100644 --- a/examples/prebuilt-react-integration/package.json +++ b/examples/prebuilt-react-integration/package.json @@ -10,7 +10,7 @@ "preview": "vite preview" }, "dependencies": { - "@100mslive/roomkit-react": "0.3.1-alpha.6", + "@100mslive/roomkit-react": "0.3.1-alpha.7", "react": "^18.2.0", "react-dom": "^18.2.0" }, diff --git a/packages/hls-player/package.json b/packages/hls-player/package.json index f24f0efb91..c134d9c7d5 100644 --- a/packages/hls-player/package.json +++ b/packages/hls-player/package.json @@ -1,6 +1,6 @@ { "name": "@100mslive/hls-player", - "version": "0.3.1-alpha.6", + "version": "0.3.1-alpha.7", "description": "HLS client library which uses HTML5 Video element and Media Source Extension for playback", "main": "dist/index.cjs.js", "module": "dist/index.js", @@ -36,7 +36,7 @@ "author": "100ms", "license": "MIT", "dependencies": { - "@100mslive/hls-stats": "0.4.1-alpha.6", + "@100mslive/hls-stats": "0.4.1-alpha.7", "eventemitter2": "^6.4.9", "hls.js": "1.4.12" } diff --git a/packages/hls-stats/package.json b/packages/hls-stats/package.json index bedcac0215..e7841e5af4 100644 --- a/packages/hls-stats/package.json +++ b/packages/hls-stats/package.json @@ -1,6 +1,6 @@ { "name": "@100mslive/hls-stats", - "version": "0.4.1-alpha.6", + "version": "0.4.1-alpha.7", "description": "A simple library that provides stats for your hls stream", "main": "dist/index.cjs.js", "module": "dist/index.js", diff --git a/packages/hms-video-store/package.json b/packages/hms-video-store/package.json index e802a18fcf..7b55bf01d3 100644 --- a/packages/hms-video-store/package.json +++ b/packages/hms-video-store/package.json @@ -1,5 +1,5 @@ { - "version": "0.12.1-alpha.6", + "version": "0.12.1-alpha.7", "license": "MIT", "repository": { "type": "git", diff --git a/packages/hms-virtual-background/package.json b/packages/hms-virtual-background/package.json index 038de009b6..e707f0d7a4 100755 --- a/packages/hms-virtual-background/package.json +++ b/packages/hms-virtual-background/package.json @@ -1,5 +1,5 @@ { - "version": "1.13.1-alpha.6", + "version": "1.13.1-alpha.7", "license": "MIT", "name": "@100mslive/hms-virtual-background", "author": "100ms", @@ -32,10 +32,10 @@ "format": "prettier --write src/**/*.ts" }, "peerDependencies": { - "@100mslive/hms-video-store": "0.12.1-alpha.6" + "@100mslive/hms-video-store": "0.12.1-alpha.7" }, "devDependencies": { - "@100mslive/hms-video-store": "0.12.1-alpha.6" + "@100mslive/hms-video-store": "0.12.1-alpha.7" }, "dependencies": { "@mediapipe/selfie_segmentation": "^0.1.1632777926", diff --git a/packages/react-icons/package.json b/packages/react-icons/package.json index a7f5c394e9..fde4b6d56b 100644 --- a/packages/react-icons/package.json +++ b/packages/react-icons/package.json @@ -4,7 +4,7 @@ "main": "dist/index.cjs.js", "module": "dist/index.js", "typings": "dist/index.d.ts", - "version": "0.10.1-alpha.6", + "version": "0.10.1-alpha.7", "author": "100ms", "license": "MIT", "repository": { diff --git a/packages/react-sdk/package.json b/packages/react-sdk/package.json index 3fb511dadf..e13083a27d 100644 --- a/packages/react-sdk/package.json +++ b/packages/react-sdk/package.json @@ -4,7 +4,7 @@ "main": "dist/index.cjs.js", "module": "dist/index.js", "typings": "dist/index.d.ts", - "version": "0.10.1-alpha.6", + "version": "0.10.1-alpha.7", "author": "100ms", "license": "MIT", "repository": { @@ -48,7 +48,7 @@ "react": ">=16.8 <19.0.0" }, "dependencies": { - "@100mslive/hms-video-store": "0.12.1-alpha.6", + "@100mslive/hms-video-store": "0.12.1-alpha.7", "react-resize-detector": "^7.0.0", "zustand": "^3.6.2" } diff --git a/packages/roomkit-react/package.json b/packages/roomkit-react/package.json index ba822c73e2..3bda0341b8 100644 --- a/packages/roomkit-react/package.json +++ b/packages/roomkit-react/package.json @@ -10,7 +10,7 @@ "prebuilt", "roomkit" ], - "version": "0.3.1-alpha.6", + "version": "0.3.1-alpha.7", "author": "100ms", "license": "MIT", "repository": { @@ -82,11 +82,11 @@ "react": ">=17.0.2 <19.0.0" }, "dependencies": { - "@100mslive/hls-player": "0.3.1-alpha.6", + "@100mslive/hls-player": "0.3.1-alpha.7", "@100mslive/hms-noise-cancellation": "0.0.0-alpha.1", - "@100mslive/hms-virtual-background": "1.13.1-alpha.6", - "@100mslive/react-icons": "0.10.1-alpha.6", - "@100mslive/react-sdk": "0.10.1-alpha.6", + "@100mslive/hms-virtual-background": "1.13.1-alpha.7", + "@100mslive/react-icons": "0.10.1-alpha.7", + "@100mslive/react-sdk": "0.10.1-alpha.7", "@100mslive/types-prebuilt": "0.12.7", "@emoji-mart/data": "^1.0.6", "@emoji-mart/react": "^1.0.1", diff --git a/packages/roomkit-web/package.json b/packages/roomkit-web/package.json index 3fac3e60d3..6522199e4a 100644 --- a/packages/roomkit-web/package.json +++ b/packages/roomkit-web/package.json @@ -1,6 +1,6 @@ { "name": "@100mslive/roomkit-web", - "version": "0.2.1-alpha.6", + "version": "0.2.1-alpha.7", "description": "A web component implementation of 100ms Prebuilt component", "keywords": [ "web-components", @@ -33,7 +33,7 @@ "build": "rm -rf dist && node ../../scripts/build-webapp" }, "dependencies": { - "@100mslive/roomkit-react": "0.3.1-alpha.6", + "@100mslive/roomkit-react": "0.3.1-alpha.7", "@r2wc/react-to-web-component": "2.0.2" } } From 042450fdebe2bb618bbcff4e2fb0f35de7619027 Mon Sep 17 00:00:00 2001 From: raviteja83 Date: Thu, 7 Mar 2024 15:29:32 +0530 Subject: [PATCH 18/27] ci: comment main check for now --- .github/workflows/publish.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index e0d8c94841..a2917a4bb2 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -19,9 +19,9 @@ jobs: node-version: 18 registry-url: https://registry.npmjs.org/ - - name: Check for main branch if latest - if: (github.event.inputs.publishFlag == 'latest' || github.event.client_payload.slash_command.args.unnamed.arg1 == 'latest') && github.ref_name != 'main' - run: exit 1 + # - name: Check for main branch if latest + # if: (github.event.inputs.publishFlag == 'latest' || github.event.client_payload.slash_command.args.unnamed.arg1 == 'latest') && github.ref_name != 'main' + # run: exit 1 - name: Notify slack starting if: github.event.inputs.publishFlag == 'latest' && success() From fff51f4e055e089629a9320b0cb6e79e0245180c Mon Sep 17 00:00:00 2001 From: raviteja83 Date: Thu, 7 Mar 2024 16:42:18 +0530 Subject: [PATCH 19/27] build: update versions for release --- examples/prebuilt-react-integration/package.json | 2 +- packages/hls-player/package.json | 4 ++-- packages/hls-stats/package.json | 2 +- packages/hms-video-store/package.json | 2 +- packages/hms-virtual-background/package.json | 6 +++--- packages/react-icons/package.json | 2 +- packages/react-sdk/package.json | 4 ++-- packages/roomkit-react/package.json | 10 +++++----- packages/roomkit-web/package.json | 4 ++-- 9 files changed, 18 insertions(+), 18 deletions(-) diff --git a/examples/prebuilt-react-integration/package.json b/examples/prebuilt-react-integration/package.json index 445e164f8a..0ab13ba996 100644 --- a/examples/prebuilt-react-integration/package.json +++ b/examples/prebuilt-react-integration/package.json @@ -10,7 +10,7 @@ "preview": "vite preview" }, "dependencies": { - "@100mslive/roomkit-react": "0.3.1-alpha.7", + "@100mslive/roomkit-react": "0.3.1", "react": "^18.2.0", "react-dom": "^18.2.0" }, diff --git a/packages/hls-player/package.json b/packages/hls-player/package.json index c134d9c7d5..22051e3eb0 100644 --- a/packages/hls-player/package.json +++ b/packages/hls-player/package.json @@ -1,6 +1,6 @@ { "name": "@100mslive/hls-player", - "version": "0.3.1-alpha.7", + "version": "0.3.1", "description": "HLS client library which uses HTML5 Video element and Media Source Extension for playback", "main": "dist/index.cjs.js", "module": "dist/index.js", @@ -36,7 +36,7 @@ "author": "100ms", "license": "MIT", "dependencies": { - "@100mslive/hls-stats": "0.4.1-alpha.7", + "@100mslive/hls-stats": "0.4.1", "eventemitter2": "^6.4.9", "hls.js": "1.4.12" } diff --git a/packages/hls-stats/package.json b/packages/hls-stats/package.json index e7841e5af4..5da917ca71 100644 --- a/packages/hls-stats/package.json +++ b/packages/hls-stats/package.json @@ -1,6 +1,6 @@ { "name": "@100mslive/hls-stats", - "version": "0.4.1-alpha.7", + "version": "0.4.1", "description": "A simple library that provides stats for your hls stream", "main": "dist/index.cjs.js", "module": "dist/index.js", diff --git a/packages/hms-video-store/package.json b/packages/hms-video-store/package.json index 7b55bf01d3..5c07956221 100644 --- a/packages/hms-video-store/package.json +++ b/packages/hms-video-store/package.json @@ -1,5 +1,5 @@ { - "version": "0.12.1-alpha.7", + "version": "0.12.1", "license": "MIT", "repository": { "type": "git", diff --git a/packages/hms-virtual-background/package.json b/packages/hms-virtual-background/package.json index e707f0d7a4..4f105d174b 100755 --- a/packages/hms-virtual-background/package.json +++ b/packages/hms-virtual-background/package.json @@ -1,5 +1,5 @@ { - "version": "1.13.1-alpha.7", + "version": "1.13.1", "license": "MIT", "name": "@100mslive/hms-virtual-background", "author": "100ms", @@ -32,10 +32,10 @@ "format": "prettier --write src/**/*.ts" }, "peerDependencies": { - "@100mslive/hms-video-store": "0.12.1-alpha.7" + "@100mslive/hms-video-store": "0.12.1" }, "devDependencies": { - "@100mslive/hms-video-store": "0.12.1-alpha.7" + "@100mslive/hms-video-store": "0.12.1" }, "dependencies": { "@mediapipe/selfie_segmentation": "^0.1.1632777926", diff --git a/packages/react-icons/package.json b/packages/react-icons/package.json index fde4b6d56b..5b3b3ed759 100644 --- a/packages/react-icons/package.json +++ b/packages/react-icons/package.json @@ -4,7 +4,7 @@ "main": "dist/index.cjs.js", "module": "dist/index.js", "typings": "dist/index.d.ts", - "version": "0.10.1-alpha.7", + "version": "0.10.1", "author": "100ms", "license": "MIT", "repository": { diff --git a/packages/react-sdk/package.json b/packages/react-sdk/package.json index e13083a27d..2bb16efd01 100644 --- a/packages/react-sdk/package.json +++ b/packages/react-sdk/package.json @@ -4,7 +4,7 @@ "main": "dist/index.cjs.js", "module": "dist/index.js", "typings": "dist/index.d.ts", - "version": "0.10.1-alpha.7", + "version": "0.10.1", "author": "100ms", "license": "MIT", "repository": { @@ -48,7 +48,7 @@ "react": ">=16.8 <19.0.0" }, "dependencies": { - "@100mslive/hms-video-store": "0.12.1-alpha.7", + "@100mslive/hms-video-store": "0.12.1", "react-resize-detector": "^7.0.0", "zustand": "^3.6.2" } diff --git a/packages/roomkit-react/package.json b/packages/roomkit-react/package.json index 3bda0341b8..05ac1996c9 100644 --- a/packages/roomkit-react/package.json +++ b/packages/roomkit-react/package.json @@ -10,7 +10,7 @@ "prebuilt", "roomkit" ], - "version": "0.3.1-alpha.7", + "version": "0.3.1", "author": "100ms", "license": "MIT", "repository": { @@ -82,11 +82,11 @@ "react": ">=17.0.2 <19.0.0" }, "dependencies": { - "@100mslive/hls-player": "0.3.1-alpha.7", + "@100mslive/hls-player": "0.3.1", "@100mslive/hms-noise-cancellation": "0.0.0-alpha.1", - "@100mslive/hms-virtual-background": "1.13.1-alpha.7", - "@100mslive/react-icons": "0.10.1-alpha.7", - "@100mslive/react-sdk": "0.10.1-alpha.7", + "@100mslive/hms-virtual-background": "1.13.1", + "@100mslive/react-icons": "0.10.1", + "@100mslive/react-sdk": "0.10.1", "@100mslive/types-prebuilt": "0.12.7", "@emoji-mart/data": "^1.0.6", "@emoji-mart/react": "^1.0.1", diff --git a/packages/roomkit-web/package.json b/packages/roomkit-web/package.json index 6522199e4a..ca0e5f035e 100644 --- a/packages/roomkit-web/package.json +++ b/packages/roomkit-web/package.json @@ -1,6 +1,6 @@ { "name": "@100mslive/roomkit-web", - "version": "0.2.1-alpha.7", + "version": "0.2.1", "description": "A web component implementation of 100ms Prebuilt component", "keywords": [ "web-components", @@ -33,7 +33,7 @@ "build": "rm -rf dist && node ../../scripts/build-webapp" }, "dependencies": { - "@100mslive/roomkit-react": "0.3.1-alpha.7", + "@100mslive/roomkit-react": "0.3.1", "@r2wc/react-to-web-component": "2.0.2" } } From 281ff80e37e3dafa752e34351d44e596d97f89d5 Mon Sep 17 00:00:00 2001 From: raviteja83 Date: Thu, 7 Mar 2024 17:12:56 +0530 Subject: [PATCH 20/27] ci: enable main check for latest --- .github/workflows/publish.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index a2917a4bb2..e0d8c94841 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -19,9 +19,9 @@ jobs: node-version: 18 registry-url: https://registry.npmjs.org/ - # - name: Check for main branch if latest - # if: (github.event.inputs.publishFlag == 'latest' || github.event.client_payload.slash_command.args.unnamed.arg1 == 'latest') && github.ref_name != 'main' - # run: exit 1 + - name: Check for main branch if latest + if: (github.event.inputs.publishFlag == 'latest' || github.event.client_payload.slash_command.args.unnamed.arg1 == 'latest') && github.ref_name != 'main' + run: exit 1 - name: Notify slack starting if: github.event.inputs.publishFlag == 'latest' && success() From 299c1b5c5a178095794a6cbd38d02defb0f65bd9 Mon Sep 17 00:00:00 2001 From: raviteja83 Date: Thu, 7 Mar 2024 17:18:14 +0530 Subject: [PATCH 21/27] fix: duplicate property --- .../src/Prebuilt/components/VideoLayouts/ProminenceLayout.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/roomkit-react/src/Prebuilt/components/VideoLayouts/ProminenceLayout.tsx b/packages/roomkit-react/src/Prebuilt/components/VideoLayouts/ProminenceLayout.tsx index 08eab0188e..9041d8f945 100644 --- a/packages/roomkit-react/src/Prebuilt/components/VideoLayouts/ProminenceLayout.tsx +++ b/packages/roomkit-react/src/Prebuilt/components/VideoLayouts/ProminenceLayout.tsx @@ -73,7 +73,6 @@ const SecondarySection = ({ maxWidth: 240, h: hasSidebar ? undefined : '100%', aspectRatio: 16 / 9, - h: '100%', '@md': { aspectRatio: 1 }, }} objectFit="contain" From 2d3ccc420b48c983cfbac21b17e5b5b8c56ace43 Mon Sep 17 00:00:00 2001 From: Ravi theja Date: Fri, 8 Mar 2024 11:22:01 +0530 Subject: [PATCH 22/27] fix: remove test logs --- .../src/Prebuilt/components/VideoLayouts/ProminenceLayout.tsx | 1 - packages/roomkit-react/src/Prebuilt/layouts/SidePane.tsx | 1 - 2 files changed, 2 deletions(-) diff --git a/packages/roomkit-react/src/Prebuilt/components/VideoLayouts/ProminenceLayout.tsx b/packages/roomkit-react/src/Prebuilt/components/VideoLayouts/ProminenceLayout.tsx index 9041d8f945..9ed895d2d8 100644 --- a/packages/roomkit-react/src/Prebuilt/components/VideoLayouts/ProminenceLayout.tsx +++ b/packages/roomkit-react/src/Prebuilt/components/VideoLayouts/ProminenceLayout.tsx @@ -36,7 +36,6 @@ const SecondarySection = ({ hasSidebar, }: React.PropsWithChildren<{ tiles: TrackWithPeerAndDimensions[]; edgeToEdge?: boolean; hasSidebar?: boolean }>) => { const tileLayoutProps = useVideoTileContext(); - console.log('secondary section', { tilesLength: tiles?.length }); if (!tiles?.length) { return null; } diff --git a/packages/roomkit-react/src/Prebuilt/layouts/SidePane.tsx b/packages/roomkit-react/src/Prebuilt/layouts/SidePane.tsx index 5b4066b683..3225467f98 100644 --- a/packages/roomkit-react/src/Prebuilt/layouts/SidePane.tsx +++ b/packages/roomkit-react/src/Prebuilt/layouts/SidePane.tsx @@ -193,7 +193,6 @@ const SidePane = ({ }); if (!trackId && !SidepaneComponent) { - console.log('sidepane not rendered', { trackId, SidepaneComponent }); return null; } From 86ea8a17f07feb9d8ed60342f558f5fdb129238a Mon Sep 17 00:00:00 2001 From: Amar Bathwal <110378139+amar-1995@users.noreply.github.com> Date: Fri, 8 Mar 2024 13:55:31 +0530 Subject: [PATCH 23/27] fix: show blocking prompt in landscape mode --- .../src/Prebuilt/components/MwebLandscapePrompt.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/roomkit-react/src/Prebuilt/components/MwebLandscapePrompt.tsx b/packages/roomkit-react/src/Prebuilt/components/MwebLandscapePrompt.tsx index b3ce28e14a..c2164f9895 100644 --- a/packages/roomkit-react/src/Prebuilt/components/MwebLandscapePrompt.tsx +++ b/packages/roomkit-react/src/Prebuilt/components/MwebLandscapePrompt.tsx @@ -32,7 +32,7 @@ export const MwebLandscapePrompt = () => { // Angle check needed to diff bw mobile and desktop setShowMwebLandscapePrompt( match({ angle, isLandscapeHLSStream, isLandscape, type }) - .with({ isLandscapeHLSStream }, () => false) + .with({ isLandscapeHLSStream: true }, () => false) .with({ angle: P.when(angle => angle && angle >= 90) }, ({ type }) => type.includes('landscape')) .otherwise(() => isLandscape), ); From b01d7a882262b3a58fb65b4ee10505ab2485d226 Mon Sep 17 00:00:00 2001 From: "Eswar Prasad Clinton. A" <64120992+eswarclynn@users.noreply.github.com> Date: Fri, 8 Mar 2024 16:43:35 +0530 Subject: [PATCH 24/27] feat: lower hand raise, bring to stage in hand raised accordion --- .../components/Footer/ParticipantList.tsx | 156 ++++++++++-------- .../components/Footer/RoleAccordion.tsx | 21 ++- .../hooks/useGroupOnStageActions.tsx | 54 ++++++ .../hooks/usePeerOnStageActions.tsx | 49 ++++++ 4 files changed, 213 insertions(+), 67 deletions(-) create mode 100644 packages/roomkit-react/src/Prebuilt/components/hooks/useGroupOnStageActions.tsx create mode 100644 packages/roomkit-react/src/Prebuilt/components/hooks/usePeerOnStageActions.tsx diff --git a/packages/roomkit-react/src/Prebuilt/components/Footer/ParticipantList.tsx b/packages/roomkit-react/src/Prebuilt/components/Footer/ParticipantList.tsx index a72f4f4fc8..91b8f3a2c0 100644 --- a/packages/roomkit-react/src/Prebuilt/components/Footer/ParticipantList.tsx +++ b/packages/roomkit-react/src/Prebuilt/components/Footer/ParticipantList.tsx @@ -9,24 +9,30 @@ import { selectIsPeerAudioEnabled, selectLocalPeerID, selectPeerCount, - selectPeerMetadata, selectPermissions, - useHMSActions, useHMSStore, } from '@100mslive/react-sdk'; -import { ChangeRoleIcon, HandIcon, MicOffIcon, PeopleIcon, SearchIcon, VerticalMenuIcon } from '@100mslive/react-icons'; +import { + AddIcon, + ChangeRoleIcon, + CrossIcon, + HandIcon, + MicOffIcon, + PeopleIcon, + SearchIcon, + VerticalMenuIcon, +} from '@100mslive/react-icons'; import { Accordion, Box, config as cssConfig, Dropdown, Flex, Input, Text, textEllipsis } from '../../..'; +import { IconButton as BaseIconButton } from '../../../IconButton'; // @ts-ignore: No implicit Any import IconButton from '../../IconButton'; import { ConnectionIndicator } from '../Connection/ConnectionIndicator'; import { RemoveParticipant } from '../RemoveParticipant'; import { RoleAccordion } from './RoleAccordion'; -import { - ConferencingScreenElements, - useRoomLayoutConferencingScreen, -} from '../../provider/roomLayoutProvider/hooks/useRoomLayoutScreen'; +import { useRoomLayoutConferencingScreen } from '../../provider/roomLayoutProvider/hooks/useRoomLayoutScreen'; // @ts-ignore: No implicit Any import { useIsSidepaneTypeOpen, useSidepaneToggle } from '../AppData/useSidepane'; +import { usePeerOnStageActions } from '../hooks/usePeerOnStageActions'; import { useParticipants } from '../../common/hooks'; // @ts-ignore: No implicit Any import { getFormattedCount } from '../../common/utils'; @@ -146,10 +152,12 @@ export const ParticipantCount = () => { export const Participant = ({ peer, isConnected, + isHandRaisedAccordion, style, }: { peer: HMSPeer; isConnected: boolean; + isHandRaisedAccordion?: boolean; style: React.CSSProperties; }) => { const localPeerId = useHMSStore(selectLocalPeerID); @@ -175,7 +183,12 @@ export const Participant = ({ {peer.name} {localPeerId === peer.id ? '(You)' : ''} {isConnected && peer.roleName ? ( - + ) : null} ); @@ -247,7 +260,17 @@ const VirtualizedParticipants = ({ * shows settings to change for a participant like changing their role */ const ParticipantActions = React.memo( - ({ peerId, role, isLocal }: { peerId: string; role: string; isLocal: boolean }) => { + ({ + peerId, + role, + isLocal, + isHandRaisedAccordion, + }: { + peerId: string; + role: string; + isLocal: boolean; + isHandRaisedAccordion?: boolean; + }) => { const isHandRaised = useHMSStore(selectHasPeerHandRaised(peerId)); const canChangeRole = useHMSStore(selectPermissions)?.changeRole; const canRemoveOthers = useHMSStore(selectPermissions)?.removeOthers; @@ -264,72 +287,73 @@ const ParticipantActions = React.memo( gap: '$8', }} > - - {isHandRaised && ( - - - - )} - {isAudioMuted ? ( - - - - ) : null} + {isHandRaisedAccordion ? ( + + ) : ( + <> + + {isHandRaised && ( + + + + )} + {isAudioMuted ? ( + + + + ) : null} - {shouldShowMoreActions && !isLocal ? ( - - ) : null} + {shouldShowMoreActions && !isLocal ? : null} + + )} ); }, ); -const ParticipantMoreActions = ({ - peerId, - role, - elements, - canChangeRole, -}: { - peerId: string; - role: string; - canChangeRole: boolean; - elements: ConferencingScreenElements; -}) => { - const hmsActions = useHMSActions(); +const HandRaisedAccordionParticipantActions = ({ peerId, role }: { peerId: string; role: string }) => { + const { handleStageAction, lowerPeerHand, shouldShowStageRoleChange, isInStage } = usePeerOnStageActions({ + peerId, + role, + }); + return ( + <> + lowerPeerHand()} + > + + + {shouldShowStageRoleChange && !isInStage && ( + handleStageAction()} + > + + + )} + + ); +}; + +const ParticipantMoreActions = ({ peerId, role }: { peerId: string; role: string }) => { const { + open, + setOpen, bring_to_stage_label, remove_from_stage_label, - on_stage_role, - off_stage_roles = [], - skip_preview_for_role_change = false, - } = elements.on_stage_exp || {}; - const isInStage = role === on_stage_role; - const shouldShowStageRoleChange = - canChangeRole && - ((isInStage && remove_from_stage_label) || (off_stage_roles?.includes(role) && bring_to_stage_label)); - const prevRole = useHMSStore(selectPeerMetadata(peerId))?.prevRole; - const [open, setOpen] = useState(false); - - const handleStageAction = async () => { - if (isInStage) { - prevRole && hmsActions.changeRoleOfPeer(peerId, prevRole, true); - } else if (on_stage_role) { - await hmsActions.changeRoleOfPeer(peerId, on_stage_role, skip_preview_for_role_change); - if (skip_preview_for_role_change) { - await hmsActions.lowerRemotePeerHand(peerId); - } - } - setOpen(false); - }; - + handleStageAction, + isInStage, + shouldShowStageRoleChange, + } = usePeerOnStageActions({ peerId, role }); return ( setOpen(value)} modal={false}> @@ -63,6 +68,9 @@ export const RoleAccordion = ({ peersInAccordion = peersInAccordion.filter(peer => peer.name.toLowerCase().includes(filter.search || '')); } } + const { bringAllToStage, bring_to_stage_label, canBringToStage, lowerAllHands } = useGroupOnStageActions({ + peers: peersInAccordion, + }); useEffect(() => { if (!isOffStageRole || !isLargeRoom) { @@ -113,7 +121,7 @@ export const RoleAccordion = ({ ) : null} + {isHandRaisedAccordion && ( + <> + + + + {canBringToStage && } + + + )} ); diff --git a/packages/roomkit-react/src/Prebuilt/components/hooks/useGroupOnStageActions.tsx b/packages/roomkit-react/src/Prebuilt/components/hooks/useGroupOnStageActions.tsx new file mode 100644 index 0000000000..fe5fafacd9 --- /dev/null +++ b/packages/roomkit-react/src/Prebuilt/components/hooks/useGroupOnStageActions.tsx @@ -0,0 +1,54 @@ +import { match, P } from 'ts-pattern'; +import { HMSPeer, selectPermissions, useHMSActions, useHMSStore } from '@100mslive/react-sdk'; +import { useRoomLayoutConferencingScreen } from '../../provider/roomLayoutProvider/hooks/useRoomLayoutScreen'; + +export const useGroupOnStageActions = ({ peers }: { peers: HMSPeer[] }) => { + const hmsActions = useHMSActions(); + const { elements } = useRoomLayoutConferencingScreen(); + const { + bring_to_stage_label, + remove_from_stage_label, + on_stage_role, + off_stage_roles = [], + skip_preview_for_role_change = false, + } = elements.on_stage_exp || {}; + const canChangeRole = useHMSStore(selectPermissions)?.changeRole; + + const offStageRolePeers = peers.filter(peer => + match({ on_stage_role, bring_to_stage_label, roleName: peer.roleName }) + .with( + { + on_stage_role: P.when(role => !!role), + bring_to_stage_label: P.when(label => !!label), + roleName: P.when(role => !!role && off_stage_roles.includes(role)), + }, + () => true, + ) + .otherwise(() => false), + ); + + const lowerAllHands = async () => { + return Promise.all(peers.map(peer => hmsActions.lowerRemotePeerHand(peer.id))); + }; + + const bringAllToStage = () => { + if (!canChangeRole || !on_stage_role) { + return; + } + return Promise.all( + offStageRolePeers.map(peer => { + return hmsActions.changeRoleOfPeer(peer.id, on_stage_role, skip_preview_for_role_change).then(() => { + return skip_preview_for_role_change ? hmsActions.lowerRemotePeerHand(peer.id) : null; + }); + }), + ); + }; + + return { + lowerAllHands, + bringAllToStage, + canBringToStage: canChangeRole && offStageRolePeers.length > 0, + bring_to_stage_label, + remove_from_stage_label, + }; +}; diff --git a/packages/roomkit-react/src/Prebuilt/components/hooks/usePeerOnStageActions.tsx b/packages/roomkit-react/src/Prebuilt/components/hooks/usePeerOnStageActions.tsx new file mode 100644 index 0000000000..000a20641f --- /dev/null +++ b/packages/roomkit-react/src/Prebuilt/components/hooks/usePeerOnStageActions.tsx @@ -0,0 +1,49 @@ +import { useState } from 'react'; +import { selectPeerMetadata, selectPermissions, useHMSActions, useHMSStore } from '@100mslive/react-sdk'; +import { useRoomLayoutConferencingScreen } from '../../provider/roomLayoutProvider/hooks/useRoomLayoutScreen'; + +export const usePeerOnStageActions = ({ peerId, role }: { peerId: string; role: string }) => { + const hmsActions = useHMSActions(); + const { elements } = useRoomLayoutConferencingScreen(); + const { + bring_to_stage_label, + remove_from_stage_label, + on_stage_role, + off_stage_roles = [], + skip_preview_for_role_change = false, + } = elements.on_stage_exp || {}; + const isInStage = role === on_stage_role; + const canChangeRole = useHMSStore(selectPermissions)?.changeRole; + const shouldShowStageRoleChange = + canChangeRole && + ((isInStage && remove_from_stage_label) || (off_stage_roles?.includes(role) && bring_to_stage_label)); + const prevRole = useHMSStore(selectPeerMetadata(peerId))?.prevRole; + const [open, setOpen] = useState(false); + + const lowerPeerHand = async () => { + await hmsActions.lowerRemotePeerHand(peerId); + }; + + const handleStageAction = async () => { + if (isInStage) { + prevRole && hmsActions.changeRoleOfPeer(peerId, prevRole, true); + } else if (on_stage_role) { + await hmsActions.changeRoleOfPeer(peerId, on_stage_role, skip_preview_for_role_change); + if (skip_preview_for_role_change) { + await lowerPeerHand(); + } + } + setOpen(false); + }; + + return { + open, + setOpen, + lowerPeerHand, + handleStageAction, + shouldShowStageRoleChange, + isInStage, + bring_to_stage_label, + remove_from_stage_label, + }; +}; From 7f13ba5967e2a1fae9ed18ed7f926f7784717f88 Mon Sep 17 00:00:00 2001 From: Ravi theja Date: Fri, 8 Mar 2024 19:22:19 +0530 Subject: [PATCH 25/27] feat: add type: 'module' to all packages (#2681) --- packages/hls-player/package.json | 1 + packages/hls-stats/package.json | 1 + packages/hms-video-store/package.json | 1 + packages/hms-virtual-background/package.json | 1 + packages/react-icons/package.json | 1 + packages/react-sdk/package.json | 1 + packages/roomkit-react/package.json | 1 + packages/roomkit-web/package.json | 1 + 8 files changed, 8 insertions(+) diff --git a/packages/hls-player/package.json b/packages/hls-player/package.json index 22051e3eb0..47db5083c0 100644 --- a/packages/hls-player/package.json +++ b/packages/hls-player/package.json @@ -5,6 +5,7 @@ "main": "dist/index.cjs.js", "module": "dist/index.js", "typings": "dist/index.d.ts", + "type": "module", "repository": { "type": "git", "url": "https://github.com/100mslive/web-sdks.git", diff --git a/packages/hls-stats/package.json b/packages/hls-stats/package.json index 5da917ca71..9607bdfa84 100644 --- a/packages/hls-stats/package.json +++ b/packages/hls-stats/package.json @@ -5,6 +5,7 @@ "main": "dist/index.cjs.js", "module": "dist/index.js", "typings": "dist/index.d.ts", + "type": "module", "repository": { "type": "git", "url": "https://github.com/100mslive/web-sdks.git", diff --git a/packages/hms-video-store/package.json b/packages/hms-video-store/package.json index 5c07956221..1e71e69d55 100644 --- a/packages/hms-video-store/package.json +++ b/packages/hms-video-store/package.json @@ -9,6 +9,7 @@ "main": "dist/index.cjs.js", "module": "dist/index.js", "typings": "dist/index.d.ts", + "type": "module", "files": [ "dist", "src" diff --git a/packages/hms-virtual-background/package.json b/packages/hms-virtual-background/package.json index 4f105d174b..f510bdba38 100755 --- a/packages/hms-virtual-background/package.json +++ b/packages/hms-virtual-background/package.json @@ -6,6 +6,7 @@ "module": "dist/index.js", "main": "dist/index.cjs.js", "typings": "dist/index.d.ts", + "type": "module", "repository": { "type": "git", "url": "https://github.com/100mslive/web-sdks.git", diff --git a/packages/react-icons/package.json b/packages/react-icons/package.json index 5b3b3ed759..4ecb487707 100644 --- a/packages/react-icons/package.json +++ b/packages/react-icons/package.json @@ -4,6 +4,7 @@ "main": "dist/index.cjs.js", "module": "dist/index.js", "typings": "dist/index.d.ts", + "type": "module", "version": "0.10.1", "author": "100ms", "license": "MIT", diff --git a/packages/react-sdk/package.json b/packages/react-sdk/package.json index 2bb16efd01..f42ecf9431 100644 --- a/packages/react-sdk/package.json +++ b/packages/react-sdk/package.json @@ -4,6 +4,7 @@ "main": "dist/index.cjs.js", "module": "dist/index.js", "typings": "dist/index.d.ts", + "type": "module", "version": "0.10.1", "author": "100ms", "license": "MIT", diff --git a/packages/roomkit-react/package.json b/packages/roomkit-react/package.json index 05ac1996c9..0ede82f759 100644 --- a/packages/roomkit-react/package.json +++ b/packages/roomkit-react/package.json @@ -4,6 +4,7 @@ "main": "dist/index.cjs.js", "module": "dist/index.js", "typings": "dist/index.d.ts", + "type": "module", "keywords": [ "100mslive", "react", diff --git a/packages/roomkit-web/package.json b/packages/roomkit-web/package.json index ca0e5f035e..4f4837b032 100644 --- a/packages/roomkit-web/package.json +++ b/packages/roomkit-web/package.json @@ -11,6 +11,7 @@ "main": "dist/index.cjs.js", "module": "dist/index.js", "typings": "dist/index.d.ts", + "type": "module", "author": "100ms", "license": "MIT", "repository": { From a6229514a8c2d2207941d0739f9516bdfc9dbbac Mon Sep 17 00:00:00 2001 From: Ravi theja Date: Mon, 11 Mar 2024 15:28:01 +0530 Subject: [PATCH 26/27] fix: failing jest tests --- packages/hms-video-store/jest.config.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/hms-video-store/jest.config.js b/packages/hms-video-store/jest.config.js index c2abcb0929..b78c73e9ad 100644 --- a/packages/hms-video-store/jest.config.js +++ b/packages/hms-video-store/jest.config.js @@ -1,4 +1,4 @@ -module.exports = { +const config = { transform: { '.(ts|tsx)$': '../../node_modules/ts-jest/dist/index.js', '.(js|jsx)$': '../../node_modules/babel-jest/build/index.js', @@ -9,3 +9,5 @@ module.exports = { setupFiles: ['jest-canvas-mock', 'jsdom-worker'], testEnvironment: 'jsdom', }; + +export default config; From e99675cf57d3c1a4e276f73e1915525a75d381fb Mon Sep 17 00:00:00 2001 From: Ravi theja Date: Mon, 11 Mar 2024 22:10:58 +0530 Subject: [PATCH 27/27] fix: video tile size when res changes in sidebar (#2688) --- .../src/Prebuilt/components/VideoLayouts/ProminenceLayout.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/roomkit-react/src/Prebuilt/components/VideoLayouts/ProminenceLayout.tsx b/packages/roomkit-react/src/Prebuilt/components/VideoLayouts/ProminenceLayout.tsx index 9ed895d2d8..428ea1b49e 100644 --- a/packages/roomkit-react/src/Prebuilt/components/VideoLayouts/ProminenceLayout.tsx +++ b/packages/roomkit-react/src/Prebuilt/components/VideoLayouts/ProminenceLayout.tsx @@ -70,8 +70,8 @@ const SecondarySection = ({ rootCSS={{ padding: 0, maxWidth: 240, - h: hasSidebar ? undefined : '100%', aspectRatio: 16 / 9, + ...(hasSidebar ? { w: '100%' } : { h: '100%' }), '@md': { aspectRatio: 1 }, }} objectFit="contain"