Autoplay Audio Files Using Loop and Merge | XM Community
Solved

Autoplay Audio Files Using Loop and Merge

  • 15 April 2021
  • 2 replies
  • 157 views

Hello,
I am running an experiment where I need audio files to autoplay without a participant being able to fast forward, rewind, pause, etc. (I.e., autoplay, autostart, no controls). This files need to be randomized, so I am using the loop and merge function. Here is the code I am using:




This code does not work - the audio files will randomly appear, but I am able to pause/play, move around the progress bar, and they do not start playing automatically.
My colleague has used the below code for her video files, which autoplays the videos without the participant being able to manipulate them.





When I try and adapt it for audio files, it still doesn't work.
 





I could really use some help. Thanks in advance!

icon

Best answer by sreisma1 15 April 2021, 23:19

View original

2 replies

Userlevel 7
Badge +21

Try this:


    

        
            
            

                

            

        
    



You can delete
controls="true"
to remove the controls from the display, however, since its an audio file, you won't see anyhting. That's why add
pointer-events:none
to disable clicks.

Thank you! the pointer events disable command helped. The above did not autoplay, however when I added

autoplay = "true"
it worked perfectly. Thanks!
Final below for those curious:

    

        
            
            

                

            

        
    



Leave a Reply