Skip to content
7 changes: 7 additions & 0 deletions packages/playback/src/lib/consts/eme-robustness.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export enum RobustnessLevel {
'SW_SECURE_CRYPTO',
'SW_SECURE_DECODE',
'HW_SECURE_CRYPTO',
'HW_SECURE_DECODE',
'HW_SECURE_ALL',
}
Comment thread
dzianis-dashkevich marked this conversation as resolved.
Outdated
6 changes: 6 additions & 0 deletions packages/playback/src/lib/player/base/base-player.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,12 @@ export abstract class BasePlayer {
this.emeManager_ = null;
}

// TODO: create adapter type
public registerEmeApiAdapter(adapter: any): void {
Comment thread
dzianis-dashkevich marked this conversation as resolved.
Outdated
// TODO: implement functionality to register adapter
// For example, this will be used for legacy fairplay.
}

protected readonly networkRequestInterceptor_ = (requestInfo: INetworkRequestInfo): Promise<INetworkRequestInfo> => {
return this.interceptorsStorage_.executeInterceptors(InterceptorType.NetworkRequest, requestInfo);
};
Expand Down
23 changes: 23 additions & 0 deletions packages/playback/src/lib/types/configuration.declarations.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { CustomTagMap, TransformTagValue, TransformTagAttributes } from '@videojs/hls-parser';
import type { RequestType } from '../consts/request-type';
import type { RobustnessLevel } from '../consts/eme-robustness';

export interface NetworkConfiguration {
/**
Expand Down Expand Up @@ -61,10 +62,32 @@ export interface PlayerHlsConfiguration {
customTagMap: CustomTagMap;
transformTagValue: TransformTagValue;
transformTagAttributes: TransformTagAttributes;

}

export interface PlayerEmeConfiguration {
/**
* Allows for using stored sessions. We store the session IDs internally.
* defaults to false
*/
enablePersistentKeySessions: boolean;
Comment thread
dzianis-dashkevich marked this conversation as resolved.
Outdated

/**
* The video robustness level associated with the content type.
* Defults to an empty string.
*/
videoRobustness?: RobustnessLevel;

/**
* The audio robustness level associated with the content type.
* Defaults to an emptry string.
*/
audioRobustness?: RobustnessLevel;
}

export interface PlayerConfiguration {
network: PlayerNetworkConfiguration;
mse: PlayerMseConfiguration;
hls: PlayerHlsConfiguration;
eme: PlayerEmeConfiguration;
}
17 changes: 15 additions & 2 deletions packages/playback/src/lib/types/source.declarations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,24 @@ export interface IKeySystemConfig {
serverCertificate?: Uint8Array;
persistentState?: MediaKeysRequirement;
distinctiveIdentifier?: MediaKeysRequirement;
videoRobustness?: string;
audioRobustness?: string;
sessionType?: MediaKeySessionType;
sessionId?: string;
priority?: number;
/**
* A map of ClearKey key IDs to keys.
* These values should be encoded in hex or base64.
* Defaults to an empty object.
*/
clearKeys?: Record<string, string>;
/**
* On 'individualization-request' events, this URI will be used for the license request.
* playready specific
* Defaults to ''.
*/
individualizationServerUri?: string;
getContentId?: (contentId: string) => string;
// Rare cases when we want to leave it up to the user to get the license
getLicense?: (contentId: string, keyMessage: MediaKeyMessageEvent) => void;
}

export interface ILoadSource {
Expand Down