Skip to content

Commit 2b856eb

Browse files
chrisguttandinchrisn
authored andcommitted
Fix usage of {Audio/Video}Decoder.isConfigSupported() in example
1 parent 704c167 commit 2b856eb

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

samples/lib/audio_renderer.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ export class AudioRenderer {
3131

3232
debugLog(config);
3333

34-
console.assert(AudioDecoder.isConfigSupported(config));
34+
let support = await AudioDecoder.isConfigSupported(config);
35+
console.assert(support.supported);
3536
this.decoder.configure(config);
3637

3738
// Initialize the ring buffer between the decoder and the real-time audio

samples/lib/video_renderer.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ export class VideoRenderer {
3131
output: this.bufferFrame.bind(this),
3232
error: e => console.error(e),
3333
});
34-
console.assert(VideoDecoder.isConfigSupported(config))
34+
35+
let support = await VideoDecoder.isConfigSupported(config);
36+
console.assert(support.supported);
3537
this.decoder.configure(config);
3638

3739
this.init_resolver = null;

0 commit comments

Comments
 (0)