| 1 | .. _options: |
|---|
| 2 | |
|---|
| 3 | Configuration Options |
|---|
| 4 | ===================== |
|---|
| 5 | |
|---|
| 6 | Here'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 | |
|---|
| 8 | Encoding |
|---|
| 9 | -------- |
|---|
| 10 | |
|---|
| 11 | First, 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 | |
|---|
| 17 | If, 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 | |
|---|
| 23 | The player will automatically URLdecode every option it receives. |
|---|
| 24 | |
|---|
| 25 | |
|---|
| 26 | |
|---|
| 27 | .. _options-playlist: |
|---|
| 28 | |
|---|
| 29 | Playlist properties |
|---|
| 30 | ------------------- |
|---|
| 31 | |
|---|
| 32 | To 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 | |
|---|
| 38 | The 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 | .. describe:: netstreambasepath ( undefined ) |
|---|
| 86 | |
|---|
| 87 | The netstreambasepath should be set to a string reprenting a URL. Introduced in JW Player 5.4, this configuration parameter directs the **video** and **http** media providers to request video files relative to the specified netstreambasepath rather than relative to the player SWF (see below). This will likely cause issues for publishers using the JW Embedder with relative file paths. |
|---|
| 88 | |
|---|
| 89 | .. note:: |
|---|
| 90 | |
|---|
| 91 | This does not affect any other URLs (such as skins, playlists, or plugins), but relative URLs contained within a playlist will be calculated relative to this path. |
|---|
| 92 | |
|---|
| 93 | .. note:: |
|---|
| 94 | |
|---|
| 95 | The netstreambasepath configuration option exists as a workaround for a technical limitation in Flash. All video in Flash must be loaded using Adobe's NetStream class. For historical reason, relative file paths passed into the NetStream are always resolved relative to the SWF making the request. |
|---|
| 96 | |
|---|
| 97 | The JW Player uses the NetStream class to load media for the **video** and **http** media providers. With the introduction of the HTML5 player, it became impossible to consistently reference a video file via a relative path, as in Flash mode would load it relative to the player SWF, while in HTML5 mode it would load relative to the current page. The netstreambasepath is a workaround that allow for a consistent referencing by specifing the original path from which relative URLs should be resolved. |
|---|
| 98 | |
|---|
| 99 | .. _options-layout: |
|---|
| 100 | |
|---|
| 101 | Layout |
|---|
| 102 | ------ |
|---|
| 103 | |
|---|
| 104 | These flashvars control the look and layout of the player. |
|---|
| 105 | |
|---|
| 106 | .. describe:: controlbar ( bottom ) |
|---|
| 107 | |
|---|
| 108 | Position of the controlbar. Can be set to *bottom*, *top*, *over* and *none*. |
|---|
| 109 | |
|---|
| 110 | .. describe:: controlbar.idlehide ( false ) |
|---|
| 111 | |
|---|
| 112 | If **controlbar.position** is set to *over*, this option determines whether the controlbar stays hidden when the player is paused or stopped. |
|---|
| 113 | |
|---|
| 114 | .. describe:: dock ( true ) |
|---|
| 115 | |
|---|
| 116 | set this to **false** to show plugin buttons in controlbar. By default (*true*), plugin buttons are shown in the display. |
|---|
| 117 | |
|---|
| 118 | .. describe:: icons ( true ) |
|---|
| 119 | |
|---|
| 120 | set this to false to hide the play button and buffering icons in the display. |
|---|
| 121 | |
|---|
| 122 | .. describe:: playlist ( none ) |
|---|
| 123 | |
|---|
| 124 | Position of the playlist. Can be set to *bottom*, *top*, *right*, *left*, *over* or *none*. |
|---|
| 125 | |
|---|
| 126 | .. describe:: playlistsize ( 180 ) |
|---|
| 127 | |
|---|
| 128 | 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. |
|---|
| 129 | |
|---|
| 130 | .. describe:: skin ( undefined ) |
|---|
| 131 | |
|---|
| 132 | Location of a **skin** file, containing graphics which change the look of the player. There are two types of skins available: |
|---|
| 133 | |
|---|
| 134 | * **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. |
|---|
| 135 | * **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. |
|---|
| 136 | |
|---|
| 137 | Our `AddOns repository <http://www.longtailvideo.com/addons>`_ contains a list of available skins. |
|---|
| 138 | |
|---|
| 139 | |
|---|
| 140 | |
|---|
| 141 | .. _options-behavior: |
|---|
| 142 | |
|---|
| 143 | Behavior |
|---|
| 144 | --------- |
|---|
| 145 | |
|---|
| 146 | These flashvars control the playback behavior of the player. |
|---|
| 147 | |
|---|
| 148 | .. describe:: autostart ( false ) |
|---|
| 149 | |
|---|
| 150 | Set this to *true* to automatically start the player on load. |
|---|
| 151 | |
|---|
| 152 | .. describe:: bufferlength ( 1 ) |
|---|
| 153 | |
|---|
| 154 | 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). |
|---|
| 155 | |
|---|
| 156 | .. describe:: id ( undefined ) |
|---|
| 157 | |
|---|
| 158 | 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. |
|---|
| 159 | |
|---|
| 160 | 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. |
|---|
| 161 | |
|---|
| 162 | .. describe:: item ( 0 ) |
|---|
| 163 | |
|---|
| 164 | :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. |
|---|
| 165 | |
|---|
| 166 | .. describe:: mute ( false ) |
|---|
| 167 | |
|---|
| 168 | Mute the sounds on startup. Is saved in a cookie. |
|---|
| 169 | |
|---|
| 170 | .. describe:: playerready ( undefined ) |
|---|
| 171 | |
|---|
| 172 | 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()*). |
|---|
| 173 | |
|---|
| 174 | .. describe:: plugins ( undefined ) |
|---|
| 175 | |
|---|
| 176 | 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. |
|---|
| 177 | |
|---|
| 178 | .. describe:: repeat ( none ) |
|---|
| 179 | |
|---|
| 180 | What to do when the mediafile has ended. Has several options: |
|---|
| 181 | |
|---|
| 182 | * **none**: do nothing (stop playback) whever a file is completed. |
|---|
| 183 | * **list**: play each file in the playlist once, stop at the end. |
|---|
| 184 | * **always**: continously play the file (or all files in the playlist). |
|---|
| 185 | * **single**: continously repeat the current file in the playlist. |
|---|
| 186 | |
|---|
| 187 | .. describe:: shuffle ( false ) |
|---|
| 188 | |
|---|
| 189 | Shuffle playback of playlist items. The player will randomly pick the items. |
|---|
| 190 | |
|---|
| 191 | .. describe:: smoothing ( true ) |
|---|
| 192 | |
|---|
| 193 | 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. |
|---|
| 194 | |
|---|
| 195 | .. describe:: stretching ( uniform ) |
|---|
| 196 | |
|---|
| 197 | Defines how to resize the poster image and video to fit the display. Can be: |
|---|
| 198 | |
|---|
| 199 | * **none**: keep the original dimensions. |
|---|
| 200 | * **exactfit**: disproportionally stretch the video/image to exactly fit the display. |
|---|
| 201 | * **uniform**: stretch the image/video while maintaining its aspect ratio. Borders will appear around the image/video. |
|---|
| 202 | * **fill**: stretch the image/video while maintaining its aspect ratio, completely filling the display. This results in cropping the media. |
|---|
| 203 | |
|---|
| 204 | .. describe:: volume ( 90 ) |
|---|
| 205 | |
|---|
| 206 | Startup audio volume of the player. Can be 0 to 100. |
|---|
| 207 | |
|---|
| 208 | |
|---|
| 209 | |
|---|
| 210 | .. _options-logo: |
|---|
| 211 | |
|---|
| 212 | Logo |
|---|
| 213 | ---- |
|---|
| 214 | |
|---|
| 215 | Unlicensed 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: |
|---|
| 216 | |
|---|
| 217 | .. describe:: logo.file ( undefined ) |
|---|
| 218 | |
|---|
| 219 | Location of an external JPG, PNG or GIF image to be used as watermark. PNG images with transparency give the best results. |
|---|
| 220 | |
|---|
| 221 | .. describe:: logo.link ( undefined ) |
|---|
| 222 | |
|---|
| 223 | HTTP link to jump to when the watermark image is clicked. If it is not set, a click on the watermark does nothing. |
|---|
| 224 | |
|---|
| 225 | .. describe:: logo.linktarget ( _blank ) |
|---|
| 226 | |
|---|
| 227 | Link target for logo click. Can be *_self*, *_blank*, *_parent*, *_top* or a named frame. |
|---|
| 228 | |
|---|
| 229 | .. describe:: logo.hide ( true ) |
|---|
| 230 | |
|---|
| 231 | 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. |
|---|
| 232 | |
|---|
| 233 | .. describe:: logo.position ( bottom-left ) |
|---|
| 234 | |
|---|
| 235 | This sets the corner in which to display the watermark. It can be one of the following: |
|---|
| 236 | |
|---|
| 237 | * **bottom-left** |
|---|
| 238 | * **bottom-right** |
|---|
| 239 | * **top-left** |
|---|
| 240 | * **top-right** |
|---|
| 241 | |
|---|
| 242 | .. describe:: logo.timeout ( 3 ) |
|---|
| 243 | |
|---|
| 244 | When logo.hide is set to *true*, this option sets the number of seconds the logo is visible after it appears. |
|---|
| 245 | |
|---|
| 246 | .. note:: |
|---|
| 247 | |
|---|
| 248 | Once again: the logo options can only be used for licensed players! |
|---|
| 249 | |
|---|
| 250 | |
|---|
| 251 | |
|---|
| 252 | .. _options-colors: |
|---|
| 253 | |
|---|
| 254 | Colors |
|---|
| 255 | ------ |
|---|
| 256 | |
|---|
| 257 | These 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. |
|---|
| 258 | |
|---|
| 259 | .. describe:: backcolor ( ffffff ) |
|---|
| 260 | |
|---|
| 261 | background color of the controlbar and playlist. This is white by default. |
|---|
| 262 | |
|---|
| 263 | .. describe:: frontcolor ( 000000 ) |
|---|
| 264 | |
|---|
| 265 | color of all icons and texts in the controlbar and playlist. Is black by default. |
|---|
| 266 | |
|---|
| 267 | .. describe:: lightcolor ( 000000 ) |
|---|
| 268 | |
|---|
| 269 | Color of an icon or text when you rollover it with the mouse. Is black by default. |
|---|
| 270 | |
|---|
| 271 | .. describe:: screencolor ( 000000 ) |
|---|
| 272 | |
|---|
| 273 | Background color of the display. Is black by default. |
|---|
| 274 | |
|---|
| 275 | |
|---|
| 276 | The 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). |
|---|
| 277 | |
|---|
| 278 | |
|---|
| 279 | .. _options-config: |
|---|
| 280 | |
|---|
| 281 | Config XML |
|---|
| 282 | ---------- |
|---|
| 283 | |
|---|
| 284 | All options can be listed in an XML file and then fed to the player with a single option: |
|---|
| 285 | |
|---|
| 286 | .. describe:: config ( undefined ) |
|---|
| 287 | |
|---|
| 288 | location of a XML file with flashvars. Useful if you want to keep the actual embed codes short. Here's an example: |
|---|
| 289 | |
|---|
| 290 | Here is an example of such an XML file: |
|---|
| 291 | |
|---|
| 292 | .. code-block:: xml |
|---|
| 293 | |
|---|
| 294 | <config> |
|---|
| 295 | <image>files/bunny.jpg</image> |
|---|
| 296 | <repeat>true</repeat> |
|---|
| 297 | <volume>40</volume> |
|---|
| 298 | <playlist>right</playlist> |
|---|
| 299 | <playlist.size>150</playlist.size> |
|---|
| 300 | <controlbar>over</controlbar> |
|---|
| 301 | </config> |
|---|
| 302 | |
|---|
| 303 | Options set in the embed code will overwrite those set in the config XML. |
|---|
| 304 | |
|---|
| 305 | .. note:: |
|---|
| 306 | |
|---|
| 307 | 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. |
|---|