Skip to content

Commit 726feee

Browse files
committed
1.0.6: Return 'vp9' for the video codec in getFullMIMEString(). Also move the annoying warning in deprecated archive.js.
1 parent d3b8765 commit 726feee

File tree

6 files changed

+16
-14
lines changed

6 files changed

+16
-14
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,8 @@ ISO RFC6381 MIME type strings, including the codec information. Currently suppor
102102
of MP4 and WEBM.
103103

104104
How to use:
105-
105+
* First, install ffprobe (ffmpeg) on your system.
106+
* Then:
106107
```javascript
107108

108109
import { getFullMIMEString } from 'bitjs/codecs/codecs.js';

archive/archive.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ import { UnarchiveAppendEvent, UnarchiveErrorEvent, UnarchiveEvent, UnarchiveEve
1515
UnrarrerInternal, UntarrerInternal, UnzipperInternal,
1616
getUnarchiverInternal } from './decompress-internal.js';
1717

18-
console.warn(`Stop using archive.js and use decompress.js instead. This module will be removed.`);
19-
2018
export {
2119
UnarchiveAppendEvent,
2220
UnarchiveErrorEvent,
@@ -58,18 +56,22 @@ export {
5856

5957
const createWorkerFn = (scriptFilename) => new Worker(scriptFilename);
6058

59+
function warn() {
60+
console.warn(`Stop using archive.js and use decompress.js instead. This module will be removed.`);
61+
}
62+
6163
// Thin wrappers of unarchivers for clients who want to construct a specific
6264
// unarchiver themselves rather than use getUnarchiver().
6365
export class Unzipper extends UnzipperInternal {
64-
constructor(ab, options) { super(ab, createWorkerFn, options); }
66+
constructor(ab, options) { warn(); super(ab, createWorkerFn, options); }
6567
}
6668

6769
export class Unrarrer extends UnrarrerInternal {
68-
constructor(ab, options) { super(ab, createWorkerFn, options); }
70+
constructor(ab, options) { warn(); super(ab, createWorkerFn, options); }
6971
}
7072

7173
export class Untarrer extends UntarrerInternal {
72-
constructor(ab, options) { super(ab, createWorkerFn, options); }
74+
constructor(ab, options) { warn(); super(ab, createWorkerFn, options); }
7375
}
7476

7577
/**
@@ -83,5 +85,6 @@ export class Untarrer extends UntarrerInternal {
8385
* @returns {Unarchiver}
8486
*/
8587
export function getUnarchiver(ab, options = {}) {
88+
warn();
8689
return getUnarchiverInternal(ab, createWorkerFn, options);
8790
}

codecs/codecs.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,8 +233,8 @@ function getVP09CodecString(stream) {
233233
}
234234

235235
// Add LL hex digits.
236-
// TODO: ffprobe is spitting out -99 as level... I'm guessing on LL here.
237-
if (stream.level === -99) { frag += '.FF'; }
236+
// If ffprobe is spitting out -99 as level... Just return 'vp9'.
237+
if (stream.level === -99) { return 'vp9'; }
238238
else {
239239
const levelAsHex = Number(stream.level).toString(16).toUpperCase().padStart(2, '0');
240240
if (levelAsHex.length !== 2) {

io/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
These generated files exist because Firefox does not support Worker Modules yet.
2+
See https://bugzilla.mozilla.org/show_bug.cgi?id=1247687.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@codedread/bitjs",
3-
"version": "1.0.5",
3+
"version": "1.0.6",
44
"description": "Binary Tools for JavaScript",
55
"homepage": "https://github.com/codedread/bitjs",
66
"author": "Jeff Schiller",

tests/codecs.spec.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -261,11 +261,7 @@ describe('codecs test suite', () => {
261261
info.streams[0].level = -99; // I'm not sure what ffprobe means by this.
262262
expect(getFullMIMEString(info))
263263
.to.be.a('string')
264-
.and.satisfy(s => s.startsWith('video/webm; codecs="vp09.'))
265-
.and.satisfy(s => {
266-
const matches = s.match(/vp09\.[0-9]{2}\.([0-9A-F]{2})\.[0-9A-F]{2}/);
267-
return matches && matches.length === 2 && matches[1] === 'FF';
268-
});
264+
.and.equals('video/webm; codecs="vp9"');
269265
});
270266
});
271267

0 commit comments

Comments
 (0)