diff --git a/platypush/backend/http/static/js/media.js b/platypush/backend/http/static/js/media.js index 481ea9a3c6..6ee5694c66 100644 --- a/platypush/backend/http/static/js/media.js +++ b/platypush/backend/http/static/js/media.js @@ -339,7 +339,7 @@ $(document).ready(function() { if (subtitlesConf) { populateSubtitlesModal(resource).then((subs) => { if ('language' in subtitlesConf) { - if (subs) { + if (subs && sub.length) { downloadSubtitles(subs[0].SubDownloadLink, resource).then((subtitles) => { _play(resource, subtitles).finally(onVideoReady); resolve(resource, subtitles); @@ -398,7 +398,7 @@ $(document).ready(function() { $mediaSubtitlesResultsContainer.hide(); getSubtitles(resource).then((subs) => { - if (!subs) { + if (!subs || !subs.length) { $mediaSubtitlesMessage.text('No subtitles found'); resolve(); }