mirror of
https://github.com/arcodange-org/mediabunny.git
synced 2026-09-29 11:53:52 +02:00
Add methods that check decodability
This commit is contained in:
+9
-2
@@ -40,8 +40,15 @@ const input = new Metamuxer.Input({
|
||||
|
||||
console.log(await input.getMimeType())
|
||||
|
||||
const videoTrack = await input.getPrimaryVideoTrack();
|
||||
const audioTrack = await input.getPrimaryAudioTrack();
|
||||
let videoTrack = await input.getPrimaryVideoTrack();
|
||||
let audioTrack = await input.getPrimaryAudioTrack();
|
||||
|
||||
if (!(await videoTrack.canDecode())) {
|
||||
videoTrack = null;
|
||||
}
|
||||
if (!(await audioTrack.canDecode())) {
|
||||
audioTrack = null;
|
||||
}
|
||||
|
||||
const canvas = document.querySelector('canvas');
|
||||
const context = canvas.getContext('2d');
|
||||
|
||||
Reference in New Issue
Block a user