1
0
Fork 0
mirror of https://github.com/LaQuay/TDTChannels.git synced 2024-11-01 07:01:12 +01:00
TDTChannels/script/public/index.js

32 lines
997 B
JavaScript
Raw Normal View History

2018-12-13 19:21:15 +01:00
function getResolution(from, fn_callback) {
2018-12-13 16:11:47 +01:00
$.get(from, function(data) {
$response = data.split("\n");
$resolutions=[];
$.each($response, function( index, value ) {
$line_separated_value = value.split(",");
for (i = 0; i < $line_separated_value.length; i++) {
if ($line_separated_value[i].indexOf("RESOLUTION=") != -1) {
$resolutions.push($line_separated_value[i].split('=')[1]);
}
}
});
2018-12-13 19:21:15 +01:00
fn_callback($resolutions);
2018-12-13 16:11:47 +01:00
});
}
function getUrlParameter(sParam) {
var sPageURL = decodeURIComponent(window.location.search.substring(1)),
sURLVariables = sPageURL.split('&'),
sParameterName,
i;
for (i = 0; i < sURLVariables.length; i++) {
sParameterName = sURLVariables[i].split('=');
if (sParameterName[0] === sParam) {
return sParameterName[1] === undefined ? true : sParameterName[1];
}
}
};