Welcome, Guest
Username: Password: Remember me

TOPIC: Embedding audio in questions: limiting number of times audio clip can be heard

Embedding audio in questions: limiting number of times audio clip can be heard 1 year 1 month ago #96479

  • StuTheQ
  • StuTheQ's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 26
  • Karma: 0
Hello everybody,

Let's imagine that I have an audio clip that I want the respondent to listen to.

I begin by embedding the following code (basic example copied from the 'Embedding audio in questions' workaround in the 'Workarounds: Question design, layout and templating' section of the manual) in the question text itself:
<embed height="20" width="128" autostart="false" controls="console"
 
loop="true" volume="50" src="{TEMPLATEURL}audio_1.mp3"></embed>

Is there then a way of limiting the number of times that the respondent can listen to the audio clip? (twice only, for example)

In addition, the respondent should ideally not be able to 'pause' or 'rewind' the audio clip once it has started playing (I'm not asking for much here!! :) )

Thank you all very much in advance!

Regards,

StuTheQ
The administrator has disabled public write access.

Embedding audio in questions: limiting number of times audio clip can be heard 1 year 1 month ago #96487

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4049
  • Thank you received: 739
  • Karma: 341
You won't be able to achieve that with a plain <embed> element but you should be able to do it if you use a plugin like jPlayer to serve the audio files - www.limesurvey.org/en/forum/can-i-do-thi...reaming-advice#94628

You can use the jPlayer "ended" event to increment a counter and destroy the player after two loops.

Preventing pause or rewind would simply be a matter of removing those controls from the jPlayer skin.
Cheers,
Tony Partner

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

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.
The following user(s) said Thank You: StuTheQ

Embedding audio in questions: limiting number of times audio clip can be heard 1 year 1 month ago #96503

  • StuTheQ
  • StuTheQ's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 26
  • Karma: 0
Dear Tony,

Thank you once again for replying to my query.

In fact, after further research/reading concerning this topic, I was about to delete my my post. From what I've now discovered, it seems that embedding audio is not a LimeSurvey functionality as such, but more an HTML or plugin question... :whistle:

I also saw that, as you said, it's quite straightforward to add or remove controls to/from the 'console'.

Flowplayer had caught my eye but I'll definitely check out jPlayer, all the more so given that that there is your post www.limesurvey.org/en/forum/can-i-do-thi...reaming-advice#94628 explaining how to implement it! :)

Regards,

Stu
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.196 seconds
Donation Image