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.
- height (number): Sets the overall height of the player/rotator.
- width (number): Sets the overall width of the player/rotator.
- 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.
- 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.
- 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.
- backcolor (0xHXHXHX): Backgroundcolor of the controls, in HEX format.
- frontcolor (0xHXHXHX): Texts & buttons color of the controls, in HEX format.
- lightcolor (0xHXHXHX): Rollover color of the controls, in HEX format.
- 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.
- logo (url): Set this to an image that can be put as a watermark logo in the top right corner of the display. Transparent PNG files give the best results (example).
- 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.
- showicons (true,false): Set this to false to hide the activity icon and play button in the middle of the display.
- 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.
- shownavigation (true,false): Only for the rotator. Set this to true to enable the navigation bar (example).
- showstop (false,true): Only for the player. Set this to true to show a stop button in the controlbar.
- showdigits (true,false): Only for the player. Set this to false to hide the elapsed/remaining digits in the controlbar.
- 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.
- usefullscreen (true,false): Only for the player. Set this to false to hide the fullscreen button.
Playlist appearance (only for the player)
- autoscroll (true,false): Set this to true to automatically scroll through the playlist on rollover, instead of using a scrollbar.
- 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).
- displaywidth (number): Set this smaller as the width to show a playlist to the right of the display (example).
- thumbsinplaylist (true,false): If you have preview images in your playlist, set this to true to show them.
- 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.
- 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.
- 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.
- 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.
- 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.
- rotatetime (number): Sets the number of seconds an image is played back. The default is 10 for the mediaplayer and 5 for the rotator.
- shuffle (true,false): Set this to false to playback the playlist sequentially instead of shuffled.
- 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.
- 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.
- link (url): Set this to an external URL or downloadeable version of the file. This link is assigned to the display, logo and download button. With playlists, set links for every entry in the XML.
- 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.
- 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.
- 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.
- 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).
- 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:
- ? → %3F
- = → %3D
- & → %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.