Supported Flashvars


invisible | 02.01.2008 | print

Flashvars are variables you can insert into your HTML code to control both behavior and appearance of the FLV Media Player and Image Rotator. With the swfobject embed method, you add them with the addVariable() function and with the embed tag method they are inside the flashvars attribute, stacked with an & symbol. Use the setup wizard to easily set these flashvars and copy-paste the embed codes.

The basics

  1. height (number): Sets the overall height of the player/rotator.
  2. width (number): Sets the overall width of the player/rotator.
  3. file (url): Sets the location of the file to play. The player can play a single MP3, FLV, SWF, JPG, GIF, PNG, H264 file or a playlist. The rotator only plays playlists.
  4. image (url): If you play a sound or movie, set this to the url of a preview image. When using a playlist, you can set an image for every entry.
  5. id (url): Use this to set the RTMP stream identifier (example). The ID will also be sent to statistics callbacks. If you play a playlist, you can set an id for every entry.

The colors

  1. backcolor (0xHXHXHX): Backgroundcolor of the controls, in HEX format.
  2. frontcolor (0xHXHXHX): Texts & buttons color of the controls, in HEX format.
  3. lightcolor (0xHXHXHX): Rollover color of the controls, in HEX format.
  4. screencolor (0xHXHXHX): Color of the display area, in HEX format. With the rotator, change this to your HTML page's color make images of different sizes blend nicely.

The setup wizard contains a picker for the colors, so you can select the colors you like if you don't know the HEX values.

Display appearance

  1. overstretch (false,true,fit,none): Sets how to stretch images/movies to make them fit the display. Set this to true to stretch them proportionally to fill the display, fit to stretch them disproportionally and none to keep original dimensions.
  2. showicons (true,false): Set this to false to hide the activity icon and play button in the middle of the display.
  3. transition (fade, bgfade, blocks, bubbles, circles, flash, fluids, lines, random, slowfade): Only for the rotator. Sets the transition to use between images. random will show all transitions randomly.

Controlbar appearance

  1. shownavigation (true,false): Only for the rotator. Set this to true to enable the navigation bar (example).
  2. showstop (false,true): Only for the player. Set this to true to show a stop button in the controlbar.
  3. showdigits (true,false): Only for the player. Set this to false to hide the elapsed/remaining digits in the controlbar.
  4. showdownload (false,true): Only for the player. Set this to true to show a download button in the player controlbar, which links to the link flashvar.
  5. usefullscreen (true,false): Only for the player. Set this to false to hide the fullscreen button.

Playlist appearance (only for the player)

  1. autoscroll (true,false): Set this to true to automatically scroll through the playlist on rollover, instead of using a scrollbar.
  2. displayheight (number): Set this smaller as the height to show a playlist below the display (example). If you set it the same as the height, the controlbar will auto-hide on top of the video (example).
  3. displaywidth (number): Set this smaller as the width to show a playlist to the right of the display (example).
  4. thumbsinplaylist (true,false): If you have preview images in your playlist, set this to true to show them.

Playback behaviour

  1. audio (url): Assigns an additional, synchronized MP3. Use this for a closed audio description or director's comments with the player or background music with the rotator. When using the player and a playlist, you can assign audio to every entry.
  2. autostart (true,false): Set this to true in the player to automatically start playing when the page loads, or set this to false with the rotator to prevent the automatic rotation.
  3. bufferlength (number): Sets the number of seconds an FLV should be buffered before the player starts playback. Default is 3 seconds. Set this small for fast connections or short videos and big for slow connections.
  4. captions (url): Only for the player. Assigns closed captions. Captions should be in TimedText format (example). When using a playlist, you can assign captions for every entry.
  5. repeat (true,false,list): Set this to true to automatically repeat playback of the file or playlist. Set this to list to playback all items in a playlist once.
  6. rotatetime (number): Sets the number of seconds an image is played back. The default is 10 for the mediaplayer and 5 for the rotator.
  7. shuffle (true,false): Set this to false to playback the playlist sequentially instead of shuffled.
  8. volume (number): sets the startup volume for playback of sounds/movies in the player and the audiotrack in the rotator.

Here's also a tutorial and example setup for accessible video playback.

External communication

  1. callback (url): Set this to a serverside script that can process statistics. The player will send it a POST every time an item starts/stops. Set this to analytics to send the callbacks automatically to Google Analytics.
  2. enablejs (true,false): Set this to true to enable javascript interaction. This'll only work online! Javascript interaction includes playback control, asynchroneous loading of media files and return of track information. More info at this demo page.
  3. javascriptid (string): If you interact with multiple players/rotators in javascript, use flashvar to give each of them a unique ID. More info at this demo page.
  4. linkfromdisplay (true,false): Set this to true to make a click on the display result in a jump to the webpage assigned to the link flashvar.
  5. linktarget (frame): Set this to the frame you want hyperlinks to open in. The default is _self. Set it to _blank to open links in a new window, _self to open links in the same frame and _top to open in the top frame.
  6. recommendations (url): Set this to an XML with items you want to recommend. The thumbs will show up when the current movie stops playing, just like YouTube. Here's an example setup and example XML.
  7. streamscript (url): Set this to the URL of a script to use for http streaming FLV or MP4 files. The parameters file and pos are sent to the script. Here's more info and an example script. If you use LigHTTPD streaming, set this to lighttpd (Lighttpd MP4 example).
  8. type (mp3,flv,rtmp,jpg,png,gif,swf): The player determines the type of file to play based upon the last three characters of the file flashvar. This doesn't work with database id's or mod_rewrite, so you can set this flashvar to the correct filetype. By default, the player assumes a playlist is loaded.

Using the & = ? symbols

Note that you must urlencode the three glyphs ? = & inside flashvars, because of the way these flashvars are presented to the player. The urlencoded values for these symbols are listed here:

  1. ? → %3F
  2. = → %3D
  3. & → %26

So if your file to play is at the location getplaylist.php?id=123&type;=flv, you must set the file flashvar to getplaylist.php%3Fid%3D123%26type%3Dflv.

Flashvars in external config.xml

If you have lots of flashvars and you don't want the list to mess up your HTML pages, you can also aggregate your flashvars in a single XML file like this one. Next, use the config flashvar to assign the XML to your player. All vars inside the XML will then be parsed with one line of code. Any additional flashvars you do set in your HTML will override the ones that are in the config XML.