mirror of
https://github.com/arcodange-org/mediabunny.git
synced 2026-09-27 10:53:50 +02:00
Fix tenc fallback for encrypted ISOBMFF files (#470)
* fix tenc fallback * Add test case --------- Co-authored-by: Vanilagy <[email protected]>
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
import { expect, test } from 'vitest';
|
||||
import { Input } from '../../src/input.js';
|
||||
import { UrlSource } from '../../src/source.js';
|
||||
import { ALL_FORMATS } from '../../src/input-format.js';
|
||||
import { AudioSampleSink } from '../../src/media-sink.js';
|
||||
import { assert } from '../../src/misc.js';
|
||||
|
||||
test('Encrypted MP4 without senc', async () => {
|
||||
using input = new Input({
|
||||
source: new UrlSource('/639955605-b752f7ad-7ce8-43c2-8ae9-88e74c6ae696.mp4'),
|
||||
formats: ALL_FORMATS,
|
||||
formatOptions: {
|
||||
isobmff: {
|
||||
resolveKeyId: () => 'aabbccddeeff00112233445566778899',
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
const audioTrack = await input.getPrimaryAudioTrack();
|
||||
assert(audioTrack);
|
||||
|
||||
// Test that it can decode
|
||||
const sink = new AudioSampleSink(audioTrack);
|
||||
using firstSample = await sink.getSample(0);
|
||||
assert(firstSample);
|
||||
expect(firstSample.timestamp).toBe(0);
|
||||
});
|
||||
Binary file not shown.
Reference in New Issue
Block a user