Skip to content

Commit 3a56d13

Browse files
committed
feat: add keep alive overlay for livekit view
1 parent 8eca54a commit 3a56d13

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

client/web/src/plugin/component/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,4 @@ export {
7777
} from '@/components/JumpToButton';
7878
export { NoData } from '@/components/NoData';
7979
export { NotFound } from '@/components/NotFound';
80+
export { withKeepAliveOverlay } from '@/components/KeepAliveOverlay/withKeepAliveOverlay';

server/plugins/com.msgbyte.livekit/web/plugins/com.msgbyte.livekit/src/components/LivekitView.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { showErrorToasts, useEvent } from '@capital/common';
2+
import { withKeepAliveOverlay } from '@capital/component';
23
import React, { useState } from 'react';
34
import type { LocalUserChoices } from '@livekit/components-react';
45
import { PreJoinView } from './lib/PreJoinView';
@@ -10,7 +11,7 @@ interface LivekitViewProps {
1011
roomName: string;
1112
url: string;
1213
}
13-
export const LivekitView: React.FC<LivekitViewProps> = React.memo((props) => {
14+
const _LivekitView: React.FC<LivekitViewProps> = React.memo((props) => {
1415
const [preJoinChoices, setPreJoinChoices] = useState<
1516
LocalUserChoices | undefined
1617
>(undefined);
@@ -54,4 +55,8 @@ export const LivekitView: React.FC<LivekitViewProps> = React.memo((props) => {
5455
</LivekitContainer>
5556
);
5657
});
57-
LivekitView.displayName = 'LivekitView';
58+
_LivekitView.displayName = 'LivekitView';
59+
60+
export const LivekitView = withKeepAliveOverlay(_LivekitView, {
61+
cacheId: (props) => props.url,
62+
});

server/plugins/com.msgbyte.livekit/web/plugins/com.msgbyte.livekit/src/group/LivekitPanel.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@ export const LivekitGroupPanel: React.FC = React.memo(() => {
1010

1111
return (
1212
<GroupPanelContainer groupId={groupId} panelId={panelId}>
13-
<LivekitView roomName={roomName} url={url} />
13+
<LivekitView
14+
style={{ width: '100%', height: '100%' }}
15+
roomName={roomName}
16+
url={url}
17+
/>
1418
</GroupPanelContainer>
1519
);
1620
});

0 commit comments

Comments
 (0)