Captive Portal Customizations - YouTube Player

From Social ID Developers
Jump to: navigation, search

Description

YouTube video player configuration.

It's recommended to customize the player in the Layout configuration to make sure they it is applied to all videos.

See also:

Default Values

youtubePlayerOptions: {
  videoId1: [dynamic],
  height2: '390',
  width2: '640',
  playerVars: {
    playsinline: 0,
    rel: 0,
    showinfo: 0
  }
}

1 videoId cannot be set.

2 height and width are actually overridden by CSS classes.

Customization Example

<script>
  appConfig.customization = appConfig.customization || {};
  appConfig.customization.youtubePlayerOptions = {
    playerVars: {
      controls: 0,
      modestbranding: 1,
      hl: 'pt'
    },
    events: {
      onStateChange: function(event) {
        if (event.data == 0) { // video ended
          alert('Thank you for watching!');
        }
      }
    }
  };
</script>
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox