diff options
Diffstat (limited to 'web/script/player/profiles.ts')
-rw-r--r-- | web/script/player/profiles.ts | 5 |
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] } |