mirror of
https://github.com/ThaUnknown/miru.git
synced 2026-04-21 10:51:57 +00:00
subtitle fixes, destroying fixes
This commit is contained in:
parent
906301a61e
commit
c0c587e5f5
6 changed files with 42 additions and 34 deletions
|
|
@ -196,7 +196,6 @@ input#progress[type=range]::before {
|
||||||
color: #ececec;
|
color: #ececec;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
align-self: center;
|
align-self: center;
|
||||||
padding: 0 1.2rem;
|
|
||||||
left: var(--progress);
|
left: var(--progress);
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
transition: .2s opacity ease;
|
transition: .2s opacity ease;
|
||||||
|
|
|
||||||
|
|
@ -156,7 +156,7 @@
|
||||||
<span class="ts" id="upSpeed">0 B/s</span>
|
<span class="ts" id="upSpeed">0 B/s</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="col d-flex justify-content-end">
|
<div class="col d-flex justify-content-end">
|
||||||
<a id="dl" class="material-icons">
|
<a id="dl" class="material-icons" title="Wait For File To Fully Download Before Saving To Drive">
|
||||||
<span class="material-icons">
|
<span class="material-icons">
|
||||||
get_app
|
get_app
|
||||||
</span>
|
</span>
|
||||||
|
|
|
||||||
|
|
@ -314,8 +314,8 @@ function btncap() {
|
||||||
|
|
||||||
for (let track of video.textTracks) {
|
for (let track of video.textTracks) {
|
||||||
let template = document.createElement("a")
|
let template = document.createElement("a")
|
||||||
template.classList.add("dropdown-item", "pointer")
|
template.classList.add("dropdown-item", "pointer", "text-capitalize")
|
||||||
template.innerHTML = track.language
|
template.innerHTML = track.language || (!Object.values(video.textTracks).some(track => track.language == "eng" || track.language == "en") ? "eng" : track.label)
|
||||||
if (track.mode == "showing") {
|
if (track.mode == "showing") {
|
||||||
template.classList.add("text-white")
|
template.classList.add("text-white")
|
||||||
off.classList.add("text-muted")
|
off.classList.add("text-muted")
|
||||||
|
|
@ -341,7 +341,7 @@ function selectLang(lang) {
|
||||||
track.mode = 'hidden';
|
track.mode = 'hidden';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
bcap()
|
btncap()
|
||||||
}
|
}
|
||||||
|
|
||||||
// keybinds
|
// keybinds
|
||||||
|
|
|
||||||
|
|
@ -8,9 +8,9 @@ function parseSubs(stream) {
|
||||||
subtitleStream = new SubtitleStream(subtitleStream)
|
subtitleStream = new SubtitleStream(subtitleStream)
|
||||||
} else {
|
} else {
|
||||||
subtitleStream = new SubtitleStream()
|
subtitleStream = new SubtitleStream()
|
||||||
subtitleStream.once('tracks', function (pTracks) {
|
subtitleStream.once('tracks', pTracks => {
|
||||||
pTracks.forEach(track => {
|
pTracks.forEach(track => {
|
||||||
tracks[track.number] = video.addTextTrack('captions', track.type, track.language || track.number)
|
tracks[track.number] = video.addTextTrack('captions', track.type, track.language)
|
||||||
})
|
})
|
||||||
if (video.textTracks[0]) {
|
if (video.textTracks[0]) {
|
||||||
video.textTracks[0].mode = "showing"
|
video.textTracks[0].mode = "showing"
|
||||||
|
|
|
||||||
|
|
@ -1,28 +1,29 @@
|
||||||
var client = new WebTorrent()
|
let client = new WebTorrent()
|
||||||
window.onbeforeunload = ()=>{
|
window.onbeforeunload = () => {
|
||||||
client.torrents[0].store.destroy()
|
client.torrents[0] ? client.torrents[0].store.destroy() : ""
|
||||||
client.torrents[0].destroy()
|
client.torrents[0] ? client.torrents[0].destroy() : ""
|
||||||
client.destroy()
|
client.destroy()
|
||||||
}
|
}
|
||||||
|
|
||||||
const announceList = [
|
const announceList = [
|
||||||
['wss://tracker.openwebtorrent.com'],
|
['wss://tracker.openwebtorrent.com'],
|
||||||
['wss://tracker.btorrent.xyz'],
|
['wss://tracker.btorrent.xyz'],
|
||||||
// ['wss://tracker.webtorrent.io'],
|
// ['wss://tracker.webtorrent.io'],
|
||||||
// ['wss://tracker.fastcast.nz'],
|
// ['wss://tracker.fastcast.nz'],
|
||||||
['wss://video.blender.org:443/tracker/socket'],
|
// ['wss://video.blender.org:443/tracker/socket'],
|
||||||
['wss://tube.privacytools.io:443/tracker/socket'],
|
// ['wss://tube.privacytools.io:443/tracker/socket'],
|
||||||
['wss://tracker.sloppyta.co:443/announce'],
|
['wss://tracker.sloppyta.co:443/announce'],
|
||||||
['wss://tracker.lab.vvc.niif.hu:443/announce'],
|
['wss://tracker.lab.vvc.niif.hu:443/announce'],
|
||||||
['wss://tracker.files.fm:7073/announce'],
|
['wss://tracker.files.fm:7073/announce'],
|
||||||
['wss://open.tube:443/tracker/socket'],
|
['wss://open.tube:443/tracker/socket'],
|
||||||
['wss://hub.bugout.link:443/announce'],
|
['wss://hub.bugout.link:443/announce'],
|
||||||
['wss://peertube.cpy.re:443/tracker/socket'],
|
// ['wss://peertube.cpy.re:443/tracker/socket'],
|
||||||
['ws://tracker.sloppyta.co:80/announce'],
|
['ws://tracker.sloppyta.co:80/announce'],
|
||||||
['ws://tracker.lab.vvc.niif.hu:80/announce'],
|
['ws://tracker.lab.vvc.niif.hu:80/announce'],
|
||||||
['ws://tracker.files.fm:7072/announce'],
|
['ws://tracker.files.fm:7072/announce'],
|
||||||
['ws://tracker.btsync.cf:6969/announce'],
|
['ws://tracker.btsync.cf:6969/announce'],
|
||||||
['ws://hub.bugout.link:80/announce']
|
['ws://hub.bugout.link:80/announce']
|
||||||
],
|
],
|
||||||
videoExtensions = [
|
videoExtensions = [
|
||||||
'.avi', '.mp4', '.m4v', '.webm', '.mov', '.mkv', '.mpg', '.mpeg', '.ogv', '.webm', '.wmv', '.m2ts'
|
'.avi', '.mp4', '.m4v', '.webm', '.mov', '.mkv', '.mpg', '.mpeg', '.ogv', '.webm', '.wmv', '.m2ts'
|
||||||
],
|
],
|
||||||
|
|
@ -54,7 +55,7 @@ let nowPlaying,
|
||||||
selectedTorrent
|
selectedTorrent
|
||||||
async function addTorrent(magnet) {
|
async function addTorrent(magnet) {
|
||||||
if (client.torrents.length >= maxTorrents) {
|
if (client.torrents.length >= maxTorrents) {
|
||||||
client.torrents[0].store.destroy()
|
client.torrents[0].store ? client.torrents[0].store.destroy() : ""
|
||||||
client.torrents[0].destroy()
|
client.torrents[0].destroy()
|
||||||
}
|
}
|
||||||
halfmoon.hideModal("tsearch")
|
halfmoon.hideModal("tsearch")
|
||||||
|
|
@ -143,6 +144,7 @@ function serveFile(file, req) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// kind of a fetch event from service worker but for the main thread.
|
// kind of a fetch event from service worker but for the main thread.
|
||||||
|
let lastport
|
||||||
navigator.serviceWorker.addEventListener('message', evt => {
|
navigator.serviceWorker.addEventListener('message', evt => {
|
||||||
const request = new Request(evt.data.url, {
|
const request = new Request(evt.data.url, {
|
||||||
headers: evt.data.headers,
|
headers: evt.data.headers,
|
||||||
|
|
@ -168,6 +170,10 @@ navigator.serviceWorker.addEventListener('message', evt => {
|
||||||
}
|
}
|
||||||
|
|
||||||
port.onmessage = pull
|
port.onmessage = pull
|
||||||
|
|
||||||
|
// hack: stop hiding the old stream somewhere in memory land
|
||||||
|
if (lastport) lastport.onmessage = null
|
||||||
|
lastport = port
|
||||||
})
|
})
|
||||||
|
|
||||||
function prettyBytes(num) {
|
function prettyBytes(num) {
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
deferredPrompt = e;
|
deferredPrompt = e;
|
||||||
});
|
});
|
||||||
document.querySelector(".btn").addEventListener('click', (e) => {
|
add.addEventListener('click', (e) => {
|
||||||
deferredPrompt.prompt();
|
deferredPrompt.prompt();
|
||||||
deferredPrompt.userChoice.then((choiceResult) => {
|
deferredPrompt.userChoice.then((choiceResult) => {
|
||||||
if (choiceResult.outcome === 'accepted') {
|
if (choiceResult.outcome === 'accepted') {
|
||||||
|
|
@ -61,9 +61,12 @@
|
||||||
no buffering, no ads, no delays, everything done client-side for free.
|
no buffering, no ads, no delays, everything done client-side for free.
|
||||||
</p>
|
</p>
|
||||||
<div class="mt-20">
|
<div class="mt-20">
|
||||||
<div class="btn btn-primary" role="button">
|
<div class="btn btn-primary" role="button" id="add">
|
||||||
Add app
|
Add App
|
||||||
</div>
|
</div>
|
||||||
|
<a class="btn" role="button" href="/app/">
|
||||||
|
Open In Browser
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue