@zappar/mediarecorder 0.4.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/encoder.js +3 -2
- package/lib/mediarecorder.js +5 -14
- package/lib/webmtransmux.wasm +0 -0
- package/package.json +2 -1
package/lib/encoder.js
CHANGED
|
@@ -7,7 +7,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
|
|
10
|
+
import HME from "./webmtransmux";
|
|
11
11
|
let promise;
|
|
12
12
|
export function initialize(wasmUrl) {
|
|
13
13
|
promise = new Promise(resolve => {
|
|
@@ -19,7 +19,8 @@ export function initialize(wasmUrl) {
|
|
|
19
19
|
return prefix + path;
|
|
20
20
|
},
|
|
21
21
|
onRuntimeInitialized: () => {
|
|
22
|
-
|
|
22
|
+
if ('then' in module)
|
|
23
|
+
delete module.then;
|
|
23
24
|
resolve(module);
|
|
24
25
|
}
|
|
25
26
|
});
|
package/lib/mediarecorder.js
CHANGED
|
@@ -11,13 +11,9 @@ import { convert } from "./converter";
|
|
|
11
11
|
export class ConvertingMediaRecorder extends MediaRecorder {
|
|
12
12
|
static isTypeSupported(type) {
|
|
13
13
|
if (type === 'video/mp4') {
|
|
14
|
-
if (MediaRecorder.isTypeSupported('video/
|
|
14
|
+
if (MediaRecorder.isTypeSupported('video/webm;codecs="avc1,opus"'))
|
|
15
15
|
return true;
|
|
16
|
-
if (
|
|
17
|
-
console.log("Warning: device doesn't support codec required for @zappar/mediarecorder remuxing ('video/webm;codecs=\"avc1,opus\"')");
|
|
18
|
-
return false;
|
|
19
|
-
}
|
|
20
|
-
else
|
|
16
|
+
if (MediaRecorder.isTypeSupported('video/mp4'))
|
|
21
17
|
return true;
|
|
22
18
|
}
|
|
23
19
|
return MediaRecorder.isTypeSupported(type);
|
|
@@ -26,14 +22,9 @@ export class ConvertingMediaRecorder extends MediaRecorder {
|
|
|
26
22
|
let needsConversion = false;
|
|
27
23
|
let mimeType = options === null || options === void 0 ? void 0 : options.mimeType;
|
|
28
24
|
if (mimeType === 'video/mp4') {
|
|
29
|
-
if (
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
else {
|
|
34
|
-
needsConversion = true;
|
|
35
|
-
mimeType = 'video/webm;codecs="avc1,opus"';
|
|
36
|
-
}
|
|
25
|
+
if (MediaRecorder.isTypeSupported('video/webm;codecs="avc1,opus"')) {
|
|
26
|
+
needsConversion = true;
|
|
27
|
+
mimeType = 'video/webm;codecs="avc1,opus"';
|
|
37
28
|
}
|
|
38
29
|
}
|
|
39
30
|
super(stream, Object.assign(Object.assign({}, options), { mimeType }));
|
package/lib/webmtransmux.wasm
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zappar/mediarecorder",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "A MediaRecorder polyfill that supports video/mp4 output on both iOS and Android",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
|
+
"type": "module",
|
|
6
7
|
"types": "./lib/index.d.ts",
|
|
7
8
|
"scripts": {
|
|
8
9
|
"tests": "parcel --https tests/index.html",
|