Share

This plugin adds a share menu to the player, allowing you to share a link to the video.

Available share menu options

share option description
Link copies a link to clipboard
Facebook opens a facebook share popup
Twitter opens a twitter tweet popup

Installation

Include the plugin next to the core player:

Copy
Copied
<script src="//cdn.flowplayer.com/releases/native/3/stable/flowplayer.min.js"></script>
<script src="//cdn.flowplayer.com/releases/native/3/stable/plugins/share.min.js"></script>

Optionally, include the Message overlays plugin to flash a message on the player when text is copied to the clipboard:

Copy
Copied
<script src="//cdn.flowplayer.com/releases/native/3/stable/plugins/message.min.js"></script>

Configuration

The plugin is configured in top level configuration under the share namespace.

Configuration properties:

option description
link boolean or string string: url to be shared / copied boolean: if set to true, window.location.toString() (the currrent url in the browser) is used
twitter boolean true/false. Whether to show the Twitter option. Value of link is used to determine what to share.
facebook boolean true/false. Whether to show the Facebook option. Value of link is used to determine what to share.

Sample code

Copy
Copied
var player = flowplayer('#container', {
  src: '//edge.flowplayer.org/bauhaus.mp4',
  share: {
    link: true,
    facebook: true,
    twitter: false,
    iframe: 'https://example.com/iframe.html'
  }
})
Copy
Copied
var player = flowplayer('#container', {
  src: '//edge.flowplayer.org/bauhaus.mp4',
  share: {
    link: 'https://example.com/facebookstandalone.html',
    facebook: true,
    twitter: false,
    iframe: 'https://example.com/iframe.html'
  }
})

Demo

Codepen