Skip to content

Commit

Permalink
Guard against codec array param (livekit-examples#166)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasIO authored Dec 1, 2023
1 parent 70d5bf5 commit 4e94e42
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pages/rooms/[name].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,9 @@ const ActiveRoom = ({ roomName, userChoices, onLeave }: ActiveRoomProps) => {
const keyProvider = new ExternalE2EEKeyProvider();

const roomOptions = React.useMemo((): RoomOptions => {
let videoCodec: VideoCodec | undefined = (codec as VideoCodec) ?? 'av1';
let videoCodec: VideoCodec | undefined = (
Array.isArray(codec) ? codec[0] : codec ?? 'av1'
) as VideoCodec;
if (e2eeEnabled && (videoCodec === 'av1' || videoCodec === 'vp9')) {
videoCodec = undefined;
}
Expand Down

0 comments on commit 4e94e42

Please sign in to comment.