Skip to content

Commit f2d03aa

Browse files
author
Egor Didenko
committed
feat(camera-tab): fallback for mimeType
1 parent 6cd4186 commit f2d03aa

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

blocks/CameraSource/CameraSource.js

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -215,24 +215,12 @@ export class CameraSource extends UploaderBlock {
215215
...this.cfg.mediaRecorerOptions,
216216
};
217217

218-
const isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1;
219-
220218
if (
221219
this.cfg.mediaRecorerOptions?.mimeType &&
222220
MediaRecorder.isTypeSupported(this.cfg.mediaRecorerOptions.mimeType)
223221
) {
224222
this._options.mimeType = this.cfg.mediaRecorerOptions.mimeType;
225-
} else if (
226-
isFirefox &&
227-
this.cfg.mediaRecorerOptions?.mimeType &&
228-
MediaRecorder.isTypeSupported(this.cfg.mediaRecorerOptions.mimeType)
229-
) {
230-
const mimeType = this.cfg.mediaRecorerOptions?.mimeType;
231-
232-
if (mimeType && !MediaRecorder.isTypeSupported(mimeType)) {
233-
throw new Error(`MIME type ${mimeType} is not supported`);
234-
}
235-
223+
} else {
236224
this._options.mimeType = DEFAULT_VIDEO_FORMAT;
237225
}
238226

0 commit comments

Comments
 (0)