Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $('a.introVid').click(function () {
- autoPlayVideo('XGSy3_Czz8k', '420', '345');
- });
- function autoPlayVideo(vcode, width, height) {
- first = true;
- startTime();
- "use strict";
- $("#videoContainer").html('<iframe width="' + width + '" height="' + height + '" src="https://www.youtube.com/embed/' + vcode + '?autoplay=1&loop=1&rel=0&wmode=transparent" frameborder="0" allowfullscreen wmode="Opaque"></iframe>');
- }
- var h1,m1,s1 = 0;
- var first = true;
- function startTime() {
- var today=new Date();
- h=today.getHours();
- m=today.getMinutes();
- s=today.getSeconds();
- if (first)
- {
- h1 = h;
- m1 = m;
- s1 = s;
- first = false;
- }
- h -= h1;
- m -= m1;
- s -= s1;
- m = checkTime(m);
- s = checkTime(s);
- document.getElementById('txt').innerHTML = h + ":" + m + ":" + s;
- var t = setTimeout(function(){startTime()},500);
- }
- function checkTime(i) {
- if (i<10) {i = "0" + i}; // add zero in front of numbers < 10
- return i;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement