:: Support :: Additional HD Video Player Examples: Dynamic Media Loading with FlashVars

This example utilizes a StreamingPlayer component (480x270 pixels) and the optional Controller component with play, pause, next, previous, progress controls, volume controls, and controller text enabled (Titanium Skin). The XML location is set using FlashVars in the embed scripts and the available playback parameters have been set within the XML.

Enable FlashVars in your existing HD Video Player FLA (Flash 8/CS3/CS4 required):

  1. Open your player FLA and select the StreamingPlayer on the stage then open the Component Inspector and make sure the "Single Video Location" and "XML Location" parameters are blank.
  2. Add/enable the following script in the Actions Panel of your FLA (scene 1: frame 1) - NOTE: in most of the FLA files that we distribute the following codes are in place, so you simply need to enable the scripts by removing the double slashes (//) in front of each line of script; and you can alter the scripts to accomodate more dynamic approaches (e.g. change the ".xml" to ".asp" or ".php" to load dynamically-generated XML files):

    var videos:String;
    var fms:String;
    var app:String;
    if (videos.indexOf(".xml") !== -1){
    } else if (videos.indexOf(".") !== -1 && videos.indexOf("mp4:") == -1){
    else if (fms !== undefined && app !== undefined){

  3. You can now save your project and publish a new network-ready SWF (i.e. set the Local Playback Security to "Access Network Only" in the Publish Settings menu). NOTE: when you use FlashVars to load your content the player will not work on your desktop.
  4. To add the player to your webpage you must add the following scripts to your web document wherever you want the player to appear. Please note that the SWF path, Flash player size (width and height; should be equal to SWF dimensions), and media path (FlashVars; red text) are specified in two places. You can alter these variables to meet your needs, and you can specify a different media path for each instance of the HD Video Player on your site:

    <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0"
    width="490" height="310" >
    <param name="movie" value="flashvars.swf" />
    <param name="FlashVars" value="videos=videos.xml" />
    <embed src="flashvars.swf" width="490" height="310" FlashVars="videos=videos.xml"
    type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />

    - Use "videos=myvideo.flv" to load a single progressive video
    - Use "videos=videos.xml" to load a XML playlist (streaming and/or progressive)
    - Use "videos=myvideo&fms=www.streamingserver.com&app=myapplication" to load a single streaming video

  5. Please Note: When loading a single video file it must include accurate duration metadata. When loading a streaming FLV video you should leave off the ".flv" extension. If you want to stream your H264 and HE-AAC files you must make sure your server is Flash Media Server 3 (or FMIS 3), and you specify the name of the H264 and HE-AAC file as "mp4:videofile.m4a", "mp4:videofile.mp4" or "mp4:videofile.mov" (i.e. you must include the "mp4:" prefix and the filename extension f4v, mp4, m4a, mov, mp4v, 3gp, or 3g2). Click here to learn more about H264 and HE-AAC.

To use the example player above without the DEMO text (purchase required):

  1. Install your purchased copy of the MXP in your Flash 8/CS3/CS4 authoring software by double-clicking the file named "ESA_HD_Video.mxp". This will open the Extension Manager, which will prompt you to complete your installation. NOTE: Before installing the MXP file you will have to unpack your downloaded ZIP file and shut down your authoring software if it is open.
  2. Download the example files using the link below, and unpack the ZIP file.
  3. Open the file named "flashvars.fla" in your copy of Flash 8/CS3/CS4.
  4. Open the Components menu and look for a folder named "ESA HD Video Player". In this folder, there will be three components named StreamingPlayer, Playlist, and Controller.
  5. Add an instance of the StreamingPlayer to the stage by double-clicking it in the menu.
  6. Flash will open a "Resolve Library Conflict" window, and ask if you want to replace the existing item in the library - toggle the "Replace existing items" button and click "OK".
  7. You should now see 2 StreamingPlayer components on the stage; one in the same position as the original, and a new component near the middle of your screen.
  8. Select the new StreamingPlayer component near the middle of your screen and delete it.
  9. The remaining StreamingPlayer component on the stage is the updated component with your previous settings (without the DEMO text).
  10. You can now modify the component parameters, save your project, and publish a new SWF.

:: Download Example Files


Support - Documentation - Skin Wizard - Sample Skins - Tutorials
Copyright © 2003-2012 Earth Science Agency, LLC - All Rights Reserved