1
0
mirror of https://github.com/videojs/video.js.git synced 2025-01-08 07:00:10 +02:00

fix: DRM content goes black in IE/Edge when focus is placed on video element (#6508)

This is a followup from #6318 but for the poster image.
This commit is contained in:
Darius Oleskevicius 2020-03-11 07:35:54 +11:00 committed by GitHub
parent 47349c8e29
commit cc2b82b8d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6,6 +6,7 @@ import Component from './component.js';
import * as Fn from './utils/fn.js';
import * as Dom from './utils/dom.js';
import {silencePromise} from './utils/promise';
import * as browser from './utils/browser.js';
/**
* A `ClickableComponent` that handles showing the poster image for the player.
@ -112,7 +113,15 @@ class PosterImage extends ClickableComponent {
return;
}
if (this.player_.tech(true)) {
const sourceIsEncrypted = this.player_.usingPlugin('eme') &&
this.player_.eme.sessions &&
this.player_.eme.sessions.length > 0;
if (this.player_.tech(true) &&
// We've observed a bug in IE and Edge when playing back DRM content where
// calling .focus() on the video element causes the video to go black,
// so we avoid it in that specific case
!((browser.IE_VERSION || browser.IS_EDGE) && sourceIsEncrypted)) {
this.player_.tech(true).focus();
}