@zappar/mediarecorder 0.1.0 → 0.3.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.
@@ -11,7 +11,14 @@ import { convert } from "./converter";
11
11
  export class ConvertingMediaRecorder extends MediaRecorder {
12
12
  static isTypeSupported(type) {
13
13
  if (type === 'video/mp4') {
14
- return MediaRecorder.isTypeSupported('video/mp4') || MediaRecorder.isTypeSupported('video/webm;codecs="avc1,opus"');
14
+ if (MediaRecorder.isTypeSupported('video/mp4'))
15
+ return true;
16
+ if (!MediaRecorder.isTypeSupported('video/webm;codecs="avc1,opus"')) {
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
21
+ return true;
15
22
  }
16
23
  return MediaRecorder.isTypeSupported(type);
17
24
  }
@@ -19,9 +26,14 @@ export class ConvertingMediaRecorder extends MediaRecorder {
19
26
  let needsConversion = false;
20
27
  let mimeType = options === null || options === void 0 ? void 0 : options.mimeType;
21
28
  if (mimeType === 'video/mp4') {
22
- if (!MediaRecorder.isTypeSupported('video/mp4') && MediaRecorder.isTypeSupported('video/webm;codecs="avc1,opus"')) {
23
- needsConversion = true;
24
- mimeType = 'video/webm;codecs="avc1,opus"';
29
+ if (!MediaRecorder.isTypeSupported('video/mp4')) {
30
+ if (!MediaRecorder.isTypeSupported('video/webm;codecs="avc1,opus"')) {
31
+ console.log("Warning: device doesn't support codec required for @zappar/mediarecorder remuxing ('video/webm;codecs=\"avc1,opus\"')");
32
+ }
33
+ else {
34
+ needsConversion = true;
35
+ mimeType = 'video/webm;codecs="avc1,opus"';
36
+ }
25
37
  }
26
38
  }
27
39
  super(stream, Object.assign(Object.assign({}, options), { mimeType }));
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zappar/mediarecorder",
3
- "version": "0.1.0",
3
+ "version": "0.3.0",
4
4
  "description": "A MediaRecorder polyfill that supports video/mp4 output on both iOS and Android",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./lib/index.d.ts",