Have you developed custom code to only allow audio response only and not video? | Experience Community
Skip to main content

Have you developed custom code to only allow audio response only and not video?

  • April 2, 2026
  • 2 replies
  • 9 views

Forum|alt.badge.img+5

I would only like my respondents to have the option to record audio responses (and no video) but cannot easily do this. Have you developed custom code to achieve this, and if so, would you please share it with me? Thanks in advance!!

2 replies

vgayraud
QPN Level 7 ●●●●●●●
Forum|alt.badge.img+63
  • QPN Level 7 ●●●●●●●
  • April 3, 2026

Hi,

Qualtrics.SurveyEngine.addOnload(function () {
var questionId = this.questionId;

function hideVideoButton(scope) {
var btn = (scope || document).querySelector(".record-button.record-video");
if (btn) {
btn.style.display = 'none';
console.log("Hidden .record-button.record-video", btn);
return true;
}
return false;
}

// Classic layout: hide once on load, no observer needed
var btnClassic = document.querySelector("#" + questionId + " .video-recorder-device-button");
if (btnClassic) {
console.log("Layout: Classic — hiding", btnClassic);
btnClassic.style.display = 'none';
return;
}

// New survey taking experience: target div.video-container
var section = document.getElementById("question-" + questionId);
if (!section) {
console.warn("Section not found for:", questionId);
return;
}

// Initial hide on load
hideButton(section);

var videoContainer = section.querySelector(".video-container");
if (!videoContainer) {
console.warn("video-container not found for:", questionId);
return;
}

var observer = new MutationObserver(function (mutations) {
var hasAdditions = mutations.some(function (m) {
return m.addedNodes.length > 0;
});
if (hasAdditions) {
hideButton(section);
}
});

observer.observe(videoContainer, {
childList: true,
subtree: true
});

console.log("Observer active on:", videoContainer);
observeVideoContainer();

});

 


Forum|alt.badge.img+5
  • Author
  • Level 1 ●
  • April 3, 2026

Thank you, Vincent!