From cc1ca257f5832a3d73ccae6bc700e9a9fe7ca695 Mon Sep 17 00:00:00 2001 From: ben Date: Fri, 24 Mar 2023 11:43:55 +0100 Subject: [PATCH] fix for wrong audio mimetype preventing playback in Safari --- packages/plugin-html-audio-response/src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/plugin-html-audio-response/src/index.ts b/packages/plugin-html-audio-response/src/index.ts index dfe602a7..22e63f36 100644 --- a/packages/plugin-html-audio-response/src/index.ts +++ b/packages/plugin-html-audio-response/src/index.ts @@ -133,7 +133,7 @@ class HtmlAudioResponsePlugin implements JsPsychPlugin { }; this.stop_event_handler = () => { - const data = new Blob(this.recorded_data_chunks, { type: "audio/webm" }); + const data = new Blob(this.recorded_data_chunks, { type: this.recorded_data_chunks[0].type }); this.audio_url = URL.createObjectURL(data); const reader = new FileReader(); reader.addEventListener("load", () => {