From 145ca4337633ad20c3cf5ea19715670de9be95f3 Mon Sep 17 00:00:00 2001 From: Benoit Tremblay Date: Tue, 15 Dec 2015 09:28:56 -0500 Subject: [PATCH] Fix error detection on video poster --- src/Youtube.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Youtube.js b/src/Youtube.js index 7fbeb493..b6782f8d 100644 --- a/src/Youtube.js +++ b/src/Youtube.js @@ -522,8 +522,8 @@ THE SOFTWARE. */ var image = new Image(); image.onload = function(){ // Onload may still be called if YouTube returns the 120x90 error thumbnail - if('naturalHeight' in this){ - if(this.naturalHeight <= 90 || this.naturalWidth <= 120) { + if('naturalHeight' in image){ + if(image.naturalHeight <= 90 || image.naturalWidth <= 120) { this.onerror(); return; }