In version 2.1 of the Flash Video plugin, the entire capability of Jeroen Wijering’s FLV Player is made available. The following list details each of the variables available for customization. Keep in mind also, that default values set in the plugin options panel can always be overridden inline in a post.
- height (number): This variable defines the height of the player in pixels (does not include control bar).
- width (number): This variable defines the width of the player in pixels.
- filename (url): The location of the file to play. It can be a single file (MP3/FLV/RTMP/JPG/SWF/PNG/GIF) or a playlist for the player. The path should be relative to the WordPress install directory.
- image (url): This variable will allow you to show a poster frame of your movie. It can be a JPG/SWF/PNG or GIF file. You can also assign an image for every item in a playlist. The path should be relative to the WordPress install directory.
- search bar (true, false): Set this to false to hide the searchbar below the display. You can set the search destination with the searchlink flashvar.
- backcolor (hex color): Background color of the player. The default is 0xFFFFFF (white).
- frontcolor (hex color): Texts / buttons color of the player. The default is 0×000000 (black).
- lightcolor (hex color): Rollover/ active color of the player. The default is 0×000000 (black).
- screencolor (hex color): Color of the display background screen. The default is 0×000000 (black).
- logo (url): Set this variable to put a watermark logo in the top right corner of the display. All image formats are supported, but transparent PNG files give the best results. The path should be relative to the WordPress install directory.
- overstretch (true,false,fit,none): Defines how to stretch images/movies to make them fit the display. “true” will stretch them proportionally to fill the display, “false” will stretch them to fit. “fit” will stretch them disproportionally to fit both height and width. “none” will show all items in their original dimensions. Defaults to “fit”.
- showeq (true,false): Set to true to show a fake equalizer in the display. It adds a nice graphical touch when you are playing MP3 files.
- showicons (true,false): Show or hide the play and activity icons in the middle of the display. Defaults to true. If set to false, the overlaid control bar will also hide.
- shownavigation (true,false): Set this to false to completely hide the controlbar.
- showstop (true,false): Set this to true to show a stop button in the controlbar.
- showdigits (true,false,total): Set this to false if you don’t want the elapsed/remaining time to display in the control bar of the players. Set it to “total” to show the total time instead of the remaining time.
- showdownload (true,false): Set this to true to show a download button in the control bar. The download button links to the link variable (explained below under the “Interaction” section).
- usefullscreen (true,false): Set this to false to hide the fullscreen button and disable fullscreen.
- autoscroll (true,false): By default, the playlist area of the players will have a scrollbar if the number of items is too long. If you set this variable to “true”, the scrollbar will disappear and the playlist will scroll automatically, depending upon the mouse position.
- displayheight (number): This variable is used by the players and sets the height of the display. It defaults to the height of the SWF object minus the controlbar (20px), but if you set it to a smaller height, the playlist will show up. If you set it to the height of the player itself (or larger), the controlbar will auto-hide over the video.
- displaywidth (number of pixels): Instead of the “displayheight”, you can set “displaywidth” to a size smaller that the SWF width to make the playlist appear at the right side of the display.
- thumbsinplaylist (true,false): If you have a playlist that also includes preview images with the <image> element, you can set this variable to “true” to show them in the playlist.
- audio (url): Assigns an additional, synchronized MP3. Use this for a closed audio description or director’s comments.
- autostart (true,false,muted): Set this to “true” to make the player automatically start playing when the page loads. If set to “muted”, the player will autostart with the volume set to 0 and an unmute icon in the display.
- bufferlength (number): This sets the number of seconds an FLV should be buffered ahead before the player starts it. Set this smaller for fast connections or short videos. Set this bigger for slow connections. The default is 3 seconds.
- captions (url): Assigns closed captions. Captions should be in TimedText format (example).
fallback (url): If you play an MP4 file, set here the location of an FLV fallback. It’ll automatically be picked by older flash players.
- repeat (true,false,list): By default, the players will stop playback after every item to preserve bandwidth (repeat=false). You can set this to “list” to playback all items in a playlist once, or to “true” to continously playback your song/movie/playlist.
- rotatetime (number): Use this variable to set the number of seconds you want an image to display. The default is “5″.
- shuffle (true,false): If you use a playlist, this setting will automatically shuffle the entries. Set this to “false” to play all items sequentially.
- smoothing (true,false): If set to “false”, video will not smooth, resulting in a more pixelated, but better performing display. Use this for large screen / slow computer combinations.
- volume (number): The default volume for playback of sounds/movies is 80, but you can set another startup value with this variable.
- callback (url): Set this variable to the location of a serverside script (PHP/ASP) that can process callbacks. The players will send a callback every time an item starts/stops, so you can save statistics with the server-side script. More info can be found in this demonstration page. An example callback script is placed in the “extras” folder of the downloads. Set this to “analytics” to send the callbacks automatically to Google Analytics.
- link (url): Set url to an external URL, downloadable version of the file, or force-download script you can use for downloading the file. You can assign link-clicks to the display (see below), the downloadbutton and every item in a playlist.
- linkfromdisplay (true,false): You can set this variable to “true” to make a click on the image/video display to result in a jump to the “link” webpage. By default, a click on the display will play/pause the movie.
- linktarget (frame): The targetframe a link (from the display or playlist buttons) will open into. The default is “_self”. Set it to “_blank” to open links in a new window.
- 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.
- searchlink (url): Sets the destination of the searchbar. The default is the LongTail search page (which you can brand with your logo, colors and XML), but you can set other destinations (e.g. http://yoube.com/results?search_query=). Use the searchbar option to hide the bar altogether.
- streamscript (url): Set this to the URL of a script to use for http streaming movies. 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.
- type (mp3,flv,rtmp,jpg,png,gif,swf,rbs,3gp,mp4,m4v): The player determines the type of file to play based upon the last three characters of the “file” variable. This method doesn’t work if you use database id’s or mod_rewrite to retrieve the files. Therefore you can set this variable to tell the players of which filetype the file you want to play is. The type is also assigned to every item in a playlist. If no match is found, the player assumes a playlist is loaded.
Using Special Characters (& = ?)
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.
Enable Google Analytics tracking on videos:
- Make sure you website is currently being tracked by Google. If you need to sign up, visit this webpage: Google Analytics. It’s free for private use. Once you’ve signed up and configured your website appropriate (and see your traffic data), you’re ready to track videos!
- In the global plugin options page, set the Callback URL (under Interaction) to analytics.
That’s it! You should start seeing the stream_start and stream_end events in a day or two. Keep in mind, you will likely have to search for them, as video plays generate lower traffic than page views. The URL format will be (assuming the flv file is called 300.flv): stream_start/300.flv and stream_end/300.flv