aboutsummaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
Diffstat (limited to 'web')
-rw-r--r--web/script/player/mod.ts13
-rw-r--r--web/style/layout.css2
2 files changed, 7 insertions, 8 deletions
diff --git a/web/script/player/mod.ts b/web/script/player/mod.ts
index af62cde..e8cde94 100644
--- a/web/script/player/mod.ts
+++ b/web/script/player/mod.ts
@@ -18,10 +18,10 @@ globalThis.addEventListener("DOMContentLoaded", () => {
if (globalThis.location.search.search("nojsp") != -1) return
if (!globalThis.MediaSource) return alert("Media Source Extension API required")
const node_id = globalThis.location.pathname.split("/")[2];
- const main = document.getElementById("main")!;
- document.getElementsByTagName("footer")[0].remove()
+ document.getElementById("player")?.remove();
+ document.getElementsByClassName("playerconf").item(0)?.remove()
globalThis.dispatchEvent(new Event("navigationrequiresreload"))
- initialize_player(main, node_id)
+ document.getElementById("main")!.prepend(initialize_player(node_id))
}
})
@@ -50,9 +50,7 @@ function get_query_start_time() {
return x
}
-function initialize_player(el: HTMLElement, node_id: string) {
- el.innerHTML = "" // clear the body
-
+function initialize_player(node_id: string): HTMLElement {
const logger = new Logger<string>(s => e("p", s))
const start_time = get_query_start_time() ?? 0 // TODO get_continue_time(ndata.userdata.watched);
const player = new Player(`/n/${encodeURIComponent(node_id)}/stream`, `/n/${encodeURIComponent(node_id)}/poster`, start_time, logger)
@@ -253,7 +251,6 @@ function initialize_player(el: HTMLElement, node_id: string) {
popups,
controls,
)
- el.append(pel)
controls.onmouseenter = () => idle_inhibit.value = true
controls.onmouseleave = () => idle_inhibit.value = false
@@ -296,6 +293,8 @@ function initialize_player(el: HTMLElement, node_id: string) {
k.preventDefault()
})
send_player_progress(node_id, player)
+
+ return pel
}
function screenshot_video(video: HTMLVideoElement) {
diff --git a/web/style/layout.css b/web/style/layout.css
index a86f76d..a14c86e 100644
--- a/web/style/layout.css
+++ b/web/style/layout.css
@@ -53,7 +53,7 @@ h1, h2, h3, h4 {
h1 {
font-weight: bold;
}
-p, span, a, td, th, label, input, legend, pre, summary {
+p, span, a, td, th, label, input, legend, pre, summary, li {
color: var(--font);
}