aboutsummaryrefslogtreecommitdiff
path: root/web/script/player/mod.ts
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2023-10-02 23:53:29 +0200
committermetamuffin <metamuffin@disroot.org>2023-10-02 23:53:29 +0200
commit985d94d1a9a2712f51dc41a0312f9a7053211e85 (patch)
tree7479035c95f2dfb3ad1925622d9132aa29beaaff /web/script/player/mod.ts
parent1f11c16aefe71d68605d2cd0ad5da9c016aa3570 (diff)
downloadjellything-985d94d1a9a2712f51dc41a0312f9a7053211e85.tar
jellything-985d94d1a9a2712f51dc41a0312f9a7053211e85.tar.bz2
jellything-985d94d1a9a2712f51dc41a0312f9a7053211e85.tar.zst
"working" adaptive br with hardcoded remux br
Diffstat (limited to 'web/script/player/mod.ts')
-rw-r--r--web/script/player/mod.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/web/script/player/mod.ts b/web/script/player/mod.ts
index 89919e4..e6d3ea0 100644
--- a/web/script/player/mod.ts
+++ b/web/script/player/mod.ts
@@ -69,7 +69,7 @@ function initialize_player(el: HTMLElement, node_id: string) {
)),
show_stats.map(do_show => player.tracks.map(tracks =>
!do_show ? e("div") : e("div", { class: "jsp-stats" },
- player.downloader.bandwidth.map(b => e("pre", `estimated bandwidth: ${show.metric(b, "B/s")}`)),
+ player.downloader.bandwidth.map(b => e("pre", `estimated bandwidth: ${show.metric(b, "B/s")} / ${show.metric(b * 8, "b/s")}`)),
...tracks.map((t, i) => t.profile.map(p =>
e("pre", `track ${i}: ` + (p ? `profile ${p.id} (${show_profile(p)})` : `remux`))
))
@@ -122,8 +122,8 @@ function mouse_idle(e: HTMLElement, timeout: number, cb: (b: boolean) => unknown
}
function show_profile(profile: EncodingProfile): string {
- if (profile.audio) return `codec=${profile.audio.codec} ar=${show.metric(profile.audio.sample_rate ?? -1, "Hz")} abr=${show.metric(profile.audio.bitrate, "b/s")}`
+ if (profile.audio) return `codec=${profile.audio.codec} ${profile.audio.sample_rate ? `ar=${show.metric(profile.audio.sample_rate, "Hz")} ` : ""}abr=${show.metric(profile.audio.bitrate, "b/s")}`
if (profile.video) return `codec=${profile.video.codec} vw=${profile.video.width} vbr=${show.metric(profile.video.bitrate, "b/s")} preset=${profile.video.preset}`
if (profile.subtitles) return `codec=${profile.subtitles.codec}`
return `???`
-} \ No newline at end of file
+}