Autoplay audio

Autoplay audio

by Ivan Betancor -
Number of replies: 6

Hi guys, so I've manage to hide to audio and getting it to start playing automatically using HTML code but Ipads are giving me a headache and it is not playing the audio. Anyone think of a solution to this? 


<div style="visibility: hidden;">

<p><audio controls="controls" autoplay="autoplay"> <source src="XXXXX.MP3" />

</audio></p>

</div>


Average of ratings: -
In reply to Ivan Betancor

Re: Autoplay audio

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Hi Ivan,
1.- How is this question related to the Quiz activity?
2.- It's never a good idea to force audio or video autoplay on a website.
Average of ratings: Useful (1)
In reply to Joseph Rézeau

Re: Autoplay audio

by Ivan Betancor -
Doing quiz with audio tracks as a listening activity for EFL. This way students can't pause or repeat the audio. I don't see the problem in doing so, except that Ipad aren't implementing it correctly.
In reply to Ivan Betancor

Re: Autoplay audio

by Dominique Bauer -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Ivan,

Try using the browser's native audio player:

Home / Site administration / Plugins / Filters: Manage filters / Multimedia plugins <-- Disabled

Home / Site administration / Plugins / Media players: Manage media players / HTML5 audio <-- Enable (eye open)

See Audio player on MoodleFormulas.org.

In reply to Dominique Bauer

Re: Autoplay audio

by Ivan Betancor -

Have done but no luck, thanks anyways... I'll see if I can instead make it so it plays only once and disable the download option.

In reply to Ivan Betancor

Re: Autoplay audio

by Justin Hunt -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Ivan,

mobile safari and (i think) desktop safari require a user action (ie click or tap) to trigger audio. So implementing auto play is constant battle and I do not recommend it. There are ways to get around this that are used in JS gaming. These use a different system, see: https://howlerjs.com/
But the short answer is really, just give up and let apple win, and require student to click something to play.
Average of ratings: Useful (2)
In reply to Justin Hunt

Re: Autoplay audio

by Ivan Betancor -
Thanks, Justin. After many many attemps at the code... I have given up as you say,

Regards, Ivan