How do I hide the length of an audio file in a survey? | XM Community
Skip to main content
In my surveys, I am trying to hide the length of the audio that I upload, because I'll be asking the participants how long they perceive the video to be.

I think you could use CSS to hide the progress bar and duration and then reduce the size of the audio element. The webkit piece doesn’t for Firefox but reducing the width looks to be all that's needed to hide the duration.

audio::-webkit-media-controls-timeline,
audio::-webkit-media-controls-current-time-display,
audio::-webkit-media-controls-time-remaining-display {
display: none;
}

audio {
width: 150px;
}

@-moz-document url-prefix() {
audio {
width: 100px;
}
}

Also, rondev recommends in this thread that you could trigger the audio by clicking an image. Below is that code for reference since the html piece isn't displaying right:


Use below code to put audio with hidden control, in HTML view question text:

<audio control="" hidden="true">
<source src="https://www.w3schools.com/html/horse.mp3" type="audio/mpeg">
Your browser does not support the audio element.
</audio>

Put an image in the question text and then add below code to play audio on image click:

jQuery("img").on('click',function(){
jQuery('audio').trigger("play");
});

 


Leave a Reply