How to record how many times a participant has replayed a mp4 video? | XM Community
Skip to main content

Hi! I've searched for custom code to get the information from replay video and I couldn't find an exact answer.
(I've tried both of these:
https://community.qualtrics.com/XMcommunity/discussion/2832/how-to-record-how-many-times-a-participant-has-replayed-a-video
https://stackoverflow.com/questions/48492796/javascript-to-track-how-many-times-an-audio-video-file-is-played-in-qualtrics)
I've embedded a mp4 video in my survey and I want to check how many times the participant has clicked play on the video. Is there a way to record how many times they hit play?
Thank you!

Just set an embedded/ increment the value whenever the respondent clicks on play button.

example:
if(jQuery('#QID17 a').data('clicked', false))
{

errCnt+=1;
console.log(errCnt)


var vid = document.getElementById("audi_player");
var i=0; 

vid.onplaying = function() {
  i=1;
var actual_click=i;
//console.log("played"+ i)
//alert("The video is now playing");
Qualtrics.SurveyEngine.setEmbeddedData('Q1_click',actual_click)


};


Thank you!


Do you put this code in the html or java?


Leave a Reply