header_graphic
header_gradient
 
:: Support :: Additional HD Video Player Examples: Bandwidth Profiling for Prerolls and Streams

This example shows how to use the Bandwidth Profiling feature to deliver appropriate video content to each of your users (XML required). This example utilizes a StreamingPlayer component (480x270 pixels) and the optional Controller component with play, pause, progress/scrubber controls, volume controls, and controller text enabled (Widescreen Titanium skin). The XML location is set using FlashVars in the embed scripts and the available playback parameters have been set within the XML. Notice that the scrubber/progress controls are disabled while the preroll advertisement is playing (disabled using settings in the Component Inspector).

This example assumes that you are using FlashVars in your embed scripts to load your media items. Use the Dynamically Load Single Videos and XML Playlists using FlashVars example to learn how to enable FlashVars support in your player (if you're using the default Titanium skin or the player above, FlashVars should already be enabled).

To enable the Bandwidth Profiling feature in your existing HD Video Player SWF (XML required):

  1. Set the "bandwidthCheck" parameter to "true" in the XML and provide a valid path to a JPG image on YOUR server in the "bandwidthImage" parameter (NOTE: these parameters can also be set in the Component Inspector; remember that settings in the XML override those in the Component Inspector). The bandwidth image should be at least 100 kb in size - the bigger the image the more robust the sampling, and if you make the image too small you may not get a result and the player will freeze.
  2. Add the <kbps> node to your XML, which is an array that defines the speed thresholds that allow the player to select different videos based on the users bandwidth (Link to XML example). The array separator is an asterisk (*), and the first number in the array should always be "100". You can use as many speed options as you want, but you must provide the same number of <kbps>, <streams>, and <prerolls> options; for example, if you have 3 <kbps> options, you should have 3 <streams> options, and if you're using a preroll you should have 3 <prerolls> options.

    <kbps>100*400*700</kbps>

    In the example <kbps> array above, users with bandwidth < 400 kbps will watch the first video option in the <streams> and <prerolls> arrays, users with bandwidth 400-700 kbps will watch the second video option, and users with bandwidth >700 kbps will watch the third video option.
  3. Add multiple <streams> options to your XML forming an array using an asterisk (*) as the separator (Link to XML example). You should provide the same number of <kbps> and <streams> options, and you will have to encode different versions of each video, because it is not possible to stream a video file at a data rate other than the bit rate at which it is encoded (i.e. if you want to provide 3 options, you will have to encode 3 different versions of the video at bit rates that are similar to the kbps array):

    // For progressive FLV, H264, or AAC files
    <streams>lo_res.flv*med_res.flv*hi_res.flv</streams>

    // For streaming FLV files
    <streams>lo_res*med_res*hi_res</streams>

    // For streaming H264 and AAC files
    <streams>mp4:lo_res.mov*mp4:med_res.mov*mp4:hi_res.mov</streams>


  4. If you want to display a preroll video before the primary stream, add multiple <prerolls> options to your XML forming an array using an asterisk (*) as the separator (Link to XML example). You should provide the same number of <kbps> and <prerolls> options, and you will have to encode different versions of each video, because it is not possible to stream a video file at a data rate other than the bit rate at which it is encoded (i.e. if you want to provide 3 options, you will have to encode 3 different versions of the video at bit rates that are similar to the kbps array - or if you don't want to encode multiple versions of your prerolls, you can simply refer to the same preroll video multiple times to form the array as we have done in the example XML):

    // For progressive FLV, H264, or AAC files
    <prerolls>lo_res.flv*med_res.flv*hi_res.flv</prerolls>

    // For streaming FLV files
    <prerolls>lo_res*med_res*hi_res</prerolls>

    // For streaming H264 and AAC files
    <prerolls>mp4:lo_res.mov*mp4:med_res.mov*mp4:hi_res.mov</prerolls>

  5. You may need to refer to some of the other additional examples for more informaiton on Working with a Flash Media Server, Working with H264 Video and AAC Audio Files, and Preroll Videos.

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 "bandwidth.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

footer_graphic

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