JW Player for Flash
JW Player: Flashvars
Here's a list of all flashvars the player accepts. Flashvars are variables entered in the embed HTML code to set how the player looks and functions. The setting of all these flashvars can be accessed through javascript and by plugins. For more info, see the API page.
Some of these flashvars represent a certain status: they are read-only and automatically updated by the player. Useful to request through the API.
Note that you must urlencode the three glyphs ? = & inside flashvars, because of the way these flashvars are loaded into the player. The urlencoded values for these symbols are listed here:
- ? → %3F
- = → %3D
- & → %26
So if, fore example, your file flashvar is at the location getplaylist.php?id=123&type=flv, you must set the file flashvar to getplaylist.php%3Fid%3D123%26type%3Dflv.
File properties
These flashvars set different properties of the mediafile to load (e.g. the source file, preview image or title). Next to loading as flashvars, these items can also be assigned to every entry in an XML playlist.
- author (undefined): author of the video, shown in the display or playlist.
- date (undefined): publish date of the media file. Available since 4.3.
- description (undefined): text description of the file.
- duration (0): duration of the file in seconds.
- file (undefined): location of the mediafile or playlist to play.
- image (undefined): location of a preview image; shown in display and playlist.
- link (undefined): url to an external page the display, controlbar and playlist can link to.
- start (0): position in seconds where playback has to start. Won't work for regular (progressive) videos, but only for streaming (HTTP / RTMP).
- streamer (undefined): location of an rtmp/http server instance to use for streaming. Can be an RTMP application or external PHP/ASP file. More info here.
- tags (undefined): keywords associated with the media file. Available since 4.3.
- title (undefined): title of the video, shown in the display or playlist.
- type (undefined): this is determines what type of mediafile this item is, and thus which model the player should use for playback. By default, the type is detected by the player based upon the file extension. If there's no suiteable extension or if you use a streaming server, it can be manually set. The following media types are supported:
- video: progressively downloaded FLV / MP4 video, but also AAC audio.
- sound: progressively downloaded MP3 files.
- image: JPG/GIF/PNG images.
- youtube: videos from Youtube.
- http: FLV/MP4 videos played as http speudo-streaming.
- rtmp: FLV/MP4/MP3 files played from an RTMP server.
Layout
These flashvars control the looks and layout of the player.
- controlbar (bottom): position of the controlbar. Can be set to bottom, over and none.
- height (400): height of the display in pixels.
- icons (true): set this to false to hide the play button and buffering icon in the middle of the video. Available since 4.2.
- logo (undefined): location of an external jpg, png or gif image to show in a corner of the display. With the default skin, this is top-right, but every skin can freely place the logo.
- playlist (none): position of the playlist. Can be set to bottom, over, right or none.
- playlistsize (180): when below this refers to the height, when right this refers to the width of the playlist.
- skin (undefined): location of a SWF file with the player graphics. The player skinning documentation gives more info on this. SVN contains a couple of example skins.
- width (280): width of the display in pixels.
- backcolor (undefined): background color of the controlbar and playlist. This is white with the default skin.
- frontcolor (undefined): color of all icons and texts in the controlbar and playlist.
- lightcolor (undefined): color of an icon or text when you rollover it with the mouse.
- screencolor (undefined): background color of the display.
The four color flashvars need so-called hexadecimal values, as is common for web colors (e.g. FFCC00 for bright yellow).
Behaviour
These flashvars control the playback behaviour of the player.
- autostart (false): automatically start the player on load.
- bandwidth (5000): available bandwidth for streaming the file. Used predominantly for bitrate switching. Set this flashvar if you want to hint the player on the initial bandwidth.Overwritten every 2 seconds whenever a video or http stream is loading or an rtmp stream is playing. Available since 4.6.
- bufferlength (1): number of seconds of the file that has to be loaded before starting. Set this to a low value to enable instant-start and to a high value to get less mid-stream buffering.
- displayclick (play): what to do when one clicks the display. Can be play, link, fullscreen, none, mute, next. When set to none, the handcursor is also not shown.
- dock (false): set this to true to show the dock with large buttons in the top right of the player. Available since 4.5.
- fullscreen (false): fullscreen state of the player. This is a read-only flashvar, useful for plugins. Available since 4.4.
- item (0): playlistitem that should start to play. Use this to set a specific start-item.
- level (0): currently playing bitrate level. Read-only. Used bitrate switching. Available since 4.6.
- linktarget (_blank): browserframe where link from the display are opened in. Some possibilities are '_self' (same frame) or '_blank' (new browserwindow).
- mute (false): mute all sounds on startup. Is saved in a cookie.
- repeat (none): set to list to play the entire playlist once, to always to continously play the song/video/playlist and to single to continue repeating the selected file in a playlist.
- shuffle (false): shuffle playback of playlist items.
- smoothing (true): this sets the smoothing of videos, so you won't see blocks when a video is upscaled. Set this to false to get performance improvements with old computers / big files. Available since 4.4.
- state (IDLE): current playback state of the player. Can be IDLE (no file loaded), BUFFERING (loading a file), PLAYING (playing a file), PAUSED (pausing playback; loading continues), COMPLETED (same as IDLE, but the file is player and loaded completely).
- stretching (uniform): defines how to resize images in the display. Can be none (no stretching), exactfit (disproportionate), uniform (stretch with black borders) or fill (uniform, but completely fill the display).
- volume (90): startup volume of the player. Can be 0 to 100. Is saved in a cookie.
API
These flashvars relate to the API of the player:
- client (Flash MAC X,0,XXX,0): Version and platform of the Flash client plugin. Useful to check for e.g. MP4 playback or fullscreen capabilities.
- debug (undefined): set this to either arthropod, console or trace to let the player log events. Available since 4.5. Also saved as cookie since 4.6. More info in the plugins documentation.
- id (ply): ID of the player within the javascript DOM. Useful for javascript interaction. This is automatically set for Windows / MAC, but under Linux you'll have to set the flashvar.
- plugins (undefined): a powerful new feature, this is a comma-separated list of swf plugins to load (e.g. yousearch,viral). Each plugin has a unique ID and resides at plugins.longtailvideo.com. Go to the LongTailVideo AddOns section to see all available plugins.
- version (4.x.rrr): exact major release, minor release and revision number of the player. sent to javascript with every call. The revision number is always upped no matter the release, so 4.2.51 is the revision right after 4.1.50.
The client, id and version are sent as parameters with every event the player broadcasts.
Config XML
All flashvars can also be listed in an XML file and then fed to the player with a single flashvar:
- config (undefined): location of a XML file with flashvars. Useful for short embed codes or CDN stream redirecting. Here's an example:
<config> <image>files/bunny.jpg</image> <repeat>true</repeat> <backcolor>333333</backcolor> <volume>40</volume> <controlbar>over</controlbar> </config>
Flashvars set in the embed code will overwrite those in the config XML again.
