header_graphic
header_gradient
 
  • Posted by ESA
  • Comments Off

The HD Media Player can be embedded in a webpage using SWFObject v2.2, which uses a javascript file (swfobject.js; static publishing method) to detect the Flash Player version. If the user doesn’t have Flash Player 10, the Express Install application (expressInstall.swf) will try to update their Flash Player (please note: in most browsers you will have to close/reopen your browser to complete the installation). If the Flash Player detection fails, the script will attempt to load alternate audio/video content using the default HTML5 player. This robust embed approach ensures that users will see your content whether they are working on a desktop, laptop, or mobile device including iPad and iPhone. This approach also helps browsers index your content, so it is highly recommended.

Download Sample Files

Click Here To See A Working SWFObject, Express Install, and HTML5 Sample

Click here to learn more about SWFObject v2.2

Click here to learn more about HTML5

The following four lines of script must be pasted into the <head> tag of your web document. Notice the first line of script calls the “swfobject.js” file (green), which must be uploaded to your server at the location you specify. In the next three lines we use the static publishing method (swfobject.registerObject) to link the script to the SWF in the body of the web document. The arguments in this method are: SWF object “id” (blue), target Flash Player version (orange), and the path to the expressInstall.swf (red), which must be uploaded to your server at location you specify.

<script type=”text/javascript” src=”swfobject.js“></script>
<script type=”text/javascript”>
swfobject.registerObject(”ESAHDMP“, “10.0.0“, “expressInstall.swf“);
</script>

The following object tag is used to embed the flash player in the body of your web document, and to define your alternate HTML5 content. Notice the player object “id” matches what we defined above (blue). The first block of script is used by browsers like Internet Explorer (bold), the next block is used by browsers like FireFox and Chrome (italics), and the alternate HTML4/5 content is used when Flash fails (underlined). So if you need to make changes it is important to update variables throughout this script to make sure it will work correctly in all browsers and platforms.

<object id=”ESAHDMPclassid=”clsid:D27CDB6E-AE6D-11cf-96B8-444553540000″ width=”640″ height=”390″>
<param name=”movie” value=”default.swf” />
<param name=”FlashVars” value=”media=media.xml” />
<param name=”allowfullscreen” value=”true” />
<param name=”allowscriptaccess” value=”always” />
<param name=”wmode” value=”transparent” />
<!–[if !IE]>–>
<object type=”application/x-shockwave-flash” data=”default.swfwidth=”640″ height=”390″
FlashVars=”media=media.xml” allowfullscreen=”true” allowscriptaccess=”always” wmode=”transparent”>

<!–<![endif]–>
<!–begin alternate content, if flash fails try html5 audio/video/image/text–>
<video width=”640″ height=”360″ controls=”controls” preload=”none” poster=”image.jpg” src=”movie.mp4″></video>
<!–end alternate content–>

<!–[if !IE]>–>
</object>
<!–<![endif]–>
</object>

Flash Player Markup:

id (blue): If you are embedding multiple players on a page each should have a unique object id/name to avoid interference, and each should be registered independently using the javascript in the header.

movie/data (red):  The path to the SWF can be absolute or relative to the location of the page where it is embedded.

width/height (orange text): used to resize the default.swf as follows (starting v.1.5.3): set the width equal to your desired media width in pixels; set the height equal to your desired media height in pixels plus the height of the controls (default controller height is 30 pixels); for example, if you want to play videos at 320 x 240, then you would set the “width=320″ and “height=270″; the minimum width for the default skin is 320 pixels. Please note: with other skins like the Media Grid that do not include auto-resizing scripts, the height and width attribues should be equal to the SWF size).

flashvars (green): By default, all of our players use FlashVars to specify the absolute or relative path to a single audio/video file or XML playlist.

other attributes: ”enablefullscreen” is required for fullscreen support; “enablescriptaccess” is used for tracking and javascript; “wmode” helps the player blend into your page and avoid interference with other content like pull down menus.

While it is possible to automatically generate html tags for embedding Flash objects like our HD Media Player (e.g. using Flash or Dreamweaver), it is generally not recommended with our default players, because the automatically generated tags will not include some of the necessary markup including FlashVars and alternate content. In addition, the automatically generated tags are often much longer than what you see above, and contain unnecessary markup.

HTML5 Markup:

<video> tag with optional attributes:

  • width = display width in pixels
  • height = display height in pixels
  • controls = show controls as an overlay
  • autoplay = autostarts video
  • loop = continously loops video
  • preload = preloads video, ignored with autoplay
  • src = path to video file
  • poster = path to image file

HTML5 video sample:
<video width=”640″ height=”360″ controls=”controls” preload=”none” poster=”image.jpg” src=”video.mp4″>
</video>

<audio> tag with optional attributes:

  • controls = show controls
  • autoplay = autostarts audio
  • loop = continously loops audio
  • preload = preloads audio, ignored with autoplay
  • src = path to audio file

HTML5 audio sample:
<audio controls=”controls” preload=”none” src=”audio.mp4″>
</audio>

  • Posted by ESA
  • Comments Off

Here we provide solutions for problems that you may encounter when using the HD Media Player. If you experience any other problems, please contact us, and we’ll do our best to evaluate the problem and provide a solution.

Player SWF doesn’t load on page: You must have Flash Player 10 installed (you will probably have to close and reopen your browser to complete the installation), and you must provide a valid path to the SWF on your web server. If you are loading a SWF file that is NOT hosted on the same server as the page where it is being displayed, you must use a crossdomain.xml file in the root of the website that contains the SWF file (this is part of the Flash Player security model).

XML playlist doesn’t load in player: You must provide a valid path to your XML (using FlashVars, ActionScript, JavaScript, or the Component Inspector), and your XML can not contain errors (check all your media paths and use one of our default XML files to check your syntax). If you are loading a XML file that is NOT hosted on the same server as the page where it is being displayed, you must use a crossdomain.xml file in the root of the website that contains the XML file (this is part of the Flash Player security model).

Bandwidth detection doesn’t work: You must provide a valid path to your bandwidth test location (using a parameter in the XML or Component Inspector). Please refer to our “Automated Bandwidth Detection” tutorial for more information.

Fullscreen doesn’t work or player doesn’t resize correctly when exiting fullscreen: You must have Flash Player 10 installed (you will probably have to close and reopen your browser to complete the installation); you must be testing your SWF in a web page using a web browser (will not work on your desktop); and you must set the “allowfullscreen = true” in your embed code. If you have altered the size and/or location of any objects on the stage, you also have to modify a few lines of action script to account for the new layout. Please refer to our “Fullscreen Setup and Resizing” tutorial for more information.

JavaScript interaction doesn’t work: You must provide valid paths to all of your media files; you must define the “id & name” of your SWF in the embed code; you must test your SWF on a web server using a browser (i.e. will not work locally, swf must be embedded in a webpage, and the SWF can not be inside a <form> tag); and you must have JavaScript enabled in your browser. Please refer to our “JavaScript Interaction” tutorial for more information.

H264 (mpeg-4) files cannot be seeked before they are completely downloaded: The MOOV atom in your H264 files is located at the end of the file. To fix this problem you should re-encode the file using Adobe Media Encoder or QuickTime Pro. Alternatively, you could try using the QTIndexSwapper, but it may not work in all cases.

MP3 playback is too fast or too slow: Your MP3 contains variable bit rate encoding or unsupported sample frequencies (e.g. 48Khz). To fix this problem you should re-encode the track using constant bit rate encoding and a supported frequency (11, 22, 33, or 44 kHz), which can be done with iTunes.

Video duration/dimensions are wrong or progress bar/scrubbber doesn’t work: Your media file does not include metadata. To fix this problem you can manually define the duration using the “dur” attribute in <media> node of the XML, or you can re-encode the file using Adobe Media Encoder (FLV & H264 files), QuickTime Pro (H264 files), or  iTunes (MP3 files). Alternatively, you could try using the Buraks FLV Metadata Injector, but it may not work in all cases.

Progressive (http) FLV file doesn’t work: You must provide a valid path to your progressive media file. If you are using a relative path it must be relative to the location of the page where it is being used (not the location of the SWF). If you are using a Windows 2003 server (Microsoft IIS Server 6.0), make sure the FLV mime type has been added to the server (link to simple instructions).

Streaming (rtmp) file doesn’t work: You must use a supported server type (FMS 3.x, Wowza, or Red5); you must provide a valid path to your streaming media file (correct syntax based on file type); and you must use the correct ”instance” setting to help the player parse your rtmp path. Please refer to our “Working with a Flash Media Server” tutorial for more information.

footer_graphic

Home - FAQs - Support - Contact - Licensing, Refunds & Shipping - Downloads & Upgrades - Google Checkout
Purchase HD Media Player - Documentation - Skin Wizard - Sample Skins - Tutorials
Flash CS4 AS 3.0 HD Media Player Customization, Implementation, and Web Video Encoding Services
Copyright © 2003-2011 Earth Science Agency, LLC - All Rights Reserved