mirror of
https://github.com/ThaUnknown/miru.git
synced 2026-08-20 11:45:45 +00:00
playlist/batch support work
This commit is contained in:
parent
46945d57c3
commit
534124803f
1 changed files with 20 additions and 6 deletions
|
|
@ -93,7 +93,7 @@ async function buildVideo(file, nowPlaying) {
|
|||
player.prepend(video);
|
||||
video.load();
|
||||
playVideo();
|
||||
// file.on("done", () => { console.log("test") }) // this currently wont work
|
||||
// file.on("done", () => { console.log("test") }) // this currently wont work, idk how to remove old listeners
|
||||
onProgress = function () {
|
||||
if (document.location.hash == "#player" && typeof video !== 'undefined') {
|
||||
player.style.setProperty("--download", file.progress * 100 + "%");
|
||||
|
|
@ -458,11 +458,6 @@ async function btnpip() {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//playlist
|
||||
|
||||
function btnpl() {
|
||||
|
||||
}
|
||||
//miniplayer
|
||||
if (!settings.player4) {
|
||||
|
|
@ -573,6 +568,25 @@ function selectLang(lang) {
|
|||
}
|
||||
btncap()
|
||||
}
|
||||
//playlist
|
||||
|
||||
function btnpl() {
|
||||
let frag = document.createDocumentFragment()
|
||||
videoFiles.forEach((file, index) => {
|
||||
let template = document.createElement("a")
|
||||
template.classList.add("dropdown-item", "pointer", "text-capitalize", "text-truncate", "text-white")
|
||||
let regexParse = nameParseRegex.fallback.exec(file.name)
|
||||
template.innerHTML = playerData.nowPlaying[0] ? playerData.nowPlaying.title.userPreferred + " - " + parseInt(regexParse[3]) : regexParse[2] + parseInt(regexParse[3])
|
||||
template.onclick = () => {
|
||||
cleanupVideo()
|
||||
buildVideo(file, [playerData.nowPlaying ? playerData.nowPlaying[0] : undefined, parseInt(regexParse[3])])
|
||||
btnpl()
|
||||
}
|
||||
frag.appendChild(template)
|
||||
})
|
||||
playlistMenu.textContent = '';
|
||||
playlistMenu.appendChild(frag)
|
||||
}
|
||||
|
||||
// keybinds
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue