7
7
describe ( 'DrmEngine' , ( ) => {
8
8
const ContentType = shaka . util . ManifestParserUtils . ContentType ;
9
9
10
- // These come from Axinom and use the Axinom license server.
11
- // TODO: Do not rely on third-party services long-term.
10
+ // These come from Axinom.
12
11
const videoInitSegmentUri = '/base/test/test/assets/multidrm-video-init.mp4' ;
13
12
const videoSegmentUri = '/base/test/test/assets/multidrm-video-segment.mp4' ;
14
13
const audioInitSegmentUri = '/base/test/test/assets/multidrm-audio-init.mp4' ;
@@ -89,9 +88,13 @@ describe('DrmEngine', () => {
89
88
drmEngine = new shaka . media . DrmEngine ( playerInterface ) ;
90
89
const config = shaka . util . PlayerConfiguration . createDefault ( ) . drm ;
91
90
config . servers [ 'com.widevine.alpha' ] =
92
- 'https://cwip-shaka-proxy.appspot.com/specific_key?blodJidXR9eARuql0dNLWg=GX8m9XLIZNIzizrl0RTqnA ' ;
91
+ 'https://cwip-shaka-proxy.appspot.com/specific_key?QGCoZYh4Qmecv5GuW64ecg=/DU0CDcxDMD7U96X4ipp4A ' ;
93
92
config . servers [ 'com.microsoft.playready' ] =
94
- 'https://test.playready.microsoft.com/service/rightsmanager.asmx?cfg=(kid:6e5a1d26-2757-47d7-8046-eaa5d1d34b5a,contentkey:GX8m9XLIZNIzizrl0RTqnA==,sl:150)' ;
93
+ 'https://test.playready.microsoft.com/service/rightsmanager.asmx?cfg=(kid:4060a865-8878-4267-9cbf-91ae5bae1e72,contentkey:/DU0CDcxDMD7U96X4ipp4A==,sl:150)' ;
94
+ config . preferredKeySystems = [
95
+ 'com.widevine.alpha' ,
96
+ 'com.microsoft.playready' ,
97
+ ] ;
95
98
drmEngine . configure ( config ) ;
96
99
97
100
manifest = shaka . test . ManifestGenerator . generate ( ( manifest ) => {
@@ -179,8 +182,11 @@ describe('DrmEngine', () => {
179
182
eventManager . listen ( video , 'encrypted' , ( ) => {
180
183
encryptedEventSeen . resolve ( ) ;
181
184
} ) ;
185
+
182
186
eventManager . listen ( video , 'error' , ( ) => {
187
+ fail ( 'MediaError message ' + video . error . message ) ;
183
188
fail ( 'MediaError code ' + video . error . code ) ;
189
+
184
190
let extended = video . error . msExtendedCode ;
185
191
if ( extended ) {
186
192
if ( extended < 0 ) {
@@ -197,16 +203,17 @@ describe('DrmEngine', () => {
197
203
} ) ;
198
204
199
205
const variants = manifest . variants ;
200
-
201
206
await drmEngine . initForPlayback ( variants , manifest . offlineSessionIds ) ;
202
207
await drmEngine . attach ( video ) ;
208
+
203
209
await mediaSourceEngine . appendBuffer (
204
210
ContentType . VIDEO , videoInitSegment , null , fakeStream ,
205
211
/* hasClosedCaptions= */ false ) ;
206
212
await mediaSourceEngine . appendBuffer (
207
213
ContentType . AUDIO , audioInitSegment , null , fakeStream ,
208
214
/* hasClosedCaptions= */ false ) ;
209
215
await encryptedEventSeen ;
216
+
210
217
// With PlayReady, a persistent license policy can cause a different
211
218
// chain of events. In particular, the request is bypassed and we
212
219
// get a usable key right away.
@@ -264,8 +271,8 @@ describe('DrmEngine', () => {
264
271
// Configure DrmEngine for ClearKey playback.
265
272
const config = shaka . util . PlayerConfiguration . createDefault ( ) . drm ;
266
273
config . clearKeys = {
267
- // From https://github.com/Axinom/public-test-vectors/tree/conservative#v61-multidrm
268
- '6e5a1d26275747d78046eaa5d1d34b5a ' : '197f26f572c864d2338b3ae5d114ea9c ' ,
274
+ // From https://github.com/Axinom/public-test-vectors/blob/master/README.md#v10
275
+ '4060a865887842679cbf91ae5bae1e72 ' : 'fc35340837310cc0fb53de97e22a69e0 ' ,
269
276
} ;
270
277
drmEngine . configure ( config ) ;
271
278
@@ -277,8 +284,11 @@ describe('DrmEngine', () => {
277
284
eventManager . listen ( video , 'encrypted' , ( ) => {
278
285
encryptedEventSeen . resolve ( ) ;
279
286
} ) ;
287
+
280
288
eventManager . listen ( video , 'error' , ( ) => {
289
+ fail ( 'MediaError message ' + video . error . message ) ;
281
290
fail ( 'MediaError code ' + video . error . code ) ;
291
+
282
292
let extended = video . error . msExtendedCode ;
283
293
if ( extended ) {
284
294
if ( extended < 0 ) {
@@ -295,9 +305,9 @@ describe('DrmEngine', () => {
295
305
} ) ;
296
306
297
307
const variants = manifest . variants ;
298
-
299
308
await drmEngine . initForPlayback ( variants , manifest . offlineSessionIds ) ;
300
309
await drmEngine . attach ( video ) ;
310
+
301
311
await mediaSourceEngine . appendBuffer (
302
312
ContentType . VIDEO , videoInitSegment , null , fakeStream ,
303
313
/* hasClosedCaptions= */ false ) ;
0 commit comments