Created
October 9, 2012 04:50
-
-
Save jasontucker/3856679 to your computer and use it in GitHub Desktop.
Modify iFrame code to autoplay on Mondays, later I'll narrow it down to 11:00 11:30am
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var $j = jQuery.noConflict(); | |
function changeYoutube() { | |
$j('iframe').each(function () { | |
var that = $j(this); | |
var href = that.attr('src'); | |
if (href.search('youtube.com') != -1) { | |
that.attr('src', href + '&autoplay=1'); | |
// code to get id | |
var tmp = href.split("?"); | |
var tmp2 = tmp[0].split("/"); | |
var ID = tmp2[tmp2.length - 1]; | |
} | |
}); | |
} | |
var now = new Date(); | |
if (now.getDay() == 1) // Monday | |
{ | |
// between 11am and 11:30am | |
//if (now.getHours() == 11 && now.getMinutes() <= 30) | |
//{ | |
$j(document).ready(function () { | |
changeYoutube(); | |
}); | |
// } | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment