This is a message.

Styling the viral videos plugin

Customize the viral videos plugin to match your site

standalone demo

Here is the viral videos plugin with customized colors everywhere.

Configuration

The configuration shown below defines the custom colors for the canvas, buttons, labels and text fields. See the Viral Videos plugin documentation for descriptions for these options.

flowplayer("vvplayer", "http://releases.flowplayer.org/swf/flowplayer-3.2.18.swf", {
 

'plugins': {
'viral': {
'url': 'flowplayer.viralvideos-3.2.14.swf',
 
'share': {
'description': 'Extreme surfers riding big waves'
},
 
'icons': {
'overColor': 'rgba(255,10,10,0.5)'
},
 
'buttons': {
'color': 'rgba(47,69,45,1)',
'overColor': '#96b096',
'fontColor': '#122c10',
'lineColor': '#2f452d'
},
'canvas': {
'backgroundColor': 'rgba(31,114,35,0.8)',
'.label': {
'color': '#122c10',
'fontWeight': 'bold'
},
'.title': {
'color': '#122c10',
'fontWeight': 'bold'
},
'.input': {
'color': '#bee0be',
'backgroundColor': '#2f452d'
},
'.embed': {
'color': '#bee0be',
'backgroundColor': '#2f452d',
'fontSize': 6,
'fontWeight': 'normal'
}
},
'closeButton': {
'color': 'rgba(47,69,45,1)',
'overColor': 'rgba(255,0,0,0.5)'
}
}
},
'clip': {
'url': 'http://stream.flowplayer.org/Extremists.flv',
'pageUrl': 'http://flash.flowplayer.org/demos/plugins/flash/viralvideos-colored.html',
'autoPlay': false
}
 
// show the plugin right away
,onLoad: function() {
this.getPlugin("viral").fadeIn();
}
});

JavaScript

HTML meta tags to share the player

When you share this page on certain social networks like Facebook, not only a link back to this page is shared but also the player. This viral spreading of the media itself is achieved by adding HTML meta attributes to your page.

Here are the HTML tags and attributes needed to share this page with the player:

<!doctype html>
<html xmlns:og="http://ogp.me/ns#" xmlns:fb="http://www.facebook.com/2008/fbml">
<head>
<!-- ... other head tags go here ... -->
 
<!-- "old-fashioned" meta tags -->
<meta name="medium" content="video" />
<meta name="title" content="Styling the viral videos plugin" />
<meta name="description" content="Customize the viral videos plugin to match your site" />
<meta name="video_type" content="application/x-shockwave-flash" />
<meta name="video_height" content="360" />
<meta name="video_width" content="640" />
<link rel="image_src" href="http://d12zt1n3pd4xhr.cloudfront.net/fp/img/flow_eye.jpg" />
<link rel="video_src"
href="https://d12zt1n3pd4xhr.cloudfront.net/fp/swf/flowplayer-3.2.18.swf?config=https%3A%2F%2Fd12zt1n3pd4xhr.cloudfront.net%2Ffp%2Fjs%2Fsecure_viral_videos_colored.js" />
 
<!-- open graph meta properties -->
<meta property="og:url" content="http://flash.flowplayer.org/demos/plugins/flash/viralvideos-colored.html" />
<meta property="og:site_name" content="Flowplayer" />
<meta property="og:type" content="movie" />
<meta property="og:title" content="Styling the viral videos plugin" />
<meta property="og:description" content="Customize the viral videos plugin to match your site" />
<meta property="og:video:height" content="360" />
<meta property="og:video:width" content="640" />
<meta property="og:image" content="http://d12zt1n3pd4xhr.cloudfront.net/fp/img/flow_eye.jpg" />
<meta property="og:image:secure_url" content="https://d12zt1n3pd4xhr.cloudfront.net/fp/img/flow_eye.jpg" />
<meta property="og:video:type" content="application/x-shockwave-flash" />
<meta property="og:video"
content="https://d12zt1n3pd4xhr.cloudfront.net/fp/swf/flowplayer-3.2.18.swf?config=https%3A%2F%2Fd12zt1n3pd4xhr.cloudfront.net%2Ffp%2Fjs%2Fsecure_viral_videos_colored.js" />
<meta property="og:video:secure_url"
content="https://d12zt1n3pd4xhr.cloudfront.net/fp/swf/flowplayer-3.2.18.swf?config=https%3A%2F%2Fd12zt1n3pd4xhr.cloudfront.net%2Ffp%2Fjs%2Fsecure_viral_videos_colored.js" />
</head>

HTML

Most of the above tags are self-explanatory. Some of them, like og:title, may be used to override a page attribute for more specific use in media sharing.

We have two groups of meta tags with overlapping content. A network like MySpace needs the group which is labeled 'old-fashioned', while Facebook and others prefer the Open Graph protocol.

For Facebook and Open Graph it is recommended that you add these schemas to the html tag:

<html xmlns:og="http://ogp.me/ns#" xmlns:fb="http://www.facebook.com/2008/fbml">

HTML

Find out more about Facebook's handling of Open Graph properties here.

Video meta tags

The tags responsible for sharing the player are: video_src, og:video, og:video:secure_url. Their value is an URL pointing to the location of the Flowplayer swf file with a query containing the player configuration:

http://example.com/path/to/flowplayer-3.2.18.swf?
config=http%3A%2F%2Fexample.com%2Fpath%2Fto%2Fconfig.js

Shared configuration

Shared players are embedded by social networks using an OBJECT tag. The configuration part therefore is formatted the same way as the flashvars parameter of the object tag and must then be url-encoded as it is the query part of an URL.

The same restrictions apply as for all alternate embedding methods which install Flowplayer without its JavaScript API.

Ensure that the URLs of the Flowplayer assets (logo, plugins etc.) in the configuration of the og:video:secure_url tag resolve to a HTTPS location. Using HTTPS for all video locations is recommended.

We recommend using an external configuration file because url-encoding even a simple configuration is error-prone and hard to maintain. As you can only share one player per page anyway - albeit from various locations - this is much easier as long as you stick to a consistent naming scheme. Often the shared configuration will vary slightly from the configuration of the player on the originating page, and then again a human-readable configuration is easier to set up - as in this demo. Note however, that the external configuration file used for sharing must be served from the same domain as the core player flowplayer-3.2.18.swf.

The external configuration file for sharing the player on this page can be found here, and its HTTPS 'secure' version here.

Debugging meta tags

Check the meta tags of your page in Facebook's Debugger.

Try the value of the video meta tags in action by entering them in your browser's location bar. For this page just click on the following link which is the value of og:video:secure_url, and the shared player will open in its own window:

https://d12zt1n3pd4xhr.cloudfront.net/fp/swf/flowplayer-3.2.18.swf?config=https%3A%2F%2Fd12zt1n3pd4xhr.cloudfront.net%2Ffp%2Fjs%2Fsecure_viral_videos_colored.js