Skip to content

Instantly share code, notes, and snippets.

@SteveEdson
Created October 15, 2014 08:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SteveEdson/7caeaef87fd105add9a5 to your computer and use it in GitHub Desktop.
Save SteveEdson/7caeaef87fd105add9a5 to your computer and use it in GitHub Desktop.
<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>
// 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