diff --git a/src/core/features/fileuploader/components/audio-recorder/audio-recorder.component.ts b/src/core/features/fileuploader/components/audio-recorder/audio-recorder.component.ts index 184558e6b..d24111752 100644 --- a/src/core/features/fileuploader/components/audio-recorder/audio-recorder.component.ts +++ b/src/core/features/fileuploader/components/audio-recorder/audio-recorder.component.ts @@ -93,32 +93,48 @@ export class CoreFileUploaderAudioRecorderComponent extends CoreModalComponent { - const media = await this.createMedia(); + try { + const media = await this.createMedia(); - this.media$.next(media); + this.media$.next(media); - media.recorder.start(); + media.recorder.start(); + } catch (error) { + CoreDomUtils.showErrorModal(error); + } } /** * Stop recording. */ stopRecording(): void { - this.media$.value?.recorder.stop(); + try { + this.media$.value?.recorder.stop(); + } catch (error) { + CoreDomUtils.showErrorModal(error); + } } /** * Stop recording. */ pauseRecording(): void { - this.media$.value?.recorder.pause(); + try { + this.media$.value?.recorder.pause(); + } catch (error) { + CoreDomUtils.showErrorModal(error); + } } /** * Stop recording. */ resumeRecording(): void { - this.media$.value?.recorder.resume(); + try { + this.media$.value?.recorder.resume(); + } catch (error) { + CoreDomUtils.showErrorModal(error); + } } /** @@ -143,15 +159,19 @@ export class CoreFileUploaderAudioRecorderComponent extends CoreModalComponent