mirror of
https://github.com/LaQuay/TDTChannels.git
synced 2024-11-26 10:49:13 +01:00
add channel options in website
This commit is contained in:
parent
d902d87521
commit
63f86be304
2 changed files with 20 additions and 22 deletions
|
@ -60,6 +60,7 @@
|
|||
<br>
|
||||
<em id="video-resolution"></em>
|
||||
<p id="extra-video-info" style="display: block"></p>
|
||||
<div id="option-buttons"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="audio" style="margin-top: 15px">
|
||||
|
|
|
@ -123,13 +123,6 @@ function getURLsFromPLS(sUrl, fn_callback) {
|
|||
}
|
||||
});
|
||||
fn_callback($urls)
|
||||
|
||||
//$.each($urls, function( index, value ) {
|
||||
// if (checkIfWebsiteWorks(value)) {
|
||||
// fn_callback(value);
|
||||
// break;
|
||||
// }
|
||||
//});
|
||||
});
|
||||
};
|
||||
|
||||
|
@ -166,16 +159,8 @@ function getUrlParameter(sParam) {
|
|||
}
|
||||
};
|
||||
|
||||
// Check an URL is valid or broken
|
||||
// FIXME: For streams if it works it keeps loading infinite time
|
||||
function checkIfWebsiteWorks(sUrl){
|
||||
$.get(sUrl, function(data, status){
|
||||
alert("Data: " + data + "\nStatus: " + status);
|
||||
});
|
||||
}
|
||||
|
||||
function filterChannelsList() {
|
||||
var input, filter, div, li, a, i, txtValue;
|
||||
var input, filter, div, elements, txtValue;
|
||||
|
||||
input = document.getElementById("searchInput");
|
||||
filter = input.value.toUpperCase();
|
||||
|
@ -192,11 +177,24 @@ function filterChannelsList() {
|
|||
}
|
||||
}
|
||||
|
||||
function reproduceChannel(channel_options) {
|
||||
options = channel_options;
|
||||
|
||||
document.getElementById("option-buttons").innerHTML = ""
|
||||
if (options.length == 1) {
|
||||
reproduceVideo(channel['options'][0]['url'])
|
||||
} else if (options.length > 1) {
|
||||
for (i = 0; i < options.length; ++i) {
|
||||
var url = options[i]['url'];
|
||||
document.getElementById("option-buttons").innerHTML +=
|
||||
"<a href='javascript:reproduceVideo(\"" + url + "\")' class='btn btn-secondary btn-sm' style='margin-right: 10px'>Opción " + (i+1) + "</a>";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function onChannelClick(channel) {
|
||||
channel = JSON.parse(channel);
|
||||
reproduceVideo(channel['options'][0]['url'])
|
||||
|
||||
//document.getElementById("titleh1").innerText = document.getElementById("container").offsetWidth
|
||||
reproduceChannel(channel['options'])
|
||||
|
||||
if (document.getElementById("container").offsetWidth < 720) {
|
||||
document.getElementById("video").scrollIntoView({behavior: "smooth", block: "start", inline: "nearest"});
|
||||
|
@ -209,7 +207,6 @@ function loadChannelsInList() {
|
|||
return response.json();
|
||||
})
|
||||
.then(function(myJson) {
|
||||
console.log(myJson);
|
||||
nacionales = myJson[1];
|
||||
|
||||
var items = [];
|
||||
|
|
Loading…
Reference in a new issue