File tree Expand file tree Collapse file tree 4 files changed +27
-8
lines changed Expand file tree Collapse file tree 4 files changed +27
-8
lines changed Original file line number Diff line number Diff line change @@ -314,6 +314,13 @@ shaka.device.AbstractDevice = class {
314
314
return false ;
315
315
}
316
316
317
+ /**
318
+ * @override
319
+ */
320
+ needWaitForEncryptedEvent ( keySystem ) {
321
+ return keySystem === 'com.apple.fps' ;
322
+ }
323
+
317
324
/**
318
325
* @override
319
326
*/
Original file line number Diff line number Diff line change @@ -187,6 +187,16 @@ shaka.device.DefaultBrowser = class extends shaka.device.AbstractDevice {
187
187
}
188
188
return super . supportsCbcsWithoutEncryptionSchemeSupport ( ) ;
189
189
}
190
+
191
+ /**
192
+ * @override
193
+ */
194
+ needWaitForEncryptedEvent ( keySystem ) {
195
+ if ( this . getBrowserEngine ( ) === shaka . device . IDevice . BrowserEngine . GECKO ) {
196
+ return keySystem . startsWith ( 'com.microsoft.playready.recommendation' ) ;
197
+ }
198
+ return super . needWaitForEncryptedEvent ( keySystem ) ;
199
+ }
190
200
} ;
191
201
192
202
shaka . device . DeviceFactory . registerDefaultDeviceFactory (
Original file line number Diff line number Diff line change @@ -229,6 +229,14 @@ shaka.device.IDevice = class {
229
229
* @return {boolean }
230
230
*/
231
231
supportsCbcsWithoutEncryptionSchemeSupport ( ) { }
232
+
233
+ /**
234
+ * Returns true if the platform needs to wait for the encrypted event in order
235
+ * to initialize CDM correctly.
236
+ * @param {string } keySystem
237
+ * @return {boolean }
238
+ */
239
+ needWaitForEncryptedEvent ( keySystem ) { }
232
240
} ;
233
241
234
242
/**
Original file line number Diff line number Diff line change @@ -593,14 +593,8 @@ shaka.drm.DrmEngine = class {
593
593
) || null ) : null ;
594
594
595
595
const keySystem = this . currentDrmInfo_ . keySystem ;
596
- let needWaitForEncryptedEvent = keySystem == 'com.apple.fps' ;
597
- const browserEngine =
598
- shaka . device . DeviceFactory . getDevice ( ) . getBrowserEngine ( ) ;
599
- if ( browserEngine === shaka . device . IDevice . BrowserEngine . GECKO &&
600
- keySystem . startsWith ( 'com.microsoft.playready.recommendation' ) ) {
601
- needWaitForEncryptedEvent = true ;
602
- }
603
-
596
+ const needWaitForEncryptedEvent = shaka . device . DeviceFactory . getDevice ( )
597
+ . needWaitForEncryptedEvent ( keySystem ) ;
604
598
/**
605
599
* We can attach media keys before the playback actually begins when:
606
600
* - If we are not using FairPlay Modern EME
You can’t perform that action at this time.
0 commit comments