Add hq publishing mode (#30)
* Add hq publishing mode * remove unused vars
This commit is contained in:
parent
fe24adefc7
commit
3d623b5dbc
1 changed files with 10 additions and 4 deletions
|
@ -6,13 +6,12 @@ import {
|
|||
VideoConference,
|
||||
formatChatMessageLinks,
|
||||
} from '@livekit/components-react';
|
||||
import { LogLevel, RoomOptions } from 'livekit-client';
|
||||
import { LogLevel, RoomOptions, VideoPresets } from 'livekit-client';
|
||||
|
||||
import type { NextPage } from 'next';
|
||||
import Head from 'next/head';
|
||||
import { useRouter } from 'next/router';
|
||||
import { useMemo, useState } from 'react';
|
||||
import { getLiveKitURL } from '../../lib/server-utils';
|
||||
import { DebugMode } from '../../lib/Debug';
|
||||
import { useServerUrl } from '../../lib/client-utils';
|
||||
|
||||
|
@ -73,7 +72,7 @@ const ActiveRoom = ({ roomName, userChoices, onLeave }: ActiveRoomProps) => {
|
|||
});
|
||||
|
||||
const router = useRouter();
|
||||
const { region } = router.query;
|
||||
const { region, hq } = router.query;
|
||||
|
||||
const liveKitUrl = useServerUrl(region as string | undefined);
|
||||
|
||||
|
@ -81,6 +80,13 @@ const ActiveRoom = ({ roomName, userChoices, onLeave }: ActiveRoomProps) => {
|
|||
return {
|
||||
videoCaptureDefaults: {
|
||||
deviceId: userChoices.videoDeviceId ?? undefined,
|
||||
resolution: hq === 'true' ? VideoPresets.h2160 : VideoPresets.h720,
|
||||
},
|
||||
publishDefaults: {
|
||||
videoSimulcastLayers:
|
||||
hq === 'true'
|
||||
? [VideoPresets.h1080, VideoPresets.h720]
|
||||
: [VideoPresets.h540, VideoPresets.h216],
|
||||
},
|
||||
audioCaptureDefaults: {
|
||||
deviceId: userChoices.audioDeviceId ?? undefined,
|
||||
|
@ -88,7 +94,7 @@ const ActiveRoom = ({ roomName, userChoices, onLeave }: ActiveRoomProps) => {
|
|||
adaptiveStream: { pixelDensity: 'screen' },
|
||||
dynacast: true,
|
||||
};
|
||||
}, [userChoices]);
|
||||
}, [userChoices, hq]);
|
||||
|
||||
return (
|
||||
<>
|
||||
|
|
Loading…
Reference in a new issue