aboutsummaryrefslogtreecommitdiff
path: root/web/script/player
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2023-10-02 23:57:05 +0200
committermetamuffin <metamuffin@disroot.org>2023-10-02 23:57:05 +0200
commit1fff4e3828ca0745aaed3d778dcd47f1dfa79cd3 (patch)
tree21266dd23bd17019f1ff237877f81d29f1d3a26e /web/script/player
parent985d94d1a9a2712f51dc41a0312f9a7053211e85 (diff)
downloadjellything-1fff4e3828ca0745aaed3d778dcd47f1dfa79cd3.tar
jellything-1fff4e3828ca0745aaed3d778dcd47f1dfa79cd3.tar.bz2
jellything-1fff4e3828ca0745aaed3d778dcd47f1dfa79cd3.tar.zst
player: up factor
Diffstat (limited to 'web/script/player')
-rw-r--r--web/script/player/profiles.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/web/script/player/profiles.ts b/web/script/player/profiles.ts
index 50be9d3..5993e6f 100644
--- a/web/script/player/profiles.ts
+++ b/web/script/player/profiles.ts
@@ -1,7 +1,8 @@
import { OVar } from "../jshelper/mod.ts";
import { EncodingProfile, JhlsMetadata } from "./jhls.d.ts";
-const PROFILE_UP_FAC = 0.7
+const PROFILE_UP_FAC = 0.6
+const PROFILE_DOWN_FAC = 0.8
export interface EncodingProfileExt extends EncodingProfile { id: number, order: number }
export class ProfileSelector {
@@ -38,7 +39,7 @@ export class ProfileSelector {
const current_bitrate = profile_bw(profs[co], 5000 * 1000)
const next_bitrate = profile_bw(profs[co - 1], 5000 * 1000)
console.log({ current_bitrate, next_bitrate, co, bandwidth: this.bandwidth.value * 8 });
- if (current_bitrate > this.bandwidth.value * 8 && co + 1 < profs.length) {
+ if (current_bitrate > this.bandwidth.value * 8 * PROFILE_DOWN_FAC && co + 1 < profs.length) {
console.log("profile up");
profile.value = profs[co + 1]
}