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

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

Revision 1238, 12.3 KB checked in by pablo, 3 years ago (diff)
  • Maintains aspect ratio going to/from fullscreen if "stretching" is set to "exactfit" 606
  • Automatically adds a thumbnail image for YouTube videos if one is not specified. 642
  • Fades the controlbar when the mouse leaves the screen. Also adds the 'controlbar.idlehide' option to keep the controlbar hidden when not playing. 883
Line 
1.. _options:
2
3Configuration Options
4=====================
5
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.
7
8Encoding
9--------
10
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:
12
13 * ? → %3F
14 * = → %3D
15 * & → %26
16
17If, for example, your **file** flashvar is at the location *getplaylist.php?id=123&provider=flv*, you must encode the option to:
18
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
27.. _options-playlist:
28
29Playlist properties
30-------------------
31
32To load a playlist, only a single flashvar is required:
33
34.. describe:: playlistfile ( undefined )
35
36   Location of an :ref:`XML playlist <playlistformats>` to load into the player.
37
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:
39
40.. describe:: duration ( 0 )
41
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:: mediaid ( undefined )
53
54   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.
55
56.. describe:: provider ( undefined )
57
58   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:
59
60   * **video**: progressively downloaded FLV / MP4 video, but also AAC audio. See :ref:`mediaformats`.
61   * **sound**: progressively downloaded MP3 files. See :ref:`mediaformats`.
62   * **image**: JPG/GIF/PNG images. See :ref:`mediaformats`.
63   * **youtube**: videos from Youtube. See :ref:`mediaformats`.
64   * **http**: FLV/MP4 videos using HTTP pseudo-streaming. See :ref:`httpstreaming`.
65   * **rtmp**: FLV/MP4/MP3 files or live streams using RTMP streaming. See :ref:`httpstreaming`.
66
67   .. note::
68     
69      In addition to these built-in providers, it is possible to load custom providers into the JW Player, e.g. for specific CDN support. Custom providers are packed in a separate SWF file, much like a **plugin**.
70
71      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.
72
73.. describe:: start ( 0 )
74
75   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.
76
77.. describe:: streamer ( undefined )
78
79   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`.
80
81.. note::
82
83   Technically, any playlist item property is also available as an option. In practice though, the properties *author*, *date*, *description*, *link*, *tags* and *title* are not used anywhere if a single media file is loaded.
84
85
86
87.. _options-layout:
88
89Layout
90------
91
92These flashvars control the look and layout of the player.
93
94.. describe:: controlbar ( bottom )
95
96   Position of the controlbar. Can be set to *bottom*, *top*, *over* and *none*.
97
98.. describe:: controlbar.idlehide ( false )
99
100   If **controlbar.position** is set to *over*, this option determines whether the controlbar stays hidden when the player is paused or stopped.
101
102.. describe:: dock ( true )
103
104   set this to **false** to show plugin buttons in controlbar. By default (*true*), plugin buttons are shown in the display.
105
106.. describe:: icons ( true )
107
108   set this to false to hide the play button and buffering icons in the display.
109   
110.. describe:: playlist ( none )
111
112   Position of the playlist. Can be set to *bottom*, *top*, *right*, *left*, *over* or *none*.
113
114.. describe:: playlistsize ( 180 )
115
116   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.
117
118.. describe:: skin ( undefined )
119
120   Location of a **skin** file, containing graphics which change the look of the player. There are two types of skins available:
121   
122   * **XML/PNG skins**: These skins consist of an XML file with settings and a bunch of PNG images. The files are packed up in a ZIP, which improves the time it takes for them to load over the network. Building your own skin is extremely easy and can be done with any basic image and text editor. See :ref:`skinning` for more info.
123   * **SWF skins**: These skins consist of a single SWF file, built using Adobe Flash. This type of skins has been supported since the 4.0 player. Since SWF skins can only be built using Flash (a $500+ package) and since this skinning model can easily break, SWF skins are considered deprecated in favor of PNG skins.
124
125   Our `AddOns repository <http://www.longtailvideo.com/addons>`_ contains a list of available skins.
126
127
128
129.. _options-behavior:
130
131Behavior
132---------
133
134These flashvars control the playback behavior of the player.
135
136.. describe:: autostart ( false )
137
138   Set this to *true* to automatically start the player on load.
139
140.. describe:: bufferlength ( 1 )
141
142   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).
143
144.. describe:: id ( undefined )
145
146    Unique identifier of the player in the HTML DOM. You only need to set this option if you want to use the :ref:`javascriptapi` and want to target Linux users.
147
148   The ID is needed by JavaScript to get a reference to the player. On Windows and Mac OS X, the player automatically reads the ID from the *id* and *name* attributes of the player's `HTML embed code <embedding>`. On Linux however, this functionality does not work. Setting the **id** option in addition to the HTML attributes will fix this problem.
149
150.. describe:: item ( 0 )
151
152    :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.
153
154.. describe:: mute ( false )
155
156   Mute the sounds on startup. Is saved in a cookie.
157
158.. describe:: playerready ( undefined )
159
160   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()*).
161
162.. describe:: plugins ( undefined )
163
164   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.
165
166.. describe:: repeat ( none )
167
168   What to do when the mediafile has ended. Has several options:
169
170   * **none**: do nothing (stop playback) whever a file is completed.
171   * **list**: play each file in the playlist once, stop at the end.
172   * **always**: continously play the file (or all files in the playlist).
173   * **single**: continously repeat the current file in the playlist.
174
175.. describe:: shuffle ( false )
176
177   Shuffle playback of playlist items. The player will randomly pick the items.
178
179.. describe:: smoothing ( true )
180
181   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.
182
183.. describe:: stretching ( uniform )
184
185   Defines how to resize the poster image and video to fit the display. Can be:
186
187   * **none**: keep the original dimensions.
188   * **exactfit**: disproportionally stretch the video/image to exactly fit the display.
189   * **uniform**: stretch the image/video while maintaining its aspect ratio. Borders will appear around the image/video.
190   * **fill**: stretch the image/video while maintaining its aspect ratio, completely filling the display.  This results in cropping the media.
191
192.. describe:: volume ( 90 )
193
194   Startup audio volume of the player. Can be 0 to 100.
195
196
197
198.. _options-logo:
199
200Logo
201----
202
203Unlicensed 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:
204
205.. describe:: logo.file ( undefined )
206
207   Location of an external JPG, PNG or GIF image to be used as watermark. PNG images with transparency give the best results.
208
209.. describe:: logo.link ( undefined )
210
211   HTTP link to jump to when the watermark image is clicked. If it is not set, a click on the watermark does nothing.
212
213.. describe:: logo.linktarget ( _blank )
214
215   Link target for logo click.  Can be *_self*, *_blank*, *_parent*, *_top* or a named frame.
216
217.. describe:: logo.hide ( true )
218
219   By default, the logo will automatically show when the player buffers and hide 3 seconds later. When this option is set *false*, the logo will stay visible all the time.
220
221.. describe:: logo.position ( bottom-left )
222
223   This sets the corner in which to display the watermark. It can be one of the following:
224
225   * **bottom-left**
226   * **bottom-right**
227   * **top-left**
228   * **top-right**
229
230.. describe:: logo.timeout ( 3 )
231
232   When logo.hide is set to *true*, this option sets the number of seconds the logo is visible after it appears.
233
234.. note::
235
236   Once again: the logo options can only be used for licensed players!
237
238
239
240.. _options-colors:
241
242Colors
243------
244
245These options are available when either using no skin or when using skins built with the older SWF skinning model (these skins have the extension *.swf*).  These color options will be deprecated once SWF skinning support is dropped in a future release.
246
247.. describe:: backcolor ( ffffff )
248
249   background color of the controlbar and playlist. This is white  by default.
250
251.. describe:: frontcolor ( 000000 )
252
253   color of all icons and texts in the controlbar and playlist. Is black by default.
254
255.. describe:: lightcolor ( 000000 )
256
257   Color of an icon or text when you rollover it with the mouse. Is black by default.
258
259.. describe:: screencolor ( 000000 )
260
261   Background color of the display. Is black by default.
262
263
264The 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).
265
266
267.. _options-config:
268
269Config XML
270----------
271
272All options can be listed in an XML file and then fed to the player with a single option:
273
274.. describe:: config ( undefined )
275
276   location of a XML file with flashvars. Useful if you want to keep the actual embed codes short. Here's an example:
277
278Here is an example of such an XML file:
279
280.. code-block:: xml
281
282   <config>
283           <image>files/bunny.jpg</image>
284           <repeat>true</repeat>
285           <volume>40</volume>
286           <playlist>right</playlist>
287           <playlist.size>150</playlist.size>
288           <controlbar>over</controlbar>
289   </config>
290
291Options set in the embed code will overwrite those set in the config XML.
292
293.. note::
294
295   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.