Optimize catching DRM protected videos.
This commit is contained in:
parent
2a7001ea3a
commit
be6df178f6
@ -552,27 +552,25 @@ class ArDetector {
|
|||||||
// special browsers require special tests
|
// special browsers require special tests
|
||||||
if (this.hasDRM()) {
|
if (this.hasDRM()) {
|
||||||
this.fallbackMode = false;
|
this.fallbackMode = false;
|
||||||
throw 'Video is protected by DRM. Autodetection cannot run here.';
|
throw 'VIDEO_DRM_PROTECTED';
|
||||||
}
|
}
|
||||||
this.fallbackMode = false;
|
this.fallbackMode = false;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
this.logger.log('error', 'arDetect', `%c[ArDetect::frameCheck] <@${this.arid}> %c[ArDetect::frameCheck] can't draw image on canvas. ${this.canDoFallbackMode ? 'Trying canvas.drawWindow instead' : 'Doing nothing as browser doesn\'t support fallback mode.'}`, "color:#000; backgroud:#f51;", e);
|
this.logger.log('error', 'arDetect', `%c[ArDetect::frameCheck] <@${this.arid}> %c[ArDetect::frameCheck] can't draw image on canvas. ${this.canDoFallbackMode ? 'Trying canvas.drawWindow instead' : 'Doing nothing as browser doesn\'t support fallback mode.'}`, "color:#000; backgroud:#f51;", e);
|
||||||
|
|
||||||
// nothing to see here, really, if fallback mode isn't supported by browser
|
|
||||||
if (!this.drmNotificationShown) {
|
|
||||||
this.drmNotificationShown = true;
|
|
||||||
|
|
||||||
// if we detect Edge, we'll throw the aggressive popup
|
|
||||||
this.conf.player.showEdgeNotification();
|
|
||||||
this.conf.player.showNotification('AARD_DRM');
|
|
||||||
|
|
||||||
this.conf.resizer.setAr({type: AspectRatio.Reset});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// in case of DRM errors, we need to prevent the execution to reach the aspec
|
// in case of DRM errors, we need to prevent the execution to reach the aspec
|
||||||
// ratio setting part of this function
|
// ratio setting part of this function. For the time being, we're only stopping
|
||||||
if (e === 'Video is protected by DRM. Autodetection cannot run here.') {
|
// in case we encounter DRM error in Chrome. Firefox has fallback mode and generates
|
||||||
|
// different error, so that goes.
|
||||||
|
if (e === 'VIDEO_DRM_PROTECTED') {
|
||||||
|
// nothing to see here, really, if fallback mode isn't supported by browser
|
||||||
|
if (!this.drmNotificationShown) {
|
||||||
|
this.drmNotificationShown = true;
|
||||||
|
|
||||||
|
this.conf.player.showNotification('AARD_DRM');
|
||||||
|
this.conf.resizer.setAr({type: AspectRatio.Reset});
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user