From ec2cd3d6a000ba5b0478023701e9157c0cbc80c6 Mon Sep 17 00:00:00 2001 From: Tamius Han Date: Wed, 17 Feb 2021 01:06:11 +0100 Subject: [PATCH] Fix DRM detector bugs --- src/ext/lib/ar-detect/DrmDetecor.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ext/lib/ar-detect/DrmDetecor.js b/src/ext/lib/ar-detect/DrmDetecor.js index 6462387..b264b30 100644 --- a/src/ext/lib/ar-detect/DrmDetecor.js +++ b/src/ext/lib/ar-detect/DrmDetecor.js @@ -25,7 +25,7 @@ export function hasDrm(video) { const canvas = document.createElement('canvas'); canvas.width = 2; canvas.height = 2; - const context = canvas.getContext(); + const context = canvas.getContext('2d'); if (BrowserDetect.firefox) { try { @@ -43,6 +43,7 @@ export function hasDrm(video) { // of whether the video is actually DRM-protected or not. context.drawImage(video, 0, 0, canvas.width, canvas.height); - return this.blackframeContext.getImageData(0,0,1,1).data[3] === 0; + + return context.getImageData(0,0,1,1).data[3] === 0; } } \ No newline at end of file