diff --git a/webroot/js/player.js b/webroot/js/player.js index b37df45..892f25f 100644 --- a/webroot/js/player.js +++ b/webroot/js/player.js @@ -111,7 +111,7 @@ window.addEventListener('DOMContentLoaded', (event) => { } const formats = JSON.parse(document.getElementById('yt_formats').innerText) - .filter((fmt) => !['m3u8'].includes(fmt.protocol)) + .filter((fmt) => ['http', 'https'].includes(fmt.protocol)) .sort((a, b) => { if (a.vcodec === 'none' && b.vcodec !== 'none') { return -1; @@ -129,6 +129,8 @@ window.addEventListener('DOMContentLoaded', (event) => { console.log(formats); const videoFormat = formats.find((fmt) => fmt.vcodec !== 'none'); const audioFormat = videoFormat.acodec === 'none' ? formats.find((fmt) => fmt.acodec !== 'none') : null; + console.log('selected video format', videoFormat); + console.log('selected audio format', audioFormat); video.src = videoFormat.url; if (audioFormat) {