Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Autoplay issue

  • Goshu77
  • Goshu77's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 months 22 hours ago #257493 by Goshu77
Autoplay issue was created by Goshu77
Please help us help you and fill where relevant:
Your LimeSurvey version: LimeSurvey Version 3.22.15+200505
Own server or LimeSurvey hosting: own server
Survey theme/template: vanilla
==================
Hi everyone,

My office was hired for a survey project in primary schools regarding mental health.
Since some can't read properly, or at least have a harder time to do so, we planned to put audio readings of the questions that starts in autoplay everytime they go to the next page.
The issue is that autoplay does not work on Offline Survey, or in our tablets.

Here is the best I could make work, as a button that allow to listen again :

<button id="Audio" onclick="playPause()">
<audio autoplay="" loop="" src=""> </audio>
Song</button><script>
  var aud = ("Audio").children[0];
  var isPlaying = false;
  ();

  function playPause() {
    if (isPlaying) {
      ();
    } else {
      ();
          }
    isPlaying = !isPlaying;
  }
</script>

Am I doing something wrong?
If not, does someone know a way to make autoplay work?

Thank you very much for your help!

Please Log in to join the conversation.

More
1 month 2 days ago #259003 by opus74
Replied by opus74 on topic Autoplay issue
Hi Goshu77,
I'm having exactly the same problem. Since I have never programmed in limesurvey or used the script tool, could you help me step by step on how you overcame the problem with the button you described. Is it enough to simply put the code in the script or is it necessary to carry out some additional action? 
Thank you very much. 

Please Log in to join the conversation.

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 month 2 days ago #259006 by tpartner
Replied by tpartner on topic Autoplay issue
This is not really a topic for a LimeSurvey forum. It has nothing to do with the survey platform but is more an HTML 5 and web development discussion.

Autoplay is not allowed in most modern browsers unless the media is also muted.

- developer.mozilla.org/en-US/docs/Web/Media/Autoplay_guide

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

Lime-years ahead

Online-surveys for every purse and purpose