Trying to make audio file play automatically | XM Community
Skip to main content

Hi Team,
Greetings from London!
I was wondering whether anyone managed to make your media file start playing automatically in the survey? I understand Java script is needed to get that accomplished.
The client wants music to start playing as soon as participants enter the survey. I converted a youtube link into an MP3 and added it as my first question but, in order for it to play, participants would need to click the play button. Can I make the music launch itself automatically without being turned on manually?
Thanks in advance for sharing your thoughts!
Karolina

How are you loading the audio in the first question? If you're using html (or iframe, etc.), you need to add the autoplay=true to the html element. If you load the audio via some other method, you can add the autoplay property with jquery.
jQuery('#elementId').css("autoplay","true");
Hope that helps!


Hi Jeremy, huge thanks for your response, I have figured it out and its working!
Thanks a million again,
Karolina


Leave a Reply