From 0dd45c4dfb15550d7e18f39030c00ce351d3dabc Mon Sep 17 00:00:00 2001 From: Ravi theja Date: Mon, 11 Mar 2024 16:03:42 +0530 Subject: [PATCH 1/7] fix: video tile size when res changes in 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 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" From b68534ac88d1fb0b06f0d1b6b29def77b01ba01e Mon Sep 17 00:00:00 2001 From: Ravi theja Date: Tue, 12 Mar 2024 10:46:47 +0530 Subject: [PATCH 2/7] revert: type 'module' as it causing some build issues --- packages/hls-player/package.json | 1 - packages/hls-stats/package.json | 1 - packages/hms-video-store/jest.config.js | 2 +- 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 - 9 files changed, 1 insertion(+), 9 deletions(-) diff --git a/packages/hls-player/package.json b/packages/hls-player/package.json index 47db5083c0..22051e3eb0 100644 --- a/packages/hls-player/package.json +++ b/packages/hls-player/package.json @@ -5,7 +5,6 @@ "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 9607bdfa84..5da917ca71 100644 --- a/packages/hls-stats/package.json +++ b/packages/hls-stats/package.json @@ -5,7 +5,6 @@ "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/jest.config.js b/packages/hms-video-store/jest.config.js index b78c73e9ad..5c19a40542 100644 --- a/packages/hms-video-store/jest.config.js +++ b/packages/hms-video-store/jest.config.js @@ -10,4 +10,4 @@ const config = { testEnvironment: 'jsdom', }; -export default config; +module.exports = config; diff --git a/packages/hms-video-store/package.json b/packages/hms-video-store/package.json index 1e71e69d55..5c07956221 100644 --- a/packages/hms-video-store/package.json +++ b/packages/hms-video-store/package.json @@ -9,7 +9,6 @@ "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 f510bdba38..4f105d174b 100755 --- a/packages/hms-virtual-background/package.json +++ b/packages/hms-virtual-background/package.json @@ -6,7 +6,6 @@ "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 4ecb487707..5b3b3ed759 100644 --- a/packages/react-icons/package.json +++ b/packages/react-icons/package.json @@ -4,7 +4,6 @@ "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 f42ecf9431..2bb16efd01 100644 --- a/packages/react-sdk/package.json +++ b/packages/react-sdk/package.json @@ -4,7 +4,6 @@ "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 0ede82f759..05ac1996c9 100644 --- a/packages/roomkit-react/package.json +++ b/packages/roomkit-react/package.json @@ -4,7 +4,6 @@ "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 4f4837b032..ca0e5f035e 100644 --- a/packages/roomkit-web/package.json +++ b/packages/roomkit-web/package.json @@ -11,7 +11,6 @@ "main": "dist/index.cjs.js", "module": "dist/index.js", "typings": "dist/index.d.ts", - "type": "module", "author": "100ms", "license": "MIT", "repository": { From 193031128d478aecbda54865271f61a1703c3886 Mon Sep 17 00:00:00 2001 From: Kaustubh Kumar Date: Tue, 12 Mar 2024 17:16:04 +0530 Subject: [PATCH 3/7] fix: design parity for hand raise actions (#2694) * fix: design parity * fix: move constant value out of the component --- .../components/Footer/ParticipantList.tsx | 22 +++++++------------ .../components/Footer/RoleAccordion.tsx | 12 ++++++---- 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/packages/roomkit-react/src/Prebuilt/components/Footer/ParticipantList.tsx b/packages/roomkit-react/src/Prebuilt/components/Footer/ParticipantList.tsx index 91b8f3a2c0..d24485c900 100644 --- a/packages/roomkit-react/src/Prebuilt/components/Footer/ParticipantList.tsx +++ b/packages/roomkit-react/src/Prebuilt/components/Footer/ParticipantList.tsx @@ -22,8 +22,7 @@ import { SearchIcon, VerticalMenuIcon, } from '@100mslive/react-icons'; -import { Accordion, Box, config as cssConfig, Dropdown, Flex, Input, Text, textEllipsis } from '../../..'; -import { IconButton as BaseIconButton } from '../../../IconButton'; +import { Accordion, Box, Button, config as cssConfig, Dropdown, Flex, Input, Text, textEllipsis } from '../../..'; // @ts-ignore: No implicit Any import IconButton from '../../IconButton'; import { ConnectionIndicator } from '../Connection/ConnectionIndicator'; @@ -319,6 +318,7 @@ const ParticipantActions = React.memo( }, ); +const quickActionStyle = { p: '$1', borderRadius: '$round' }; const HandRaisedAccordionParticipantActions = ({ peerId, role }: { peerId: string; role: string }) => { const { handleStageAction, lowerPeerHand, shouldShowStageRoleChange, isInStage } = usePeerOnStageActions({ peerId, @@ -326,19 +326,13 @@ const HandRaisedAccordionParticipantActions = ({ peerId, role }: { peerId: strin }); return ( <> - lowerPeerHand()} - > - - + {shouldShowStageRoleChange && !isInStage && ( - handleStageAction()} - > - - + )} ); diff --git a/packages/roomkit-react/src/Prebuilt/components/Footer/RoleAccordion.tsx b/packages/roomkit-react/src/Prebuilt/components/Footer/RoleAccordion.tsx index f2003b186e..0eec2bef23 100644 --- a/packages/roomkit-react/src/Prebuilt/components/Footer/RoleAccordion.tsx +++ b/packages/roomkit-react/src/Prebuilt/components/Footer/RoleAccordion.tsx @@ -2,7 +2,7 @@ import React, { useEffect } from 'react'; import { useMeasure } from 'react-use'; import { FixedSizeList } from 'react-window'; import { HMSPeer, selectIsLargeRoom, useHMSStore, usePaginatedParticipants } from '@100mslive/react-sdk'; -import { ChevronRightIcon } from '@100mslive/react-icons'; +import { AddIcon, ChevronRightIcon, CrossIcon } from '@100mslive/react-icons'; import { Accordion } from '../../../Accordion'; import { Button } from '../../../Button'; import { HorizontalDivider } from '../../../Divider'; @@ -152,10 +152,14 @@ export const RoleAccordion = ({ <> - - {canBringToStage && } + {canBringToStage && ( + + )} )} From 0431d3a1045202d35103ce0ad9734608afcfc04a Mon Sep 17 00:00:00 2001 From: Amar Bathwal <110378139+amar-1995@users.noreply.github.com> Date: Tue, 12 Mar 2024 18:21:08 +0530 Subject: [PATCH 4/7] fix: play pause hls stream on click --- .../src/Prebuilt/layouts/HLSView.jsx | 29 +++++++++++++------ 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/packages/roomkit-react/src/Prebuilt/layouts/HLSView.jsx b/packages/roomkit-react/src/Prebuilt/layouts/HLSView.jsx index e754cf4958..2be40db094 100644 --- a/packages/roomkit-react/src/Prebuilt/layouts/HLSView.jsx +++ b/packages/roomkit-react/src/Prebuilt/layouts/HLSView.jsx @@ -336,15 +336,26 @@ const HLSView = () => { }, [hlsState?.variants, isLandscape, isMobile, onSeekTo], ); - const onClickHandler = useCallback(() => { - if (!(isMobile || isLandscape)) { - return; - } - setControlsVisible(value => !value); - if (controlsTimerRef.current) { - clearTimeout(controlsTimerRef.current); - } - }, [isLandscape, isMobile]); + const onClickHandler = useCallback(async () => { + match({ isMobile, isLandscape, playlist_type: hlsState?.variants[0]?.playlist_type }) + .with({ playlist_type: HLSPlaylistType.DVR, isMobile: false, isLandscape: false }, async () => { + if (isPaused) { + await hlsPlayer?.play(); + } else { + hlsPlayer?.pause(); + } + }) + .when( + ({ isMobile, isLandscape }) => isMobile || isLandscape, + () => { + setControlsVisible(value => !value); + if (controlsTimerRef.current) { + clearTimeout(controlsTimerRef.current); + } + }, + ) + .otherwise(() => null); + }, [hlsState?.variants, isLandscape, isMobile, isPaused]); const onHoverHandler = useCallback( event => { event.preventDefault(); From 764c784f0db15ed7a54650e11d7bb4045277a3fb Mon Sep 17 00:00:00 2001 From: Kaustubh Kumar Date: Fri, 15 Mar 2024 11:38:51 +0530 Subject: [PATCH 5/7] feat: calculate total usage for plugin --- .../src/analytics/AnalyticsEventFactory.ts | 18 +++++++ .../src/common/PluginUsageTracker.ts | 53 +++++++++++++++++++ packages/hms-video-store/src/common/index.ts | 1 + packages/hms-video-store/src/index.ts | 1 + .../plugins/audio/AudioPluginsAnalytics.ts | 1 + packages/hms-video-store/src/sdk/index.ts | 5 +- .../hms-video-store/src/transport/index.ts | 3 ++ 7 files changed, 81 insertions(+), 1 deletion(-) create mode 100644 packages/hms-video-store/src/common/PluginUsageTracker.ts create mode 100644 packages/hms-video-store/src/common/index.ts diff --git a/packages/hms-video-store/src/analytics/AnalyticsEventFactory.ts b/packages/hms-video-store/src/analytics/AnalyticsEventFactory.ts index 1c897ab980..8a70bf8259 100644 --- a/packages/hms-video-store/src/analytics/AnalyticsEventFactory.ts +++ b/packages/hms-video-store/src/analytics/AnalyticsEventFactory.ts @@ -3,6 +3,7 @@ import { AdditionalAnalyticsProperties } from './AdditionalAnalyticsProperties'; import AnalyticsEvent from './AnalyticsEvent'; import { AnalyticsEventLevel } from './AnalyticsEventLevel'; import { IAnalyticsPropertiesProvider } from './IAnalyticsPropertiesProvider'; +import { pluginUsageTracker } from '../common'; import { HMSException } from '../error/HMSException'; import { DeviceMap, SelectedDevices } from '../interfaces'; import { HMSTrackSettings } from '../media/settings/HMSTrackSettings'; @@ -235,6 +236,23 @@ export default class AnalyticsEventFactory { }); } + static getKrispUsage(sessionID: string) { + const duration = pluginUsageTracker.getPluginUsage('HMSKrispPlugin', sessionID); + return new AnalyticsEvent({ + name: 'krisp.usage', + level: AnalyticsEventLevel.INFO, + properties: { duration }, + }); + } + + static transportLeave() { + return new AnalyticsEvent({ + name: 'transport.leave', + level: AnalyticsEventLevel.INFO, + properties: {}, + }); + } + private static eventNameFor(name: string, ok: boolean) { const suffix = ok ? 'success' : 'failed'; return `${name}.${suffix}`; diff --git a/packages/hms-video-store/src/common/PluginUsageTracker.ts b/packages/hms-video-store/src/common/PluginUsageTracker.ts new file mode 100644 index 0000000000..248550ff41 --- /dev/null +++ b/packages/hms-video-store/src/common/PluginUsageTracker.ts @@ -0,0 +1,53 @@ +import AnalyticsEvent from '../analytics/AnalyticsEvent'; + +class PluginUsageTracker { + private pluginUsage: Map = new Map(); + private pluginLastAddedAt: Map = new Map(); + + getPluginUsage = (name: string, sessionID: string) => { + const pluginKey = `${sessionID}-${name}`; + + if (!this.pluginUsage.has(pluginKey)) { + this.pluginUsage.set(pluginKey, 0); + } + if (this.pluginLastAddedAt.has(pluginKey)) { + const lastAddedAt = this.pluginLastAddedAt.get(pluginKey) || 0; + const extraDuration = lastAddedAt ? Date.now() - lastAddedAt : 0; + this.pluginUsage.set(pluginKey, (this.pluginUsage.get(pluginKey) || 0) + extraDuration); + this.pluginLastAddedAt.delete(pluginKey); + } + return this.pluginUsage.get(pluginKey); + }; + + updatePluginUsageData = (event: AnalyticsEvent, sessionID: string) => { + // Sent on leave, after krisp usage is sent + if (event.name === 'transport.leave') { + this.cleanup(sessionID); + return; + } + + const name = event.properties.plugin_name; + const pluginKey = `${sessionID}-${name}`; + if (event.name === 'mediaPlugin.added') { + const addedAt = event.properties.added_at; + this.pluginLastAddedAt.set(pluginKey, addedAt); + } else if (event.name === 'mediaPlugin.stats') { + const duration = event.properties.duration; + if (duration > 0) { + this.pluginUsage.set(pluginKey, (this.pluginUsage.get(pluginKey) || 0) + duration * 1000); + this.pluginLastAddedAt.delete(pluginKey); + } + } + }; + + private cleanup = (sessionID: string) => { + for (const key of this.pluginUsage.keys()) { + if (sessionID.length && key.includes(sessionID)) { + this.pluginUsage.delete(key); + this.pluginLastAddedAt.delete(key); + } + } + }; +} + +export const pluginUsageTracker = new PluginUsageTracker(); diff --git a/packages/hms-video-store/src/common/index.ts b/packages/hms-video-store/src/common/index.ts new file mode 100644 index 0000000000..44f3432f1e --- /dev/null +++ b/packages/hms-video-store/src/common/index.ts @@ -0,0 +1 @@ +export { pluginUsageTracker } from './PluginUsageTracker'; diff --git a/packages/hms-video-store/src/index.ts b/packages/hms-video-store/src/index.ts index dfc3890b9f..2cce36b2dd 100644 --- a/packages/hms-video-store/src/index.ts +++ b/packages/hms-video-store/src/index.ts @@ -53,6 +53,7 @@ export type { HMSQuizLeaderboardSummary, } from './internal'; +export { pluginUsageTracker } from './common'; export { HMSReactiveStore } from './reactive-store/HMSReactiveStore'; export { HMSPluginUnsupportedTypes, HMSRecordingState, HLSPlaylistType } from './internal'; export type { diff --git a/packages/hms-video-store/src/plugins/audio/AudioPluginsAnalytics.ts b/packages/hms-video-store/src/plugins/audio/AudioPluginsAnalytics.ts index 08801d07eb..30629c4bdf 100644 --- a/packages/hms-video-store/src/plugins/audio/AudioPluginsAnalytics.ts +++ b/packages/hms-video-store/src/plugins/audio/AudioPluginsAnalytics.ts @@ -24,6 +24,7 @@ export class AudioPluginsAnalytics { this.addedTimestamps[name] = Date.now(); this.initTime[name] = 0; this.pluginSampleRate[name] = sampleRate; + this.eventBus.analytics.publish(MediaPluginsAnalyticsFactory.added(name, this.addedTimestamps[name])); } removed(name: string) { diff --git a/packages/hms-video-store/src/sdk/index.ts b/packages/hms-video-store/src/sdk/index.ts index f5c263a5d4..5d8de0e8ea 100644 --- a/packages/hms-video-store/src/sdk/index.ts +++ b/packages/hms-video-store/src/sdk/index.ts @@ -12,6 +12,7 @@ import { HMSAnalyticsLevel } from '../analytics/AnalyticsEventLevel'; import { AnalyticsEventsService } from '../analytics/AnalyticsEventsService'; import { AnalyticsTimer, TimedEvent } from '../analytics/AnalyticsTimer'; import { AudioSinkManager } from '../audio-sink-manager'; +import { pluginUsageTracker } from '../common/PluginUsageTracker'; import { DeviceManager } from '../device-manager'; import { AudioOutputManager } from '../device-manager/AudioOutputManager'; import { DeviceStorageManager } from '../device-manager/DeviceStorage'; @@ -181,7 +182,6 @@ export class HMSSdk implements HMSInterface { ); this.sessionStore = new SessionStore(this.transport); this.interactivityCenter = new InteractivityCenter(this.transport, this.store, this.listener); - /** * Note: Subscribe to events here right after creating stores and managers * to not miss events that are published before the handlers are subscribed. @@ -498,6 +498,7 @@ export class HMSSdk implements HMSInterface { this.errorListener?.onError(error); }; + // eslint-disable-next-line complexity async join(config: HMSConfig, listener: HMSUpdateListener) { validateMediaDevicesExistence(); validateRTCPeerConnection(); @@ -571,6 +572,8 @@ export class HMSSdk implements HMSInterface { throw error; } HMSLogger.timeEnd(`join-room-${roomId}`); + const sessionID = this.store.getRoom()?.sessionId || ''; + this.eventBus.analytics.subscribe(e => pluginUsageTracker.updatePluginUsageData(e, sessionID)); } private stringifyMetadata(config: HMSConfig) { diff --git a/packages/hms-video-store/src/transport/index.ts b/packages/hms-video-store/src/transport/index.ts index fc6a168e99..a4f45f8a5d 100644 --- a/packages/hms-video-store/src/transport/index.ts +++ b/packages/hms-video-store/src/transport/index.ts @@ -495,6 +495,9 @@ export default class HMSTransport { this.joinParameters = undefined; HMSLogger.d(TAG, 'leaving in transport'); try { + const sessionID = this.store.getRoom()?.sessionId || ''; + this.eventBus.analytics.publish(AnalyticsEventFactory.getKrispUsage(sessionID)); + this.eventBus.analytics.publish(AnalyticsEventFactory.transportLeave()); this.state = TransportState.Leaving; this.publishStatsAnalytics?.stop(); this.subscribeStatsAnalytics?.stop(); From 83c45afe20dd322fb745fff93da841697fd87a64 Mon Sep 17 00:00:00 2001 From: Ravi theja Date: Fri, 15 Mar 2024 11:48:41 +0530 Subject: [PATCH 6/7] Revert "feat: calculate total usage for plugin" --- .../src/analytics/AnalyticsEventFactory.ts | 18 ------- .../src/common/PluginUsageTracker.ts | 53 ------------------- packages/hms-video-store/src/common/index.ts | 1 - packages/hms-video-store/src/index.ts | 1 - .../plugins/audio/AudioPluginsAnalytics.ts | 1 - packages/hms-video-store/src/sdk/index.ts | 5 +- .../hms-video-store/src/transport/index.ts | 3 -- 7 files changed, 1 insertion(+), 81 deletions(-) delete mode 100644 packages/hms-video-store/src/common/PluginUsageTracker.ts delete mode 100644 packages/hms-video-store/src/common/index.ts diff --git a/packages/hms-video-store/src/analytics/AnalyticsEventFactory.ts b/packages/hms-video-store/src/analytics/AnalyticsEventFactory.ts index 8a70bf8259..1c897ab980 100644 --- a/packages/hms-video-store/src/analytics/AnalyticsEventFactory.ts +++ b/packages/hms-video-store/src/analytics/AnalyticsEventFactory.ts @@ -3,7 +3,6 @@ import { AdditionalAnalyticsProperties } from './AdditionalAnalyticsProperties'; import AnalyticsEvent from './AnalyticsEvent'; import { AnalyticsEventLevel } from './AnalyticsEventLevel'; import { IAnalyticsPropertiesProvider } from './IAnalyticsPropertiesProvider'; -import { pluginUsageTracker } from '../common'; import { HMSException } from '../error/HMSException'; import { DeviceMap, SelectedDevices } from '../interfaces'; import { HMSTrackSettings } from '../media/settings/HMSTrackSettings'; @@ -236,23 +235,6 @@ export default class AnalyticsEventFactory { }); } - static getKrispUsage(sessionID: string) { - const duration = pluginUsageTracker.getPluginUsage('HMSKrispPlugin', sessionID); - return new AnalyticsEvent({ - name: 'krisp.usage', - level: AnalyticsEventLevel.INFO, - properties: { duration }, - }); - } - - static transportLeave() { - return new AnalyticsEvent({ - name: 'transport.leave', - level: AnalyticsEventLevel.INFO, - properties: {}, - }); - } - private static eventNameFor(name: string, ok: boolean) { const suffix = ok ? 'success' : 'failed'; return `${name}.${suffix}`; diff --git a/packages/hms-video-store/src/common/PluginUsageTracker.ts b/packages/hms-video-store/src/common/PluginUsageTracker.ts deleted file mode 100644 index 248550ff41..0000000000 --- a/packages/hms-video-store/src/common/PluginUsageTracker.ts +++ /dev/null @@ -1,53 +0,0 @@ -import AnalyticsEvent from '../analytics/AnalyticsEvent'; - -class PluginUsageTracker { - private pluginUsage: Map = new Map(); - private pluginLastAddedAt: Map = new Map(); - - getPluginUsage = (name: string, sessionID: string) => { - const pluginKey = `${sessionID}-${name}`; - - if (!this.pluginUsage.has(pluginKey)) { - this.pluginUsage.set(pluginKey, 0); - } - if (this.pluginLastAddedAt.has(pluginKey)) { - const lastAddedAt = this.pluginLastAddedAt.get(pluginKey) || 0; - const extraDuration = lastAddedAt ? Date.now() - lastAddedAt : 0; - this.pluginUsage.set(pluginKey, (this.pluginUsage.get(pluginKey) || 0) + extraDuration); - this.pluginLastAddedAt.delete(pluginKey); - } - return this.pluginUsage.get(pluginKey); - }; - - updatePluginUsageData = (event: AnalyticsEvent, sessionID: string) => { - // Sent on leave, after krisp usage is sent - if (event.name === 'transport.leave') { - this.cleanup(sessionID); - return; - } - - const name = event.properties.plugin_name; - const pluginKey = `${sessionID}-${name}`; - if (event.name === 'mediaPlugin.added') { - const addedAt = event.properties.added_at; - this.pluginLastAddedAt.set(pluginKey, addedAt); - } else if (event.name === 'mediaPlugin.stats') { - const duration = event.properties.duration; - if (duration > 0) { - this.pluginUsage.set(pluginKey, (this.pluginUsage.get(pluginKey) || 0) + duration * 1000); - this.pluginLastAddedAt.delete(pluginKey); - } - } - }; - - private cleanup = (sessionID: string) => { - for (const key of this.pluginUsage.keys()) { - if (sessionID.length && key.includes(sessionID)) { - this.pluginUsage.delete(key); - this.pluginLastAddedAt.delete(key); - } - } - }; -} - -export const pluginUsageTracker = new PluginUsageTracker(); diff --git a/packages/hms-video-store/src/common/index.ts b/packages/hms-video-store/src/common/index.ts deleted file mode 100644 index 44f3432f1e..0000000000 --- a/packages/hms-video-store/src/common/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { pluginUsageTracker } from './PluginUsageTracker'; diff --git a/packages/hms-video-store/src/index.ts b/packages/hms-video-store/src/index.ts index 2cce36b2dd..dfc3890b9f 100644 --- a/packages/hms-video-store/src/index.ts +++ b/packages/hms-video-store/src/index.ts @@ -53,7 +53,6 @@ export type { HMSQuizLeaderboardSummary, } from './internal'; -export { pluginUsageTracker } from './common'; export { HMSReactiveStore } from './reactive-store/HMSReactiveStore'; export { HMSPluginUnsupportedTypes, HMSRecordingState, HLSPlaylistType } from './internal'; export type { diff --git a/packages/hms-video-store/src/plugins/audio/AudioPluginsAnalytics.ts b/packages/hms-video-store/src/plugins/audio/AudioPluginsAnalytics.ts index 30629c4bdf..08801d07eb 100644 --- a/packages/hms-video-store/src/plugins/audio/AudioPluginsAnalytics.ts +++ b/packages/hms-video-store/src/plugins/audio/AudioPluginsAnalytics.ts @@ -24,7 +24,6 @@ export class AudioPluginsAnalytics { this.addedTimestamps[name] = Date.now(); this.initTime[name] = 0; this.pluginSampleRate[name] = sampleRate; - this.eventBus.analytics.publish(MediaPluginsAnalyticsFactory.added(name, this.addedTimestamps[name])); } removed(name: string) { diff --git a/packages/hms-video-store/src/sdk/index.ts b/packages/hms-video-store/src/sdk/index.ts index 5d8de0e8ea..f5c263a5d4 100644 --- a/packages/hms-video-store/src/sdk/index.ts +++ b/packages/hms-video-store/src/sdk/index.ts @@ -12,7 +12,6 @@ import { HMSAnalyticsLevel } from '../analytics/AnalyticsEventLevel'; import { AnalyticsEventsService } from '../analytics/AnalyticsEventsService'; import { AnalyticsTimer, TimedEvent } from '../analytics/AnalyticsTimer'; import { AudioSinkManager } from '../audio-sink-manager'; -import { pluginUsageTracker } from '../common/PluginUsageTracker'; import { DeviceManager } from '../device-manager'; import { AudioOutputManager } from '../device-manager/AudioOutputManager'; import { DeviceStorageManager } from '../device-manager/DeviceStorage'; @@ -182,6 +181,7 @@ export class HMSSdk implements HMSInterface { ); this.sessionStore = new SessionStore(this.transport); this.interactivityCenter = new InteractivityCenter(this.transport, this.store, this.listener); + /** * Note: Subscribe to events here right after creating stores and managers * to not miss events that are published before the handlers are subscribed. @@ -498,7 +498,6 @@ export class HMSSdk implements HMSInterface { this.errorListener?.onError(error); }; - // eslint-disable-next-line complexity async join(config: HMSConfig, listener: HMSUpdateListener) { validateMediaDevicesExistence(); validateRTCPeerConnection(); @@ -572,8 +571,6 @@ export class HMSSdk implements HMSInterface { throw error; } HMSLogger.timeEnd(`join-room-${roomId}`); - const sessionID = this.store.getRoom()?.sessionId || ''; - this.eventBus.analytics.subscribe(e => pluginUsageTracker.updatePluginUsageData(e, sessionID)); } private stringifyMetadata(config: HMSConfig) { diff --git a/packages/hms-video-store/src/transport/index.ts b/packages/hms-video-store/src/transport/index.ts index a4f45f8a5d..fc6a168e99 100644 --- a/packages/hms-video-store/src/transport/index.ts +++ b/packages/hms-video-store/src/transport/index.ts @@ -495,9 +495,6 @@ export default class HMSTransport { this.joinParameters = undefined; HMSLogger.d(TAG, 'leaving in transport'); try { - const sessionID = this.store.getRoom()?.sessionId || ''; - this.eventBus.analytics.publish(AnalyticsEventFactory.getKrispUsage(sessionID)); - this.eventBus.analytics.publish(AnalyticsEventFactory.transportLeave()); this.state = TransportState.Leaving; this.publishStatsAnalytics?.stop(); this.subscribeStatsAnalytics?.stop(); From 8aafe5f7eea1ac66fb48451a5948cdfd4cf2cc1a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 15 Mar 2024 11:53:05 +0530 Subject: [PATCH 7/7] build: update versions for release --- .../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 +-- yarn.lock | 31 +++++++++++++++++-- 10 files changed, 46 insertions(+), 21 deletions(-) diff --git a/examples/prebuilt-react-integration/package.json b/examples/prebuilt-react-integration/package.json index 0ab13ba996..f0e8dad4ee 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", + "@100mslive/roomkit-react": "0.3.2", "react": "^18.2.0", "react-dom": "^18.2.0" }, diff --git a/packages/hls-player/package.json b/packages/hls-player/package.json index 22051e3eb0..ae95358b8d 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", + "version": "0.3.2", "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", + "@100mslive/hls-stats": "0.4.2", "eventemitter2": "^6.4.9", "hls.js": "1.4.12" } diff --git a/packages/hls-stats/package.json b/packages/hls-stats/package.json index 5da917ca71..3903f200ea 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", + "version": "0.4.2", "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 5c07956221..af7d4803aa 100644 --- a/packages/hms-video-store/package.json +++ b/packages/hms-video-store/package.json @@ -1,5 +1,5 @@ { - "version": "0.12.1", + "version": "0.12.2", "license": "MIT", "repository": { "type": "git", diff --git a/packages/hms-virtual-background/package.json b/packages/hms-virtual-background/package.json index 4f105d174b..7a52ff653a 100755 --- a/packages/hms-virtual-background/package.json +++ b/packages/hms-virtual-background/package.json @@ -1,5 +1,5 @@ { - "version": "1.13.1", + "version": "1.13.2", "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" + "@100mslive/hms-video-store": "0.12.2" }, "devDependencies": { - "@100mslive/hms-video-store": "0.12.1" + "@100mslive/hms-video-store": "0.12.2" }, "dependencies": { "@mediapipe/selfie_segmentation": "^0.1.1632777926", diff --git a/packages/react-icons/package.json b/packages/react-icons/package.json index 5b3b3ed759..67803a405f 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", + "version": "0.10.2", "author": "100ms", "license": "MIT", "repository": { diff --git a/packages/react-sdk/package.json b/packages/react-sdk/package.json index 2bb16efd01..b8272cd6e7 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", + "version": "0.10.2", "author": "100ms", "license": "MIT", "repository": { @@ -48,7 +48,7 @@ "react": ">=16.8 <19.0.0" }, "dependencies": { - "@100mslive/hms-video-store": "0.12.1", + "@100mslive/hms-video-store": "0.12.2", "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 05ac1996c9..5c85124d1a 100644 --- a/packages/roomkit-react/package.json +++ b/packages/roomkit-react/package.json @@ -10,7 +10,7 @@ "prebuilt", "roomkit" ], - "version": "0.3.1", + "version": "0.3.2", "author": "100ms", "license": "MIT", "repository": { @@ -82,11 +82,11 @@ "react": ">=17.0.2 <19.0.0" }, "dependencies": { - "@100mslive/hls-player": "0.3.1", + "@100mslive/hls-player": "0.3.2", "@100mslive/hms-noise-cancellation": "0.0.0-alpha.1", - "@100mslive/hms-virtual-background": "1.13.1", - "@100mslive/react-icons": "0.10.1", - "@100mslive/react-sdk": "0.10.1", + "@100mslive/hms-virtual-background": "1.13.2", + "@100mslive/react-icons": "0.10.2", + "@100mslive/react-sdk": "0.10.2", "@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 ca0e5f035e..2fc5bc1573 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", + "version": "0.2.2", "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", + "@100mslive/roomkit-react": "0.3.2", "@r2wc/react-to-web-component": "2.0.2" } } diff --git a/yarn.lock b/yarn.lock index df9c962f3c..6b77c85e5c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -15781,7 +15781,16 @@ string-natural-compare@^3.0.1: resolved "https://registry.yarnpkg.com/string-natural-compare/-/string-natural-compare-3.0.1.tgz#7a42d58474454963759e8e8b7ae63d71c1e7fdf4" integrity sha512-n3sPwynL1nwKi3WJ6AIsClwBMa0zTi54fn2oLU6ndfTSIO05xaznjSf15PcBZU6FNWbmN5Q6cxT4V5hGvB4taw== -"string-width-cjs@npm:string-width@^4.2.0", "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: +"string-width-cjs@npm:string-width@^4.2.0": + version "4.2.3" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + +"string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -15881,7 +15890,14 @@ string_decoder@~1.1.1: dependencies: safe-buffer "~5.1.0" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: +"strip-ansi-cjs@npm:strip-ansi@^6.0.1": + version "6.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + +strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -17178,7 +17194,7 @@ worker-timers@^7.0.40: worker-timers-broker "^6.0.95" worker-timers-worker "^7.0.59" -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== @@ -17196,6 +17212,15 @@ wrap-ansi@^6.0.1, wrap-ansi@^6.2.0: string-width "^4.1.0" strip-ansi "^6.0.0" +wrap-ansi@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + wrap-ansi@^8.1.0: version "8.1.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214"