@@ -41,15 +41,22 @@ import ProtectionKeyController from '../controllers/ProtectionKeyController.js';
41
41
import NeedKey from '../vo/NeedKey.js' ;
42
42
import ProtectionErrors from '../errors/ProtectionErrors.js' ;
43
43
import DashJSError from '../../vo/DashJSError.js' ;
44
- import KeyMessage from '../vo/KeyMessage.js' ;
45
44
import KeySystemAccess from '../vo/KeySystemAccess.js' ;
46
- import ProtectionConstants from '../../constants/ProtectionConstants .js' ;
45
+ import KeyMessage from '../vo/KeyMessage .js' ;
47
46
import FactoryMaker from '../../../core/FactoryMaker.js' ;
48
47
48
+ // imports from common-media-library
49
+ import { PLAYREADY_KEY_SYSTEM } from '@svta/common-media-library/drm/common/const/PLAYREADY_KEY_SYSTEM.js' ;
50
+ import { PLAYREADY_RECOMMENDATION_KEY_SYSTEM } from '@svta/common-media-library/drm/common/const/PLAYREADY_RECOMMENDATION_KEY_SYSTEM.js' ;
51
+ import { WIDEVINE_KEY_SYSTEM } from '@svta/common-media-library/drm/common/const/WIDEVINE_KEY_SYSTEM.js' ;
52
+ import { CLEAR_KEY_SYSTEM } from '@svta/common-media-library/drm/common/const/CLEAR_KEY_SYSTEM.js' ;
53
+ import { INITIALIZATION_DATA_TYPE } from '@svta/common-media-library/drm/common/const/INITIALIZATION_DATA_TYPE.js' ;
54
+ import { MEDIA_KEY_STATUSES } from '@svta/common-media-library/drm/common/const/MEDIA_KEY_STATUSES.js' ;
55
+
49
56
const SYSTEM_STRING_PRIORITY = { } ;
50
- SYSTEM_STRING_PRIORITY [ ProtectionConstants . PLAYREADY_KEYSTEM_STRING ] = [ ProtectionConstants . PLAYREADY_KEYSTEM_STRING , ProtectionConstants . PLAYREADY_RECOMMENDATION_KEYSTEM_STRING ] ;
51
- SYSTEM_STRING_PRIORITY [ ProtectionConstants . WIDEVINE_KEYSTEM_STRING ] = [ ProtectionConstants . WIDEVINE_KEYSTEM_STRING ] ;
52
- SYSTEM_STRING_PRIORITY [ ProtectionConstants . CLEARKEY_KEYSTEM_STRING ] = [ ProtectionConstants . CLEARKEY_KEYSTEM_STRING ] ;
57
+ SYSTEM_STRING_PRIORITY [ PLAYREADY_KEY_SYSTEM ] = [ PLAYREADY_KEY_SYSTEM , PLAYREADY_RECOMMENDATION_KEY_SYSTEM ] ;
58
+ SYSTEM_STRING_PRIORITY [ WIDEVINE_KEY_SYSTEM ] = [ WIDEVINE_KEY_SYSTEM ] ;
59
+ SYSTEM_STRING_PRIORITY [ CLEAR_KEY_SYSTEM ] = [ CLEAR_KEY_SYSTEM ] ;
53
60
54
61
function DefaultProtectionModel ( config ) {
55
62
@@ -310,7 +317,7 @@ function DefaultProtectionModel(config) {
310
317
const sessionToken = _createSessionToken ( mediaKeySession , keySystemMetadata ) ;
311
318
312
319
// The "keyids" type is used for Clearkey when keys are provided directly in the protection data and a request to a license server is not needed
313
- const dataType = keySystem . systemString === ProtectionConstants . CLEARKEY_KEYSTEM_STRING && ( keySystemMetadata . initData || ( keySystemMetadata . protData && keySystemMetadata . protData . clearkeys ) ) ? ProtectionConstants . INITIALIZATION_DATA_TYPE_KEYIDS : ProtectionConstants . INITIALIZATION_DATA_TYPE_CENC ;
320
+ const dataType = keySystem . systemString === CLEAR_KEY_SYSTEM && ( keySystemMetadata . initData || ( keySystemMetadata . protData && keySystemMetadata . protData . clearkeys ) ) ? INITIALIZATION_DATA_TYPE . KEYIDS : INITIALIZATION_DATA_TYPE . CENC ;
314
321
315
322
mediaKeySession . generateRequest ( dataType , keySystemMetadata . initData )
316
323
. then ( function ( ) {
@@ -520,7 +527,7 @@ function DefaultProtectionModel(config) {
520
527
let usable = false ;
521
528
session . keyStatuses . forEach ( function ( ) {
522
529
let keyStatus = _parseKeyStatus ( arguments ) ;
523
- if ( keyStatus . status === ProtectionConstants . MEDIA_KEY_STATUSES . USABLE ) {
530
+ if ( keyStatus . status === MEDIA_KEY_STATUSES . USABLE ) {
524
531
usable = true ;
525
532
}
526
533
} ) ;
0 commit comments