Skip to content

Latest commit

 

History

History
34 lines (29 loc) · 1.12 KB

README.md

File metadata and controls

34 lines (29 loc) · 1.12 KB

clappr-youtube-playback

Clappr plugin for playing YouTube based videos

It uses the YouTube iframe API for managing the YouTube content.

Usage

Just embed the player enabling the plugin, setting source to YouTube video id:

var player = new Clappr.Player({
  sources: ['https://www.youtube.com/watch?v=7qmj0a8srCg'],
  poster: 'https://i.ytimg.com/vi/nfWlot6h_JM/hqdefault.jpg',
  parentId: '#player-wrapper',
  plugins: {
    playback: [YoutubePlayback]
  }
});

You can try it here.

Playlist support

Although using an array of video ids to create a dynamic playlist is still not supported, the plugin has support for YouTube lists. Just omit the parameter source or sources and add youtubePlaylist instead, like the example:

var player = new Clappr.Player({
  poster: 'https://i.ytimg.com/vi/nfWlot6h_JM/hqdefault.jpg',
  parentId: '#player-wrapper',
  youtubeShowRelated: true,
  youtubePlaylist: 'PUANLZYMidaCbLQFWXBC95Jg',
  plugins: {
    playback: [YoutubePlayback]
  }
});