How to restrict the number of times participants can play audio | Experience Community
Skip to main content
Solved

How to restrict the number of times participants can play audio

  • Oct 28, 2018 3:25 PM UTC
  • 4 replies
  • 278 views

Hello all! Does anyone know how to restrict the number of times participants can play audio attached to a question? I would like my participants to hear each fragment only once. However, I do not want to remove the play button and let the sound autoplay, because they should have some time to read the question before they play the sound fragment. I hope to hear from someone! Thanks in advance :) Joy

Best answer by emilym

Hi Joy, I'm working on a similar problem. You can also modify Shashi's code a bit to hide the media player instead of disabling clicking, which might be more comfortable for your users: ` jQuery('audio').on('ended', function() { jQuery(this).hide(); }); `
View original

4 replies

  • Oct 28, 2018 5:13 PM UTC
Hello @joyhuijskens , Paste the following code in the js(onReady) of the question jQuery('audio').on('ended', function() { jQuery(this).css("pointer-events","none"); });

  • Answer
  • Oct 29, 2018 4:59 PM UTC
Hi Joy, I'm working on a similar problem. You can also modify Shashi's code a bit to hide the media player instead of disabling clicking, which might be more comfortable for your users: ` jQuery('audio').on('ended', function() { jQuery(this).hide(); }); `

Thank you both for your replies! I will try to make this work:) Unfortunatly I am very inexperienced in programming - so I nee da little more information. Where exactly do I paste this in..? In the htmltext of each question.. and then in what line? Or where can i open the java script? I am curious to hear from you!

  • Oct 29, 2018 6:28 PM UTC
> @joyhuijskens said: > Thank you both for your replies! I will try to make this work:) Unfortunatly I am very inexperienced in programming - so I nee da little more information. Where exactly do I paste this in..? In the htmltext of each question.. and then in what line? Or where can i open the java script? > I am curious to hear from you! Follow this page to add the code in each page Put in `OnReady` function