Skip to content

Commit

Permalink
Add types definition for custom initial track selection function (#3867)
Browse files Browse the repository at this point in the history
* Add types definition for set/resetCustomInitialTrackSelectionFunction

* Do not reset custom initial track selection callback when new stream is loaded
  • Loading branch information
bbert authored Jan 31, 2022
1 parent a83535d commit e8ed11d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 6 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion src/streaming/controllers/MediaController.js
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,6 @@ function MediaController() {
function reset() {
tracks = {};
lastSelectedTracks = {};
customInitialTrackSelectionFunction = null;
resetInitialSettings();
}

Expand Down

0 comments on commit e8ed11d

Please sign in to comment.