Skip to content

Commit

Permalink
fix: mime type settings for audio recording #685
Browse files Browse the repository at this point in the history
  • Loading branch information
szuperaz committed Feb 10, 2025
1 parent 3ccd3fd commit 67617a8
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Injectable, NgModule } from '@angular/core';
import { AmplitudeRecorderService } from './amplitude-recorder.service';
import { isSafari } from '../is-safari';
import { MediaRecorderConfig, MultimediaRecorder } from './media-recorder';
import { NotificationService } from '../notification.service';
import { ChatClientService } from '../chat-client.service';
Expand All @@ -21,7 +20,9 @@ export class AudioRecorderService extends MultimediaRecorder<
* - For all other browsers we use audio/webm (which is then transcoded to wav)
*/
config: MediaRecorderConfig = {
mimeType: isSafari() ? 'audio/mp4;codecs=mp4a.40.2' : 'audio/webm',
mimeType: MediaRecorder.isTypeSupported('audio/webm')
? 'audio/webm'
: 'audio/mp4;codecs=mp4a.40.2', // fallback for Safari
};

constructor(
Expand Down

0 comments on commit 67617a8

Please # to comment.