mirror of
https://github.com/jspsych/jsPsych.git
synced 2025-05-10 11:10:54 +00:00
Merge pull request #2991 from bbonf/fix-audio-mimetype
fix for wrong audio mimetype preventing playback in Safari
This commit is contained in:
commit
7dee88ca01
5
.changeset/pink-ducks-think.md
Normal file
5
.changeset/pink-ducks-think.md
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"@jspsych/plugin-html-audio-response": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
uses mimetype of audio recorded for playback instead of defaulting to webm
|
@ -182,7 +182,7 @@ class HtmlAudioResponsePlugin implements JsPsychPlugin<Info> {
|
|||||||
};
|
};
|
||||||
|
|
||||||
this.stop_event_handler = () => {
|
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);
|
this.audio_url = URL.createObjectURL(data);
|
||||||
const reader = new FileReader();
|
const reader = new FileReader();
|
||||||
reader.addEventListener("load", () => {
|
reader.addEventListener("load", () => {
|
||||||
|
Loading…
Reference in New Issue
Block a user