Guard against codec array param (#166)
This commit is contained in:
parent
70d5bf5794
commit
4e94e42cd1
1 changed files with 3 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue