Momentan verwende ich für den Countdown diesen Code:
<script type="text/ja
vascript">
<!--
var countdown = 49;
var countdownDisplay;
var countdownTimer;
// "submit0" ist der Weiter-Knopf,
// mit "buttonsAuto" kann man auch den Zurück-Knopf ausblenden
var buttonID = "submit0";
function countdownStart() {
// Next button
var button = document.getElementById(buttonID);
// Create countdown element
countdownDisplay = document.createElement("div");
var cd = countdownDisplay;
cd.style.display = "inline-block";
cd.style.textAlign = "center";
cd.style.fontWeight = "bold";
cd.style.width = button.offsetWidth + "px";
cd.style.height = button.offsetHeight + "px";
// Init countdown
button.parentNode.appendChild(countdownDisplay);
countdownRefresh();
// Hide next button
button.style.display = "none";
// Start countdown
countdownTimer = window.setInterval(countDown, 1000);
}
function countDown() {
if (countdown > 1) {
countdown--;
countdownRefresh();
} else {
window.clearTimeout(countdownTimer);
// Display nextbutton
var button = document.getElementById(buttonID);
button.style.display = "";
// Remove countdown
button.parentNode.removeChild(countdownDisplay);
}
}
function countdownRefresh() {
// Clear
while (countdownDisplay.lastChild) {
countdownDisplay.removeChild(countdownDisplay.lastChild);
}
// Display
var content = document.createTextNode(countdown + " Sek.");
countdownDisplay.appendChild(content );
}
SoSciTools.attachEvent(window, "load", countdownStart);
// -->
</script>
Und hier der HTML Code des Videos:
<div style="text-align: center"><iframe width="560" height="315" src="https://www.youtube.com/embed/mfn9CGfksjY" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe></div>