The purpose of this guide is to be a reference for you as you get started with the latest version of the Sharing plugin for the JW Player.
The sharing plugin works in both Flash and HTML5 mode. It provides a dialog window with two input fields:
Below the input fiels, shortcuts are provided for sharing the video link on Facebook and Twitter
Note that, with Facebook, it is possible to share an inline video player by setting some meta tags in the <head> of your page.
The plugin is loaded with the plugins=sharing-3 option in the JW Player. This ensures you load version 3 of the plugin, which includes HTML5 support. In addition to the plugin assignor, two dedicated flashvars are supported:
<embed src="http://mysite.com/player123.swf" width="480" height="270" allowfullscreen="true" />
Since the embed code may contain special characters like <, " or &, you should URIEncode the string in the embed code of your player. The JW Player will automatically decode your string when it is loaded. See the beginning of this guide for more info.
Here is a basic embed code example of a player using the sharing plugin. This example uses the JW Embedder:
In addition to setting them in the embed code, the two sharing options can also be set per playlist entry. This works for both inline playlists and XML playlists.
Since none of the XML playlist formats define elements for setting sharing links and codes, the two options should be set using the JWPlayer XML namespace. In practice, the namespace is enabled by:
Here is a basic example; an RSS playlist with one entry that has both a sharing.link and sharing.code defined.
<rss version="2.0" xmlns:jwplayer="http://developer.longtailvideo.com/"> <channel> <title>Example RSS playlist with sharing options</title> <item> <title>Both code and link</title> <enclosure url="http://content.bitsontherun.com/videos/nPripu9l.mp4" /> <jwplayer:sharing.link> http://www.longtailvideo.com </jwplayer:sharing.link> <jwplayer:sharing.code> <![CDATA[ <embed src="http://video.longtailvideo.com/players/nPripu9l-ALJ3XQCI.swf" width="480" height="270" allowfullscreen="true" /> ]]> </jwplayer:sharing.code> </item> </channel> </rss>Since the embed code may contain special characters like <, " or &, you should enclose it in CDATA tags in the playlist, as displayed in the above example. Otherwise, the XML syntax of the playlist will be broken. `See the playlist support guide