aboutsummaryrefslogtreecommitdiff
path: root/web/script/player/profiles.ts
diff options
context:
space:
mode:
Diffstat (limited to 'web/script/player/profiles.ts')
-rw-r--r--web/script/player/profiles.ts5
1 files changed, 4 insertions, 1 deletions
diff --git a/web/script/player/profiles.ts b/web/script/player/profiles.ts
index 3344ef6..5ebdeb4 100644
--- a/web/script/player/profiles.ts
+++ b/web/script/player/profiles.ts
@@ -5,7 +5,8 @@
*/
/// <reference lib="dom" />
import { OVar } from "../jshelper/mod.ts";
-import { EncodingProfile } from "./jhls.d.ts";
+import { EncodingProfile, SourceTrackKind } from "./jhls.d.ts";
+import { get_track_kind } from "./mediacaps.ts";
import { profile_to_partial_track, test_media_capability } from "./mediacaps.ts";
import { Player } from "./player.ts";
import { MSEPlayerTrack } from "./track/mse.ts";
@@ -27,6 +28,8 @@ export class ProfileSelector {
async init() {
for (let id = 0; id < this.track.index!.extra_profiles.length; id++) {
const p = this.track.index!.extra_profiles[id];
+ // TODO hacky type casting solution
+ if (get_track_kind(this.track.metadata.kind) != get_track_kind(p as unknown as SourceTrackKind)) continue
if (!await test_media_capability(profile_to_partial_track(p))) continue
this.profiles.push({ id, order: 0, ...p })
}