From ff429504085d51b71d18c398a6fb485921960625 Mon Sep 17 00:00:00 2001 From: Bertrand Berthelot Date: Fri, 28 Jan 2022 12:05:33 +0100 Subject: [PATCH 1/2] Add types definition for set/resetCustomInitialTrackSelectionFunction --- index.d.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/index.d.ts b/index.d.ts index 63556864b1..381b1b16d0 100644 --- a/index.d.ts +++ b/index.d.ts @@ -359,6 +359,8 @@ declare namespace dashjs { export type CapabilitiesFilter = (representation: Representation) => boolean; + export type TrackSelectionFunction = (tracks: MediaInfo[]) => MediaInfo[]; + export interface MediaPlayerClass { initialize(view?: HTMLElement, source?: string, autoPlay?: boolean): void; @@ -584,6 +586,10 @@ declare namespace dashjs { unregisterCustomCapabilitiesFilter(filter: CapabilitiesFilter): void, + setCustomInitialTrackSelectionFunction(fn: TrackSelectionFunction): void, + + resetCustomInitialTrackSelectionFunction(fn: TrackSelectionFunction): void, + attachTTMLRenderingDiv(div: HTMLDivElement): void; getCurrentTextTrackIndex(): number; From 03167ea7e646d3215bbf5f0b37602f1234dea8af Mon Sep 17 00:00:00 2001 From: Bertrand Berthelot Date: Mon, 31 Jan 2022 11:29:46 +0100 Subject: [PATCH 2/2] Do not reset custom initial track selection callback when new stream is loaded --- src/streaming/controllers/MediaController.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/streaming/controllers/MediaController.js b/src/streaming/controllers/MediaController.js index ad0aabfe2f..43969f557f 100644 --- a/src/streaming/controllers/MediaController.js +++ b/src/streaming/controllers/MediaController.js @@ -286,7 +286,6 @@ function MediaController() { function reset() { tracks = {}; lastSelectedTracks = {}; - customInitialTrackSelectionFunction = null; resetInitialSettings(); }