Skip to content

Commit

Permalink
fix: handle unimplemented isTypeSupported() method
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisguttandin committed Jun 4, 2020
1 parent c46ca94 commit ce0f6e5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/factories/media-recorder-constructor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ export const createMediaRecorderConstructor: TMediaRecorderConstructorFactory =
} else if (mimeType !== undefined && encoderRegexes.some((regex) => regex.test(mimeType))) {
super();

if (nativeMediaRecorderConstructor !== null && nativeMediaRecorderConstructor.isTypeSupported('audio/webm;codecs=pcm')) {
// Bug #10: Safari does not yet implement the isTypeSupported() method.
if (nativeMediaRecorderConstructor !== null
&& nativeMediaRecorderConstructor?.isTypeSupported('audio/webm;codecs=pcm') === true) {
this._internalMediaRecorder = createWebmPcmMediaRecorder(this, nativeMediaRecorderConstructor, stream, mimeType);
} else {
this._internalMediaRecorder = createWebAudioMediaRecorder(this, stream, mimeType);
Expand Down

0 comments on commit ce0f6e5

Please sign in to comment.