source: plugins/related/doc/guide.html @ 1940

Revision 1940, 7.9 KB checked in by jeroen, 22 months ago (diff)

wrapped up tests and Flash version of related plugin

Line 
1<html>
2<head>
3<title>Related Plugin Reference</title>
4<style>
5    body { padding: 50px 100px; width: 660px; font: 13px/20px Arial; background: #FFF; }
6    a , h1, h2{ color: #369; }
7    h1 { font-size: 32px; }
8    h2 { margin-top: 50px; }
9    h3 { margin-top: 25px; }
10    img, #player { -webkit-box-shadow: 0 0 5px #999; margin: 0 10px; }
11    pre { font-size: 12px; background: #E5F3C8; padding:5px 10px; border: 1px solid #D3EAA4; }
12    dd { color: #333; font-style: italic; }
13</style>
14</head><body>
15
16<h1>Related Plugin Reference</h1>
17
18
19
20<h2>Purpose</h2>
21
22<p>The purpose of this guide is to give you a feature overview of the <a href="http://www.longtailvideo.com/addons/plugins/">Related plugin for JW Player</a>.</p>
23
24
25
26<h2>Introduction</h2>
27
28<p>The Related plugin for the JW Player presents a screen with related videos to your viewers. This screen is shown when a video is completed or when a viewer presses the <em>related</em> button. Upon clicking a related video, the viewer is redirected to the page with that video, improving user engagement and advertising opportunities.</p>
29
30<p><img alt="Related Example Player" src="assets/related_example.png" style="margin-left: 10px" /></p>
31
32<p>The list of related videos is loaded using an mRSS feed. The plugin automatically renders up t0 2 rows of up to 5 related videos, depending upon how many fit the screen. Buttons for re-playing the video and for closing the overlay are shown in the top corners.</p>
33
34<p>The plugin works in both Flash and HTML5, including touch devices like the iPad/iPhone and Android.  When using a playlist, every entry can have its own related videos.</p>
35
36
37
38<h2>Configuration Options</h2>
39
40<p>The Related plugin supports the following configuration options:</p>
41
42<dl>
43<dt><strong>related.file</strong> ( <em>undefined</em> )</dt>
44<dd>Location of the mRSS file with related videos, e.g. <strong>http://example.com/related.xml</strong>.</dd>
45<dt><strong>related.oncomplete</strong> ( <em>true</em> )</dt>
46<dd>Whether to display the related videos screen when the video is completed. When set <strong>false</strong>, the screen does not automatically pop up.</dd>
47<dt><strong>related.usedock</strong> ( <em>true</em> )</dt>
48<dd>Whether to add a button to the player to pop up the related videos screen manually. When set <strong>false</strong>, this button is omitted.</dd>
49<dt><strong>related.heading</strong> ( <em>Watch related videos</em> )</dt>
50<dd>Single line heading displayed above the grid with related videos. Generally contains a short call-to-action.</dd>
51</dl>
52
53<h3>Example</h3>
54
55<p>Here is a basic example of the plugin, setting just a <em>related.file</em>:</p>
56
57<pre>
58&lt;div id=&#39;player&#39;&gt;Get Flash to see the video&lt;/div&gt;
59&lt;script type=&quot;text/javascript&gt;
60  jwplayer(&#39;player&#39;).setup({
61    file: &#39;/assets/bbb.mp4&#39;,
62    flashplayer: &#39;/assets/player.swf&#39;,
63    plugins: {
64      'related-1': {
65        file: &#39;/assets/bbb-related.xml&#39;
66      }
67    }
68  });
69&lt;/script&gt;
70</pre>
71
72<p>This example uses the - preferred - <a href="http://www.longtailvideo.com/support/jw-player/jw-player-for-flash-v5/15995/jw-embedder-reference-guide">JW Embedder method</a>. Please see our <a href="http://www.longtailvideo.com/support/jw-player/jw-player-for-flash-v5/12538/supported-player-embed-methods">Supported Embed Methods</a> guide for other options like SWFObject.</p>
73
74
75<h2>The mRSS File</h2>
76
77<p>The mRSS feed is loaded into the <strong>file</strong> option of the plugin is can be any standard feed, just like for the <a href="http://www.longtailvideo.com/support/jw-player/jw-player-for-flash-v5/19824/playlist-support-in-the-jw-player">JW Player playlist</a>. The <em>title</em>, <em>link</em> and <em>media:thumbnail</em> options are required and used by the plugin. All other data in the mRSS feed is ignored. Here's an example feed with three related videos:</p>
78
79<pre>
80&lt;rss version=&quot;2.0&quot; xmlns:media=&quot;http://search.yahoo.com/mrss/&quot;&gt;
81  &lt;channel&gt;
82    &lt;item&gt;
83      &lt;title&gt;Big Buck Bunny&lt;/title&gt;
84      &lt;link&gt;http://example.com/watch/28839&lt;/link&gt;
85      &lt;media:thumbnail&gt;http://example.com/thumbs/28839.jpg&lt;/media:thumbnail&gt;
86    &lt;/item&gt;
87
88    &lt;item&gt;
89      &lt;title&gt;Sintel&lt;/title&gt;
90      &lt;link&gt;http://example.com/watch/21987&lt;/link&gt;
91      &lt;media:thumbnail&gt;http://example.com/thumbs/21987.jpg&lt;/media:thumbnail&gt;
92    &lt;/item&gt;
93
94    &lt;item&gt;
95      &lt;title&gt;Elephant's Dream&lt;/title&gt;
96      &lt;link&gt;http://example.com/watch/8791&lt;/link&gt;
97      &lt;media:thumbnail&gt;http://example.com/thumbs/8791.jpg&lt;/media:thumbnail&gt;
98    &lt;/item&gt;
99  &lt;/channel&gt;
100&lt;/rss&gt;
101</pre>
102
103<p>Entries in the mRSS feed that do not contain a title, link and thumbnail are ignored. If the mRSS feed has 0 valid entries, or if the mRSS feed fails loading or parsing:</p>
104
105<ul>
106    <li>The button in the <em>dock</em> is greyed out.</li>
107    <li>The <em>related videos</em> screen is not displayed.</li>
108</ul>
109
110
111
112
113<h2>Playlist Support</h2>
114
115<p>Related videos can be assigned to one or more videos in a playlist. The functionality is available for both inline and mRSS playlists. Instead of setting the related file URL in the plugin configuration, they are set in the playlist.</p>
116
117<p>Since the mRSS playlist format defines no elements for linking to related files, it should be set using the <a href="http://www.longtailvideo.com/support/jw-player/jw-player-for-flash-v5/12537/xml-playlist-support">JWPlayer XML namespace</a>. In practice, the namespace is enabled by:</p>
118
119<ul>
120<li>Setting an <b>xmlns:jwplayer</b> attribute in the main RSS tag.</li>
121<li>Prefixing the XML elements with <strong>jwplayer:</strong> (<i>&lt;jwplayer:related.file&gt;</i>).</li>
122</ul>
123
124<h3> Example</h3>
125
126<p> The config solely needs a reference to the plugin:</p>
127
128<pre>
129&lt;div id=&#39;player&#39;&gt;Get Flash to see the video&lt;/div&gt;
130&lt;script type=&quot;text/javascript&gt;
131  jwplayer(&#39;player&#39;).setup({
132    flashplayer: &#39;/assets/player.swf&#39;,
133    playlistfile: &#39;/assets/playlist.xml&#39;,
134    plugins: {
135      'related-1': {}
136    }
137  });
138&lt;/script&gt;
139</pre>
140
141<p>In the <strong>playlist.xml</strong>, the <em>jwplayer:related.file</em> element defines the related videos feed for each entry:</p>
142
143<pre>
144&lt;rss version=&quot;2.0&quot; xmlns:jwplayer=&quot;http://developer.longtailvideo.com/&quot;&gt;
145  &lt;channel&gt;
146    &lt;item&gt;
147      &lt;title&gt;My first video&lt;/title&gt;
148      &lt;description&gt;This one starts the playlist.&lt;/description&gt;
149      &lt;jwplayer:file&gt;video.mp4&lt;/jwplayer:file&gt;
150      &lt;jwplayer:related.file&gt;video-related.xml&lt;/jwplayer:related.file&gt;
151    &lt;/item&gt;
152
153    &lt;item&gt;
154      &lt;title&gt;My second video&lt;/title&gt;
155      &lt;description&gt;This one concludes it all.&lt;/description&gt;
156      &lt;jwplayer:file&gt;video-2.mp4&lt;/jwplayer:file&gt;
157      &lt;jwplayer:related.file&gt;video-2-related.xml&lt;/jwplayer:related.file&gt;
158    &lt;/item&gt;
159  &lt;/channel&gt;
160&lt;/rss&gt;
161</pre>
162
163<p>Note the <i>xmlns:jwplayer</i> at the top! It is needed to validate the <i>jwplayer:related.file</i> elements.</p>
164
165
166
167<h2>Device Support</h2>
168
169<p>On touch devices (iPhone, iPad, Android), the related plugin fully functions, with one exception: the Related dock button is not available when the video is playing. This because no custom controls can be shown when a video plays in fullscreen.</p>
170
171<p>Before and after playback, the player is displayed inline in the page and the related videos screen is available:</p>
172
173<p><img alt="Related on iPhone" src="assets/related_iphone.png" style="margin-left: 10px" /></p>
174
175
176
177<h2>Changelog</h2>
178
179<h3>Version 1.0</h3>
180<ul>
181<li>Load related videos using an mRSS feed.</li>
182<li>Enter related screen through dock button or upon complete.</li>
183<li>Support for Flash and HTML5 modes (including touch devices).</li>
184<li>Support for related videos per playlist entry.</li>
185</ul>
186
187
188
189</body>
190</html>
Note: See TracBrowser for help on using the repository browser.