Skip to content

Commit 7dee88c

Browse files
authored
Merge pull request #2991 from bbonf/fix-audio-mimetype
fix for wrong audio mimetype preventing playback in Safari
2 parents ce30fca + 5ab4cc7 commit 7dee88c

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.changeset/pink-ducks-think.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@jspsych/plugin-html-audio-response": patch
3+
---
4+
5+
uses mimetype of audio recorded for playback instead of defaulting to webm

packages/plugin-html-audio-response/src/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ class HtmlAudioResponsePlugin implements JsPsychPlugin<Info> {
182182
};
183183

184184
this.stop_event_handler = () => {
185-
const data = new Blob(this.recorded_data_chunks, { type: "audio/webm" });
185+
const data = new Blob(this.recorded_data_chunks, { type: this.recorded_data_chunks[0].type });
186186
this.audio_url = URL.createObjectURL(data);
187187
const reader = new FileReader();
188188
reader.addEventListener("load", () => {

0 commit comments

Comments
 (0)