diff --git a/.changeset/heavy-garlics-greet.md b/.changeset/heavy-garlics-greet.md new file mode 100644 index 0000000000..803544600b --- /dev/null +++ b/.changeset/heavy-garlics-greet.md @@ -0,0 +1,5 @@ +--- +'livekit-client': patch +--- + +fix: mimeTypeToVideoCodecString should not throw diff --git a/src/room/track/utils.ts b/src/room/track/utils.ts index 0b62e08a1a..82e6122c05 100644 --- a/src/room/track/utils.ts +++ b/src/room/track/utils.ts @@ -9,7 +9,6 @@ import { type ScreenShareCaptureOptions, type VideoCaptureOptions, type VideoCodec, - videoCodecs, } from './options'; import type { AudioTrack } from './types'; @@ -188,11 +187,7 @@ export function screenCaptureToDisplayMediaStreamOptions( } export function mimeTypeToVideoCodecString(mimeType: string) { - const codec = mimeType.split('/')[1].toLowerCase() as VideoCodec; - if (!videoCodecs.includes(codec)) { - throw Error(`Video codec not supported: ${codec}`); - } - return codec; + return mimeType.split('/')[1].toLowerCase() as VideoCodec; } export function getTrackPublicationInfo(