Hugo Silva
Hugo Silva

Reputation: 199

Qualtrics, next button appear after video started

I'm new with Qualtrics, and I'm wondering if there is a way of creating a rule with javascript for the next button to appear only if a video is played or when fully watched?

I have this code but only with a timer

Qualtrics.SurveyEngine.addOnReady(
    function() { 
        var delayTime = 7000 //This is the time of delay
        var that = this; 
        $('NextButton').hide();
        $('PreviousButton').hide();
        setTimeout(function(){ 
           $('NextButton').show();
           $('PreviousButton').show();
        },
        delayTime
        );
    });

Thanks in advance

Upvotes: 0

Views: 239

Answers (1)

T. Gibbons
T. Gibbons

Reputation: 5004

Are you using an html5 video tag? If so, you can use an 'ended' handler:

jQuery("#"+this.questionId+" video").on("ended", function() {
      $('NextButton').show();
      $('PreviousButton').show();
});

Upvotes: 1

Related Questions