jQuery("video").on('play', function() does not run when video is played | XM Community
Skip to main content

Hello,
I'm trying to get a timestamp when a participant starts watching a video. I'm using Vimeo to upload my videos and embed them in the survey. For some reason, the function jQuery("video").on('play', function()  does not run when the video is played. Maybe it is somehow related to using Vimeo?
I'm using the following code:
Qualtrics.SurveyEngine.addOnReady(function()
{
    var s='';
    alert(Date.now())
    jQuery("video").on('play', function() {
alert(Date.now())
      if(s==''){
      s= Date.now();
         Qualtrics.SurveyEngine.setEmbeddedData( 'Vid1PlayTime', s);
      }
    });
});

The on play method works for HTML media elements. The vimeo api exposes other methods, read the docs.


Thank you. Can you please post here a reference of these docs?


https://github.com/vimeo/player.js


Leave a Reply