This works too -
Qualtrics.SurveyEngine.addOnReady(function() {
var qobj = this;
qobj.hideNextButton(); // Hide the Next button initially
// Get the video element
var video = document.getElementById('myVideo');
// Variable to track whether the video was played completely
var videoPlayedToEnd = false;
// Disable video controls
video.controls = false;
// Enable autoplay
video.autoplay = true;
// Add event listeners to handle video events
video.addEventListener('ended', function() {
// When the video ends, set the flag to true
videoPlayedToEnd = true;
// Show the Next button if the video was played properly
if (videoPlayedToEnd) {
qobj.showNextButton();
}
}, false);
// Check if autoplay is supported by the browser
var autoplaySupported = video.autoplay === true || video.hasOwnProperty('playsInline');
// If autoplay is not supported, show a warning
if (!autoplaySupported) {
console.warn('Autoplay is not supported in this browser. Please click the play button to start the video.');
}
});
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.