Created
October 15, 2014 08:30
-
-
Save SteveEdson/7caeaef87fd105add9a5 to your computer and use it in GitHub Desktop.
// source http://jsbin.com/kedoxecuyesu/1
This file contains hidden or 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
<script src="http://code.jquery.com/jquery-1.11.1.min.js"></script><div id="dc-vadio-wrapper" class="dc-video-on"></div> | |
<script id="jsbin-javascript"> | |
// Define base url | |
var url = "https://www.vadio.com:443/embed.php?id=dc-vadio-wrapper&stream="; | |
// Get current hour | |
var hour = new Date().getHours; | |
// Select the appropriate stream | |
var stream; | |
if (hour > 06 && hour < 19) { | |
stream = "utvnet"; | |
} else { | |
stream = "SIG1"; | |
} | |
url += stream; // Append the stream to the url | |
// Load Vadio Script | |
$.getScript(url, function(data, textStatus, jqxhr) { | |
console.log("Loaded"); | |
}); | |
// Make sure user stays on correct player | |
setInterval(function() { | |
// Update current hour | |
hour = new Date().getHours; | |
// If between specified times, and not already on utvnet stream | |
if ((hour > 06 && hour < 19) && stream != "utvnet") { | |
window.location.reload(); // Refresh the page | |
} else if(stream != "SIG1") { // If not in network hour, and stream isn't SIG1 | |
window.location.reload(); // Refresh the page | |
} | |
}, 2000); // Refresh every 2 seconds | |
</script> | |
<script id="jsbin-source-html" type="text/html"><script src="//code.jquery.com/jquery-1.11.1.min.js"><\/script><div id="dc-vadio-wrapper" class="dc-video-on"></div></script> | |
<script id="jsbin-source-javascript" type="text/javascript">// Define base url | |
var url = "https://www.vadio.com:443/embed.php?id=dc-vadio-wrapper&stream="; | |
// Get current hour | |
var hour = new Date().getHours; | |
// Select the appropriate stream | |
var stream; | |
if (hour > 06 && hour < 19) { | |
stream = "utvnet"; | |
} else { | |
stream = "SIG1"; | |
} | |
url += stream; // Append the stream to the url | |
// Load Vadio Script | |
$.getScript(url, function(data, textStatus, jqxhr) { | |
console.log("Loaded"); | |
}); | |
// Make sure user stays on correct player | |
setInterval(function() { | |
// Update current hour | |
hour = new Date().getHours; | |
// If between specified times, and not already on utvnet stream | |
if ((hour > 06 && hour < 19) && stream != "utvnet") { | |
window.location.reload(); // Refresh the page | |
} else if(stream != "SIG1") { // If not in network hour, and stream isn't SIG1 | |
window.location.reload(); // Refresh the page | |
} | |
}, 2000); // Refresh every 2 seconds</script> |
This file contains hidden or 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
// Define base url | |
var url = "https://www.vadio.com:443/embed.php?id=dc-vadio-wrapper&stream="; | |
// Get current hour | |
var hour = new Date().getHours; | |
// Select the appropriate stream | |
var stream; | |
if (hour > 06 && hour < 19) { | |
stream = "utvnet"; | |
} else { | |
stream = "SIG1"; | |
} | |
url += stream; // Append the stream to the url | |
// Load Vadio Script | |
$.getScript(url, function(data, textStatus, jqxhr) { | |
console.log("Loaded"); | |
}); | |
// Make sure user stays on correct player | |
setInterval(function() { | |
// Update current hour | |
hour = new Date().getHours; | |
// If between specified times, and not already on utvnet stream | |
if ((hour > 06 && hour < 19) && stream != "utvnet") { | |
window.location.reload(); // Refresh the page | |
} else if(stream != "SIG1") { // If not in network hour, and stream isn't SIG1 | |
window.location.reload(); // Refresh the page | |
} | |
}, 2000); // Refresh every 2 seconds |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment