Skip to content

Commit 67617a8

Browse files
committed
fix: mime type settings for audio recording #685
1 parent 3ccd3fd commit 67617a8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

projects/stream-chat-angular/src/lib/voice-recorder/audio-recorder.service.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { Injectable, NgModule } from '@angular/core';
22
import { AmplitudeRecorderService } from './amplitude-recorder.service';
3-
import { isSafari } from '../is-safari';
43
import { MediaRecorderConfig, MultimediaRecorder } from './media-recorder';
54
import { NotificationService } from '../notification.service';
65
import { ChatClientService } from '../chat-client.service';
@@ -21,7 +20,9 @@ export class AudioRecorderService extends MultimediaRecorder<
2120
* - For all other browsers we use audio/webm (which is then transcoded to wav)
2221
*/
2322
config: MediaRecorderConfig = {
24-
mimeType: isSafari() ? 'audio/mp4;codecs=mp4a.40.2' : 'audio/webm',
23+
mimeType: MediaRecorder.isTypeSupported('audio/webm')
24+
? 'audio/webm'
25+
: 'audio/mp4;codecs=mp4a.40.2', // fallback for Safari
2526
};
2627

2728
constructor(

0 commit comments

Comments
 (0)