Skip to content

Commit

Permalink
Fix error detection on video poster
Browse files Browse the repository at this point in the history
  • Loading branch information
eXon committed Dec 15, 2015
1 parent 0ab93ad commit 145ca43
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Youtube.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 145ca43

Please sign in to comment.