+ better quality picker \o/
parent
30d2fbee70
commit
ea1c7330ae
|
@ -161,11 +161,12 @@ window.addEventListener('DOMContentLoaded', (event) => {
|
|||
menu.style.display = "block";
|
||||
}
|
||||
}
|
||||
|
||||
let autoplayInput = document.querySelector('#autoplayInput');
|
||||
let videoStreamInput = document.querySelector('#videoStreamInput');
|
||||
let audioStreamInput = document.querySelector('#audioStreamInput');
|
||||
|
||||
function applyStreams() {
|
||||
let autoplayInput = document.querySelector('#autoplayInput');
|
||||
let videoStreamInput = document.querySelector('#videoStreamInput');
|
||||
let audioStreamInput = document.querySelector('#audioStreamInput');
|
||||
localStorage.setItem("videoStream", videoStreamInput.value);
|
||||
localStorage.setItem("audioStream", audioStreamInput.value);
|
||||
localStorage.setItem("autoplay", autoplayInput.checked);
|
||||
|
@ -310,17 +311,46 @@ window.addEventListener('DOMContentLoaded', (event) => {
|
|||
}
|
||||
|
||||
// formats
|
||||
|
||||
console.log("w dzisiejszym menu")
|
||||
|
||||
let uwu = document.createElement("option");
|
||||
uwu.value = ''
|
||||
uwu.innerText = ''
|
||||
audioStreamInput.append(uwu);
|
||||
|
||||
let selectedAudioIndex = 0;
|
||||
let selectedVideoIndex = 0;
|
||||
formats.forEach((e) => {
|
||||
let uwu = document.createElement("option");
|
||||
uwu.value = e.format_id;
|
||||
if (e.acodec == "none") {
|
||||
uwu.innerText = `${e.ext} ${e.height}p (${e.format_id})`;
|
||||
videoStreamInput.append(uwu);
|
||||
if (uwu.value == localStorage.getItem("videoStream")) {
|
||||
selectedVideoIndex = videoStreamInput.length-1;
|
||||
console.log(selectedVideoIndex)
|
||||
}
|
||||
console.log(`- ${e.format_id}, czyli ${e.height}p`)
|
||||
} else if (e.vcodec == "none") {
|
||||
uwu.innerText = `${e.acodec} ${e.abr}kbps (${e.format_id})`;
|
||||
if (uwu.value == localStorage.getItem("audioStream")) {
|
||||
selectedAudioIndex = audioStreamInput.length;
|
||||
console.log(selectedAudioIndex)
|
||||
}
|
||||
audioStreamInput.append(uwu);
|
||||
console.log(`- ${e.format_id}, czyli ${e.acodec} ${e.abr}kbps`)
|
||||
} else {
|
||||
uwu.innerText = `${e.ext} ${e.height}p (${e.format_id})`;
|
||||
if (uwu.value == localStorage.getItem("videoStream")) {
|
||||
selectedVideoIndex = videoStreamInput.length-1;
|
||||
console.log(selectedVideoIndex)
|
||||
}
|
||||
videoStreamInput.append(uwu);
|
||||
console.log(`A TAKŻE SPECJALNEGO GOŚCIA ${e.format_id}, czyli ${e.height}p WRAZ Z RODZINĄ`)
|
||||
}
|
||||
})
|
||||
|
||||
videoStreamInput.selectedIndex = selectedVideoIndex;
|
||||
audioStreamInput.selectedIndex = selectedAudioIndex;
|
||||
|
||||
});
|
||||
|
|
|
@ -23,9 +23,9 @@ echo '
|
|||
|
||||
<div class="settings_menu">
|
||||
<label for="video">Video stream:</label>
|
||||
<input id="videoStreamInput" name="video" type="text"><br>
|
||||
<select id="videoStreamInput" name="video"></select><br>
|
||||
<label for="audio">Audio stream:</label>
|
||||
<input id="audioStreamInput" name="audio" type="text"><br>
|
||||
<select id="audioStreamInput" name="audio"></select><br>
|
||||
<input type="checkbox" name="autoplay" id="autoplayInput" value="Autoplay">
|
||||
<label for="autoplay">Autoplay?</label><br>
|
||||
<button id="applyStreams">Apply</button><button id="resetStreams">Reset</button>
|
||||
|
|
|
@ -199,7 +199,7 @@ if [[ "${get_data[v]}" ]]; then
|
|||
strings[playlist]+="<script type='text/javascript'>window.addEventListener('DOMContentLoaded', (event) => { var video = document.querySelector('video'); video.addEventListener('ended', function() { window.location = 'watch?v=$next&playlist=$(html_encode ${get_data[playlist]})';});});</script><h1>Playlist</h1>"
|
||||
|
||||
for (( i=0; i<${#video_id[@]}; i++ )); do
|
||||
strings[playlist]+="<a href='watch?v=${video_id[$i]}&playlist=$(html_encode ${get_data[playlist]})'><img src='http://i.ytimg.com/vi/${video_id[$i]}/mqdefault.jpg'><br>${video_title[$i]}</a><br>"
|
||||
strings[playlist]+="<a href='watch?v=${video_id[$i]}&playlist=$(html_encode ${get_data[playlist]})'><img src='//i.ytimg.com/vi/${video_id[$i]}/mqdefault.jpg'><br>${video_title[$i]}</a><br>"
|
||||
done
|
||||
fi
|
||||
|
||||
|
|
Loading…
Reference in New Issue