mirror of
https://github.com/codedread/bitjs
synced 2025-10-03 09:39:16 +02:00
1.0.6: Return 'vp9' for the video codec in getFullMIMEString(). Also move the annoying warning in deprecated archive.js.
This commit is contained in:
parent
d3b8765b42
commit
726feee48f
6 changed files with 16 additions and 14 deletions
|
@ -102,7 +102,8 @@ ISO RFC6381 MIME type strings, including the codec information. Currently suppor
|
|||
of MP4 and WEBM.
|
||||
|
||||
How to use:
|
||||
|
||||
* First, install ffprobe (ffmpeg) on your system.
|
||||
* Then:
|
||||
```javascript
|
||||
|
||||
import { getFullMIMEString } from 'bitjs/codecs/codecs.js';
|
||||
|
|
|
@ -15,8 +15,6 @@ import { UnarchiveAppendEvent, UnarchiveErrorEvent, UnarchiveEvent, UnarchiveEve
|
|||
UnrarrerInternal, UntarrerInternal, UnzipperInternal,
|
||||
getUnarchiverInternal } from './decompress-internal.js';
|
||||
|
||||
console.warn(`Stop using archive.js and use decompress.js instead. This module will be removed.`);
|
||||
|
||||
export {
|
||||
UnarchiveAppendEvent,
|
||||
UnarchiveErrorEvent,
|
||||
|
@ -58,18 +56,22 @@ export {
|
|||
|
||||
const createWorkerFn = (scriptFilename) => new Worker(scriptFilename);
|
||||
|
||||
function warn() {
|
||||
console.warn(`Stop using archive.js and use decompress.js instead. This module will be removed.`);
|
||||
}
|
||||
|
||||
// Thin wrappers of unarchivers for clients who want to construct a specific
|
||||
// unarchiver themselves rather than use getUnarchiver().
|
||||
export class Unzipper extends UnzipperInternal {
|
||||
constructor(ab, options) { super(ab, createWorkerFn, options); }
|
||||
constructor(ab, options) { warn(); super(ab, createWorkerFn, options); }
|
||||
}
|
||||
|
||||
export class Unrarrer extends UnrarrerInternal {
|
||||
constructor(ab, options) { super(ab, createWorkerFn, options); }
|
||||
constructor(ab, options) { warn(); super(ab, createWorkerFn, options); }
|
||||
}
|
||||
|
||||
export class Untarrer extends UntarrerInternal {
|
||||
constructor(ab, options) { super(ab, createWorkerFn, options); }
|
||||
constructor(ab, options) { warn(); super(ab, createWorkerFn, options); }
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -83,5 +85,6 @@ export class Untarrer extends UntarrerInternal {
|
|||
* @returns {Unarchiver}
|
||||
*/
|
||||
export function getUnarchiver(ab, options = {}) {
|
||||
warn();
|
||||
return getUnarchiverInternal(ab, createWorkerFn, options);
|
||||
}
|
||||
|
|
|
@ -233,8 +233,8 @@ function getVP09CodecString(stream) {
|
|||
}
|
||||
|
||||
// Add LL hex digits.
|
||||
// TODO: ffprobe is spitting out -99 as level... I'm guessing on LL here.
|
||||
if (stream.level === -99) { frag += '.FF'; }
|
||||
// If ffprobe is spitting out -99 as level... Just return 'vp9'.
|
||||
if (stream.level === -99) { return 'vp9'; }
|
||||
else {
|
||||
const levelAsHex = Number(stream.level).toString(16).toUpperCase().padStart(2, '0');
|
||||
if (levelAsHex.length !== 2) {
|
||||
|
|
2
io/README.md
Normal file
2
io/README.md
Normal file
|
@ -0,0 +1,2 @@
|
|||
These generated files exist because Firefox does not support Worker Modules yet.
|
||||
See https://bugzilla.mozilla.org/show_bug.cgi?id=1247687.
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@codedread/bitjs",
|
||||
"version": "1.0.5",
|
||||
"version": "1.0.6",
|
||||
"description": "Binary Tools for JavaScript",
|
||||
"homepage": "https://github.com/codedread/bitjs",
|
||||
"author": "Jeff Schiller",
|
||||
|
|
|
@ -261,11 +261,7 @@ describe('codecs test suite', () => {
|
|||
info.streams[0].level = -99; // I'm not sure what ffprobe means by this.
|
||||
expect(getFullMIMEString(info))
|
||||
.to.be.a('string')
|
||||
.and.satisfy(s => s.startsWith('video/webm; codecs="vp09.'))
|
||||
.and.satisfy(s => {
|
||||
const matches = s.match(/vp09\.[0-9]{2}\.([0-9A-F]{2})\.[0-9A-F]{2}/);
|
||||
return matches && matches.length === 2 && matches[1] === 'FF';
|
||||
});
|
||||
.and.equals('video/webm; codecs="vp9"');
|
||||
});
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue