From c1012c59a60e9840e5cf72ee97cf5fb0216363ce Mon Sep 17 00:00:00 2001 From: Tamius Han Date: Sat, 31 Aug 2019 18:21:49 +0200 Subject: [PATCH 1/5] Fix player detection --- src/ext/lib/video-data/PlayerData.js | 67 ++++++++++++++-------------- src/ext/lib/video-data/VideoData.js | 3 ++ 2 files changed, 37 insertions(+), 33 deletions(-) diff --git a/src/ext/lib/video-data/PlayerData.js b/src/ext/lib/video-data/PlayerData.js index 1b654bf..a3633f4 100644 --- a/src/ext/lib/video-data/PlayerData.js +++ b/src/ext/lib/video-data/PlayerData.js @@ -236,6 +236,7 @@ class PlayerData { getPlayer(isFullScreen) { const host = window.location.host; let element = this.video.parentNode; + const videoWidth = this.video.offsetWidth, videoHeight = this.video.offsetHeight; if(! element ){ if(Debug.debug) { @@ -274,18 +275,11 @@ class PlayerData { } } + const elementQ = []; + let scorePenalty = 0; + let score; - var trustCandidateAfterGrows = 2; // if candidate_width or candidate_height increases in either dimensions this many - // times, we say we found our player. (This number ignores weird elements) - // in case our