vendor/videojs/plugins/Youtube.js
function(){
      var uri = 'https://img.youtube.com/vi/' + this.url.videoId + '/maxresdefault.jpg';

      try {
        var image = new Image();
        image.onload = function(){
          // Onload may still be called if YouTube returns the 120x90 error thumbnail
          if('naturalHeight' in image){
            if (image.naturalHeight <= 90 || image.naturalWidth <= 120) {
              return;
            }
          } else if(image.height <= 90 || image.width <= 120) {
            return;
          }

          this.poster_ = uri;
          this.trigger('posterchange');
        }.bind(this);
        image.onerror = function(){};
        image.src = uri;
      }
      catch(e){}
    }
function(){
      var uri = 'https://img.youtube.com/vi/' + this.url.videoId + '/maxresdefault.jpg';

      try {
        var image = new Image();
        image.onload = function(){
          // Onload may still be called if YouTube returns the 120x90 error thumbnail
          if('naturalHeight' in image){
            if (image.naturalHeight <= 90 || image.naturalWidth <= 120) {
              return;
            }
          } else if(image.height <= 90 || image.width <= 120) {
            return;
          }

          this.poster_ = uri;
          this.trigger('posterchange');
        }.bind(this);
        image.onerror = function(){};
        image.src = uri;
      }
      catch(e){}
    }
function ( ) { var uri = 'https://img.youtube.com/vi/' + this . url . videoId + '/maxresdefault.jpg' ; try { var image = new Image ( ) ; image . onload = function ( ) { // Onload may still be called if YouTube returns the 120x90 error thumbnail if ( 'naturalHeight' in image ) { if ( image . naturalHeight <= 90 || image . naturalWidth <= 120 ) { return ; } } else if ( image . height <= 90 || image . width <= 120 ) { return ; } this . poster_ = uri ; this . trigger ( 'posterchange' ) ; } . bind ( this ) ; image . onerror = function ( ) { } ; image . src = uri ; } catch ( e ) { } }
Tries to get the highest resolution thumbnail available for the video
Tries to get the highest resolution thumbnail available for the video