mirror of
https://github.com/ThaUnknown/miru.git
synced 2026-04-05 19:59:44 +00:00
ditching autoPIP because it has issues
This commit is contained in:
parent
ec436c2def
commit
5a4aa3e697
2 changed files with 19 additions and 19 deletions
|
|
@ -301,17 +301,6 @@
|
|||
<span class="input-group-text">sec</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-group mb-10 w-200" data-toggle="tooltip" data-placement="top"
|
||||
data-title="What Action To Take When The Video Looses Visibility">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text">Lost Visibility</span>
|
||||
</div>
|
||||
<select class="form-control" id="player10">
|
||||
<option value="none" selected>Nothing</option>
|
||||
<option value="pip">Enter PIP</option>
|
||||
<option value="pause">Pause Playback</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="custom-switch mb-10" data-toggle="tooltip" data-placement="top"
|
||||
data-title="Shows Miniplayer When Browsing">
|
||||
<input type="checkbox" id="player4" checked>
|
||||
|
|
@ -337,11 +326,17 @@
|
|||
<input type="checkbox" id="player8" checked>
|
||||
<label for="player8">Post-Download Processing</label>
|
||||
</div>
|
||||
<div class="custom-switch mb-20" data-toggle="tooltip" data-placement="top"
|
||||
<div class="custom-switch mb-10" data-toggle="tooltip" data-placement="top"
|
||||
data-title="Renders The Video As A Blob When Available, Greatly Improves Playback Performance, DOUBLES RAM Usage.">
|
||||
<input type="checkbox" id="player9">
|
||||
<label for="player9">Render As Blob</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="custom-switch mb-20" data-toggle="tooltip" data-placement="top"
|
||||
data-title="Pauses/Resumes Video Playback When Tabbing In/Out Of The App.">
|
||||
<input type="checkbox" id="player10">
|
||||
<label for="player10">Pause When Tabbing Out</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="p-5">
|
||||
|
|
|
|||
|
|
@ -76,8 +76,6 @@ async function buildVideo(file, nowPlaying) {
|
|||
bpip.setAttribute("disabled", "")
|
||||
} else {
|
||||
bpip.removeAttribute("disabled")
|
||||
if (settings.player10 === "pip")
|
||||
video.setAttribute("autopictureinpicture", "") // this is not supported yet, but will be in the future
|
||||
video.addEventListener("enterpictureinpicture", () => {
|
||||
if (playerData.octopusInstance)
|
||||
btnpip()
|
||||
|
|
@ -171,7 +169,7 @@ let onProgress
|
|||
|
||||
// visibility loss
|
||||
document.addEventListener("visibilitychange", () => {
|
||||
if (settings.player10 === "pause")
|
||||
if (settings.player10)
|
||||
document.visibilityState === "hidden" ? video.pause() : playVideo();
|
||||
})
|
||||
|
||||
|
|
@ -457,7 +455,6 @@ async function btnpip() {
|
|||
running = true
|
||||
canvas.width = subtitleCanvas.width
|
||||
canvas.height = subtitleCanvas.height
|
||||
player.classList.add("pip")
|
||||
|
||||
function renderFrame() {
|
||||
if (running) {
|
||||
|
|
@ -466,11 +463,18 @@ async function btnpip() {
|
|||
window.requestAnimationFrame(renderFrame)
|
||||
}
|
||||
}
|
||||
window.requestAnimationFrame(renderFrame)
|
||||
canvasVideo.srcObject = canvas.captureStream()
|
||||
canvasVideo.onloadeddata = async function () {
|
||||
canvasVideo.onloadedmetadata = async () => {
|
||||
canvasVideo.play()
|
||||
await canvasVideo.requestPictureInPicture()
|
||||
await canvasVideo.requestPictureInPicture().then(
|
||||
player.classList.add("pip")
|
||||
).catch(e => {
|
||||
console.warn("Failed To Burn In Subtitles" + e)
|
||||
running = false
|
||||
canvasVideo.remove()
|
||||
canvas.remove()
|
||||
player.classList.remove("pip")
|
||||
})
|
||||
}
|
||||
canvasVideo.onleavepictureinpicture = () => {
|
||||
running = false
|
||||
|
|
@ -478,6 +482,7 @@ async function btnpip() {
|
|||
canvas.remove()
|
||||
player.classList.remove("pip")
|
||||
}
|
||||
window.requestAnimationFrame(renderFrame)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue