Warning: HTML preview using PygmentsRenderer failed (TypeError: function() takes at least 2 arguments (0 given))

source: trunk/fl5/doc/publishers/options.rst @ 1104

Revision 1104, 10.9 KB checked in by jeroen, 3 years ago (diff)

rewritten playlists/mediaformats/options guides and fixed crosslinks, references to 'type' and pdf rendering.

RevLine 
[1069]1.. _options:
2
[1104]3Configuration Options
[1069]4=====================
5
[1104]6Here's a list of all configuration options (flashvars) the player accepts. Options are entered in the :ref:`embed code <embedding>` to set how the player looks and functions.
[1069]7
[1104]8Encoding
9--------
[1069]10
[1104]11First, a note on encoding. You must URL encode the three glyphs **?** **=** **&** inside flashvars, because of the way these flashvars are loaded into the player (as a querystring). The urlencoded values for these symbols are listed here:
[1069]12
13 * ? → %3F
14 * = → %3D
15 * & → %26
16
[1104]17If, for example, your **file** flashvar is at the location *getplaylist.php?id=123&provider=flv*, you must encode the option to:
[1069]18
[1104]19.. code-block:: html
20
21   getplaylist.php%3Fid%3D123%26provider%3Dflv
22
23The player will automatically URLdecode every option it receives.
24
25
26
[1070]27.. _options-playlist:
28
[1069]29Playlist properties
[1104]30-------------------
[1069]31
32To load a playlist, only a single flashvars is required:
33
[1104]34.. describe:: playlistfile ( undefined )
[1069]35
[1104]36   Location of an :ref:`XML playlist <playlistformats>` which will be loaded as the player :ref:`starts <startup>`.
[1069]37
[1104]38The following flashvars can be set instead of **playlistfile**. They are used to create a playlist with a single item.  They set various properties of the :ref:`media item <playlistformats>` to load (e.g. the source file or preview image or title). Those properties are:
[1069]39
[1104]40.. describe:: duration ( 0 )
[1069]41
[1104]42   Duration of the file in seconds. Set this to present the duration in the controlbar before the video starts. It can also be set to a shorter value than the actual file duration. The player will restrict playback to only that section.
43
44.. describe:: file ( undefined )
45
46   Location of the file or playlist to play, e.g. *http://www.mywebsite.com/myvideo.mp4*.
47
48.. describe:: image ( undefined )
49
50   Location of a preview (poster) image; shown in display before the video starts.
51
52.. describe:: link ( undefined )
53
54   URL to an external page the display can link to (see *displayclick* below). Sharing - related plugins also use this link.
55
56.. describe:: mediaid ( undefined )
57
58   Unique string (e.g. *9Ks83JsK*) used to identify this media file. Is used by certain plugins, e.g. for the targeting of advertisements. The player itself doesn't use this ID anywhere.
59
60.. describe:: provider ( undefined )
61
62   Set this flashvar to tell the player in which format (regular/streaming) the player is. By default, the **provider** is detected by the player based upon the file extension. If there is no suiteable extension, it can be manually set. The following provider strings are supported:
63
64   * **video**: progressively downloaded FLV / MP4 video, but also AAC audio. See :ref:`mediaformats`.
65   * **sound**: progressively downloaded MP3 files. See :ref:`mediaformats`.
66   * **image**: JPG/GIF/PNG images. See :ref:`mediaformats`.
67   * **youtube**: videos from Youtube. See :ref:`mediaformats`.
68   * **http**: FLV/MP4 videos using HTTP pseudo-streaming. See :ref:`httpstreaming`.
69   * **rtmp**: FLV/MP4/MP3 files or live streams using RTMP streaming. See :ref:`httpstreaming`.
70
71   .. note::
72     
73      In addition to these built-in providers, it is possible to load custom providers into the JW Player, e.g. for *Livestream.com* channels. Custom providers are packed in a separate SWF file, much like a **plugin**.
74
75      A number of custom providers is available from our `addons repository <http://www.longtailvideo.com/addons/>`_. Third party developers interested in building a custom provider should check our our `developer site <http://developer.longtailvideo.com/`_, which includes documentation and a MediaProvider SDK.
76
77.. describe:: start ( 0 )
78
79   Position in seconds where playback should start. This option works for :ref:`httpstreaming`, :ref:`rtmpstreaming` and the MP3 and Youtube :ref:`files <mediaformats>`. It does not work for regular videos.
80
81.. describe:: streamer ( undefined )
82
83   Location of an RTMP or HTTP server instance to use for streaming. Can be an RTMP application or external PHP/ASP file. See :ref:`rtmpstreaming` and :ref:`httpstreaming`.
84
85.. note::
86
87   Technically, any playlist item property is also available as an option. In practice though, the properties *author*, *date*, *description*,tags* and *title* are not used anywhere if a single media file is loaded.
88
89
90
91
[1070]92.. _options-layout:
93
[1069]94Layout
[1104]95------
[1069]96
[1104]97These flashvars control the looks of the player.
[1069]98
[1104]99.. describe:: controlbar ( bottom )
[1069]100
[1104]101   Position of the controlbar. Can be set to *bottom*, *over* and *none*.
[1082]102
[1104]103.. describe:: dock ( false )
104
105   set this to **true** to list plugin buttons in display. By default (*false*), plugin buttons are shown in the controlbar.
106
107.. describe:: playlist ( none )
108
109   Position of the playlist. Can be set to **bottom**, **right**, **left**, **over** or **none**.
110
111.. describe:: playlistsize ( 180 )
112
113   When the playlist is positioned below the display, this option can be used to change its height. When the playlist lives left or right of the display, this option represents its width. In the other cases, this option isn't needed.
114
115.. describe:: skin ( undefined )
116
117   Location of a so-called **skin**, an SWF file with the player graphics. Our `addons repository <http://www.longtailvideo.com/addons>`_ contains a list of available skins.
118
119The player has a simple :ref:`layout engine <layout>` which positions the controlbar, the playlist, and any positioned plugins.
120
121
122
123
124.. _options-behavior:
125
126Behaviour
127---------
128
129These flashvars control the playback behaviour of the player.
130
131.. describe:: autostart ( false )
132
133   Set this to *true* to automatically start the player on load.
134
135.. describe:: bufferlength ( 1 )
136
137   Number of seconds of the file that has to be loaded before the player starts playback. Set this to a low value to enable instant-start (good for fast connections) and to a high value to get less mid-stream buffering (good for slow connections).
138
139.. describe:: displayclick ( play )
140
141   What to do when a user clicks the display. Can be:
142
143   * **play**: toggle playback
144   * **link**: jump to the URL set by the *link* flashvar.
145   * **none**: do nothing (the handcursor is also not shown).
146
147.. describe:: item ( 0 )
148
149    :ref:`Playlist item <playlistformats>` that should start to play. Use this to start the player with a specific item instead of with the first item.
150
151.. describe:: mute ( false )
152
153   Mute the sounds on startup. Is saved in a cookie.
154
155.. describe:: playerready ( undefined )
156
157   By default, the player calls a :ref:`playerReady() <javascriptapi>` javascript function when it is initialized. This option is used to let the player call a different function after it's initialized (e.g. *registerPlayer()*).
158
159.. describe:: plugins ( undefined )
160
161   A powerful feature, this is a comma-separated list of plugins to load (e.g. **hd,viral**). Plugins are separate SWF files that extend the functionality of the player, e.g. with advertising, analytics or viral sharing features. Visit `our addons repository <http://www.longtailvideo.com/addons/>`_ to browse the long list of available plugins.
162
163.. describe:: repeat ( none )
164
165   What to do when the mediafile has ended. Has several options:
166
167   * **none**: do nothing (stop playback) whever a file is completed.
168   * **list**: play each file in the playlist once, stop at the end.
169   * **always**: continously play the file (or all files in the playlist).
170   * **single**: continously repeat the current file in the playlist.
171
172.. describe:: shuffle ( false )
173
174   Shuffle playback of playlist items. The player will randomly pick the items.
175
176.. describe:: smoothing ( true )
177
178   This sets the smoothing of videos, so you won't see blocks when a video is upscaled. Set this to **false** to disable the feature and get performance improvements with old computers / big files.
179
180.. describe:: stretching ( uniform )
181
182   Defines how to resize the poster image and video to fit the display. Can be:
183
184   * **none**: keep the original dimensions.
185   * **exactfit**: disproportionally stretch the video/image to exactly fit the display.
186   * **uniform**: stretch the image/video while maintaining its aspect ratio. There'll be black borders.
187   * **fill**: stretch the image/video while maintaining its aspect ratio, completely filling the display.
188
189.. describe:: volume ( 90 )
190
191   Startup audio volume of the player. Can be 0 to 100.
192
193
194
195
[1070]196.. _options-colors:
[1069]197
[1070]198Colors
[1104]199------
[1070]200
201These flashvars are available when using 4.x (SWF) skins.  They will be deprecated once SWF skinning support is dropped in a future release.
202
[1104]203.. describe:: backcolor ( ffffff )
[1070]204
[1104]205   background color of the controlbar and playlist. This is white  by default.
[1070]206
[1104]207.. describe:: frontcolor ( 000000 )
[1070]208
[1104]209   color of all icons and texts in the controlbar and playlist. Is black by default.
[1069]210
[1104]211.. describe:: lightcolor ( 000000 )
[1069]212
[1104]213   Color of an icon or text when you rollover it with the mouse. Is black by default.
[1069]214
[1104]215.. describe:: screencolor ( 000000 )
[1069]216
[1104]217   Background color of the display. Is black by default.
[1069]218
219
[1104]220The four color flashvars must be entered using hexadecimal values, as is common for `web colors <http://en.wikipedia.org/wiki/Web_colors#Hex_triplet>`_ (e.g. *FFCC00* for bright yellow).
[1069]221
222
[1104]223
224
225.. _options-logo:
226
227Logo
228----
229
230Unlicensed copies of the JW Player contain a small watermark that pops up when the player is buffering. In licensed copies of the player, this watermark is empty by default. It is possible to place your own watermark in the player using the following options:
231
232.. describe:: logo.file ( undefined )
233
234   Location of an external JPG, PNG or GIF image to be used as watermark. PNG images with transparency give the best results.
235
236.. describe:: logo.link ( undefined )
237
238   HTTP link to jump to when the watermark image is clicked. If it is not set, a click on the watermark does nothing.
239
240.. describe:: logo.hide ( true )
241
242   By default, the logo will automatically show when the player buffers and hide 5 seconds later. When this option is set *false*, the logo will stay visible all the time.
243
244.. describe:: logo.position ( bottom-left )
245
246   This sets the corner in which to display the watermark. It can be one of the following:
247
248   * **bottom-left**
249   * **bottom-right**
250   * **top-left**
251   * **top-right**
252
253
254.. note::
255
256   Once again: the logo options can only be used for licensed players!
257
258
259
260
[1069]261Config XML
[1104]262----------
[1069]263
[1104]264All options can be listed in an XML file and then fed to the player with a single option:
[1069]265
[1104]266.. describe:: config ( undefined )
[1069]267
[1104]268   location of a XML file with flashvars. Useful if you want to keep the actual embed codes short. Here's an example:
269
270Here is an example of such an XML file:
271
[1069]272.. code-block:: xml
273
[1104]274   <config>
275     <file>files/bunny.mp4</file>
276     <image>files/bunny.jpg</image>
277     <repeat>true</repeat>
278     <backcolor>333333</backcolor>
279     <volume>40</volume>
280     <controlbar>over</controlbar>
281   </config>
[1069]282
[1104]283Options set in the embed code will overwrite those set in the config XML.
284
285.. note::
286
287   Due to the :ref:`crossdomain` restrictions of Flash, you cannot load a config XML from one domain in a player on another domain. This issue can be circumvented by placing a *crossdomain.xml* file on the server that hosts your XML.
Note: See TracBrowser for help on using the repository browser.