diff --git a/script/public/index.js b/script/public/index.js index c9e6a99d..a31f7371 100644 --- a/script/public/index.js +++ b/script/public/index.js @@ -178,17 +178,19 @@ 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 += - "Opción " + (i+1) + ""; + if (channel_options.length > 0) { + reproduceVideo(channel_options[0]['url']) + + if (channel_options.length > 1) { + for (i = 0; i < channel_options.length; ++i) { + var url = channel_options[i]['url']; + document.getElementById("option-buttons").innerHTML += + "Opción " + (i+1) + ""; + } } + } else { + reproduceVideo("no_video_found.m3u8") } }