npm-dom / youtube-video

Add Youtube videos into your page

Home Page:http://npm.im/youtube-video

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Extend the supported parameters.

iranreyes opened this issue · comments

Right now the only params that you are accepting are autoplay, controls and loop. Should be good to support all the parameters. This is very easy to do, I don't have time to do a PR but instead of pass the params with the option object, just pass it inside another attribute like:

Current Version

    youtubeVideo('XZmGGAbHqa0', {
      elementId: 'youtube-video',
      width: '100%',
      height: '100%',
      autoplay: false,
      controls: false
    }, function(error, playback){
      this.youtube = playback;
    }.bind(this));
  },

New Version

    youtubeVideo('XZmGGAbHqa0', {
      elementId: 'youtube-video',
      width: '100%',
      height: '100%',
      options: {
         autoplay: false,
         modestbranding: true,
         autohide:true,
         showinfo:false,
         controls: false
      },
    }, function(error, playback){
      this.youtube = playback;
    }.bind(this));
  },

and just extend the playerVars object of the API with the new options object...

Thanks, your module is very useful

Fixed by #5