Skip to content

Commit

Permalink
Feature/unsupported security levels (#4562)
Browse files Browse the repository at this point in the history
* WiP: Ignore Representations with unsupported key sessions

* Check if key is usable in ABR controller. Otherwise ignore the Representation

* Fix race condition when doing a non replacement track switch

* First working version of handling unsupported keys

* Fix unit tests

* Fix unit tests

* Working playback with key id hex conversion

* Fix unit tests

* Dispatch key status expired and do not show Representations and AdaptationSets with unusable key ids in the Controlbar

* Add windows local functional tests config

* Update content token

* Fix a bug that lead to playback stalling after changeType failed

* Add config for Windows functional tests

* Remove scheduled CircleCI workflow

* Do not terminate if _initializeSinkForMseBuffering fails

* First try DRM system for which we have protData

* Exclude preload test for livesim eccp

* Workaround to overcome stalls when key is unusubale

* Fix a bug when switching tracks. ScheduleController needs to be stopped immediately to avoid inconsistency with the ABR selection. Also reset BOLA utility values when a track is changed.

* Fix potential null pointer in AbrController.js

* Fix a bug when switching qualities that lead to SourceBuffer errors for multiperiod streams

* Add functional test for quality switch

* Only apply changeType when the codecs are not compatible

* Revert single.json

* Add DRM no livesim functional config

* Minor config changes

* Fix a race condition when switching tracks that lead to a media source error

* Check for dash.js errors in the functional tests and solve nullpointer exception in Stream.js

* Add new token for tests

* Only trigger a NEW_TRACK_SELECTED event when mediainfo is changed

* Use minified version in karma testsuite

* Remove streams for which we do not have a valid token

* Remove streams from reference client

* Remove comments

* Use debug bundles
  • Loading branch information
dsilhavy authored Oct 1, 2024
1 parent e22bbf5 commit dd18a1a
Show file tree
Hide file tree
Showing 53 changed files with 3,494 additions and 2,650 deletions.
13 changes: 0 additions & 13 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -241,16 +241,3 @@ workflows:
ignore: # as creds are available only for non-forked branches
- /pull\/[0-9]+/

scheduled-workflow:
triggers:
- schedule:
cron: "0 0 * * 0,3"
filters:
branches:
only:
- development
jobs:
- functional-tests-full-part-1
- functional-tests-full-part-2
- functional-tests-full-part-3

17 changes: 17 additions & 0 deletions contrib/akamai/controlbar/ControlBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ var ControlBar = function (dashjsMediaPlayer, displayUTCTimeCodes) {
self.player.on(dashjs.MediaPlayer.events.STREAM_TEARDOWN_COMPLETE, _onStreamTeardownComplete, this);
self.player.on(dashjs.MediaPlayer.events.TEXT_TRACKS_ADDED, _onTracksAdded, this);
self.player.on(dashjs.MediaPlayer.events.BUFFER_LEVEL_UPDATED, _onBufferLevelUpdated, this);
self.player.on(dashjs.MediaPlayer.events.NEW_TRACK_SELECTED, _onNewTrackSelected, this);
self.player.on(dashjs.Protection.events.KEY_STATUSES_MAP_UPDATED, _onKeyStatusChanged, this);
};

var removePlayerEventsListeners = function () {
Expand All @@ -126,6 +128,8 @@ var ControlBar = function (dashjsMediaPlayer, displayUTCTimeCodes) {
self.player.off(dashjs.MediaPlayer.events.STREAM_TEARDOWN_COMPLETE, _onStreamTeardownComplete, this);
self.player.off(dashjs.MediaPlayer.events.TEXT_TRACKS_ADDED, _onTracksAdded, this);
self.player.off(dashjs.MediaPlayer.events.BUFFER_LEVEL_UPDATED, _onBufferLevelUpdated, this);
self.player.off(dashjs.MediaPlayer.events.NEW_TRACK_SELECTED, _onNewTrackSelected, this);
self.player.off(dashjs.Protection.events.KEY_STATUSES_MAP_UPDATED, _onKeyStatusChanged, this);
};

var getControlId = function (id) {
Expand Down Expand Up @@ -584,6 +588,10 @@ var ControlBar = function (dashjsMediaPlayer, displayUTCTimeCodes) {
info += '- Codec: ' + element.codec + ' ';
}

if (element.id) {
info += '- Id: ' + element.id + ' ';
}

return label || info
};
trackSwitchMenu = createMenu(availableTracks, contentFunc);
Expand Down Expand Up @@ -689,6 +697,15 @@ var ControlBar = function (dashjsMediaPlayer, displayUTCTimeCodes) {
createCaptionSwitchMenu(e.streamId);
};

var _onNewTrackSelected = function () {
createTrackSwitchMenu();
createBitrateSwitchMenu();
}

var _onKeyStatusChanged = function () {
createBitrateSwitchMenu();
}

var _onBufferLevelUpdated = function () {
if (seekbarBuffer) {
seekbarBuffer.style.width = ((player.timeInDvrWindow() + getBufferLevel()) / player.duration() * 100) + '%';
Expand Down
18 changes: 13 additions & 5 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1105,7 +1105,7 @@ declare namespace dashjs {
useAppendWindow?: boolean,
setStallState?: boolean
avoidCurrentTimeRangePruning?: boolean
useChangeTypeForTrackSwitch?: boolean
useChangeType?: boolean
mediaSourceDurationInfinity?: boolean
resetSourceBuffersForTrackSwitch?: boolean
},
Expand Down Expand Up @@ -2329,7 +2329,7 @@ declare namespace dashjs {

isCurrentTrack(track: MediaInfo): boolean;

setTrack(track: MediaInfo, noSettingsSave: boolean): void;
setTrack(track: MediaInfo, options: object): void;

setInitialSettings(type: string, value: object): void;

Expand Down Expand Up @@ -3043,6 +3043,8 @@ declare namespace dashjs {
stop(): void;

reset(): void;

isKeyIdUsable(): boolean;
}

export interface ProtectionKeyController {
Expand Down Expand Up @@ -3232,7 +3234,7 @@ declare namespace dashjs {
export interface ProtectionModel_01b {
getAllInitData(): ArrayBuffer[];

getSessions(): any[]; // Is this MediaSession[] ?
getSessionTokens(): any[]; // Is this MediaSession[] ?

requestKeySystemAccess(ksConfigurations: object[]): Promise<any>;

Expand Down Expand Up @@ -3260,7 +3262,7 @@ declare namespace dashjs {
export interface ProtectionModel_3Fe2014 {
getAllInitData(): ArrayBuffer[];

getSessions(): any[]; // Is this MediaSession[] ?
getSessionTokens(): any[]; // Is this MediaSession[] ?

requestKeySystemAccess(ksConfigurations: object[]): Promise<any>;

Expand Down Expand Up @@ -3288,7 +3290,7 @@ declare namespace dashjs {
export interface DefaultProtectionModel {
getAllInitData(): ArrayBuffer[];

getSessions(): any[]; // Is this MediaSession[] ?
getSessionTokens(): any[]; // Is this MediaSession[] ?

requestKeySystemAccess(ksConfigurations: object[]): Promise<any>;

Expand Down Expand Up @@ -4388,6 +4390,12 @@ declare namespace dashjs {
TcpList: TCPConnection[];
}

export class MediaInfoSelectionInput {
newMediaInfo: MediaInfo;
previouslySelectedRepresentation: Representation | null;
newRepresentation: Representation | null
}

export class TextRequest extends FragmentRequest {
constructor(url: string, type: string);

Expand Down
Loading

0 comments on commit dd18a1a

Please sign in to comment.