diff --git a/webroot/js/player.js b/webroot/js/player.js
index 3c82359..e698ff2 100644
--- a/webroot/js/player.js
+++ b/webroot/js/player.js
@@ -225,8 +225,9 @@ window.addEventListener('DOMContentLoaded', (event) => {
}
function isFormatSupported(fmt) {
- if (!['http', 'https'].includes(fmt.protocol))
- return false;
+ //// currently, we remove other formats in the backend
+ //if (!['http', 'https'].includes(fmt.protocol))
+ // return false;
// must be very old: https://developer.mozilla.org/en-US/docs/Web/API/MediaSource/isTypeSupported#browser_compatibility
if (!('MediaSource' in window)) {
@@ -304,4 +305,19 @@ window.addEventListener('DOMContentLoaded', (event) => {
document.querySelector('#autoplayInput').checked = true;
playbackWait();
}
+
+ // formats
+
+ console.log("w dzisiejszym menu")
+
+ formats.forEach((e) => {
+ if (e.acodec == "none") {
+ console.log(`- ${e.format_id}, czyli ${e.height}p`)
+ } else if (e.vcodec == "none") {
+ console.log(`- ${e.format_id}, czyli ${e.acodec} ${e.abr}kbps`)
+ } else {
+ console.log(`A TAKŻE SPECJALNEGO GOŚCIA ${e.format_id}, czyli ${e.height}p WRAZ Z RODZINĄ`)
+ }
+ })
+
});
diff --git a/webroot/watch.shs b/webroot/watch.shs
index b7899f0..f00ce0c 100755
--- a/webroot/watch.shs
+++ b/webroot/watch.shs
@@ -29,16 +29,7 @@ if [[ "${get_data[v]}" ]]; then
"width": 640,
"ext": "webm",
"vcodec": "vp8",
- "acodec": "vorbis",
- "format": "44 - 640x480 (480p)",
- "protocol": "https",
- "http_headers": {
- "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.54 Safari/537.36",
- "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7",
- "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
- "Accept-Encoding": "gzip, deflate",
- "Accept-Language": "en-us,en;q=0.5"
- }
+ "acodec": "vorbis"
}]'
if [[ "${r[host]}" == "${cfg[flash_host]}" ]]; then
url='http://f.sakamoto.pl/videoplayback_.flv'
@@ -85,7 +76,7 @@ if [[ "${get_data[v]}" ]]; then
- "''
source templates/head.sh
fi
- formats=$(jq '.formats' <<< "$video")
+ formats=$(jq -c '[.formats[] | select(.protocol == "https") | {"format_id":.format_id,"url":.url,"ext":.ext,"width":.width,"height":.height,"acodec":.acodec,"vcodec":.vcodec,"abr":.abr,"fps":.fps}]' <<< "$video")
fi
if [[ "${r[host]}" == "${cfg[flash_host]}" ]]; then