</style>
</head>
<body>
- <iframe width="560" height="315" id="audio" src="https://www.youtube.com/embed/B_QCJSTxqfI?controls=0&autoplay=1" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
<div id="timer"></div>
+ <audio id="audio" autoplay>
+ <source id="audio/1.mp4" src="" type="audio/mp3" />
+ </audio>
<video autoplay muted loop id="video">
<source src="video/1.mp4" type="video/mp4">
</video>
var vidElement = document.getElementById('video');
var activeVideo = Math.floor((Math.random() * 4) + 1);
vidElement.src = "video/" + activeVideo + ".mp4";
- vidElement.addEventListener('ended', function(e) {
- // update the active video index
- activeVideo = (++activeVideo) % vidSources.length;
- if(activeVideo === vidSources.length){
- activeVideo = 0;
- }
-
- vidElement.src = vidSources[activeVideo];
- vidElement.play();
- });
- var vid = document.getElementById("video");
- vid.playbackRate = 0.5;
-
- var youtubeIds = ['VG1gcnCVJ8M', 'B_QCJSTxqfI'];
- var youtubeId = youtubeIds[Math.floor(Math.random() * youtubeIds.length)];
- var iframe = document.getElementById('audio');
- iframe.src = "https://www.youtube.com/embed/" + youtubeId + "?controls=0&autoplay=1"
+ var audioElement = document.getElementById('audio');
+ var activeAudio = Math.floor((Math.random() * 2) + 1);
+ audioElement.src = "audio/" + activeAudio + ".webm";
function pad(n, width, z) {
z = z || '0';
function tick() {
var timespan = countdown(null, new Date('January 4, 2021 03:47:00'), countdown.ALL);
var text = timespan.value < 0 ? '<span class="num">Welcome to Perth!</span>' : units.reduce((c, v) => c + formatUnit(timespan, v), "");
- timerElement.innerHTML = text;
- setTimeout(tick, delay);
+ timerElement.innerHTML = text;
+ setTimeout(tick, delay);
}
setTimeout(tick, delay);