Make WebCodecs missing error message more helpful (fixes #466)

This commit is contained in:
Vanilagy
2026-08-20 23:22:28 +02:00
parent 1c4d1c70a8
commit 166298df2c
4 changed files with 32 additions and 11 deletions
+3 -3
View File
@@ -155,7 +155,7 @@ export class EncodedPacket {
throw new TypeError('Metadata-only packets cannot be converted to a video chunk.');
}
if (typeof EncodedVideoChunk === 'undefined') {
throw new Error('Your browser does not support EncodedVideoChunk.');
throw new Error('EncodedVideoChunk is not available in this environment.');
}
return new EncodedVideoChunk({
@@ -179,7 +179,7 @@ export class EncodedPacket {
throw new TypeError('Metadata-only packets cannot be converted to a video chunk.');
}
if (typeof EncodedVideoChunk === 'undefined') {
throw new Error('Your browser does not support EncodedVideoChunk.');
throw new Error('EncodedVideoChunk is not available in this environment.');
}
return new EncodedVideoChunk({
@@ -198,7 +198,7 @@ export class EncodedPacket {
throw new TypeError('Metadata-only packets cannot be converted to an audio chunk.');
}
if (typeof EncodedAudioChunk === 'undefined') {
throw new Error('Your browser does not support EncodedAudioChunk.');
throw new Error('EncodedAudioChunk is not available in this environment.');
}
return new EncodedAudioChunk({