| |
The ESA HD Media Player supports any Flash Media Server 3/4 (FMS, FMIS, Influxis, Akamai, VitalStream, etc.), Red5, and Wowza. If you are loading media files that are hosted on one of these server types you must use the following syntax to reference your files.
FLV:
rtmp://www.yourfms.com/application/stream.flv
MP3:
rtmp://www.yourfms.com/application/mp3:track.mp3
H264/AAC – MP4, MOV, M4A, M4V, F4V, 3GP, 3G2:
rtmp://www.yourfms.com/application/mp4:stream.mp4
Live Streams:
Live rtmp streams can be loaded into the player just like pre-recorded videos, but you may want to reduce the buffer time to 1 second using the “mediaBuffer” parameter in the MediaPlayer’s Component Inspector.
Regarding Protocols and Ports:
You can use any of the available rtmp protocols (rtmp, rtmpe, rtmps, rtmpt, rtmpte) and ports (1935, 443, 80).
Regarding Instances:
If you have “instances” in your rtmp path you should also check the “Instance” variable in the Skin Wizard, or the “mediaSourceInstance” parameter in the MediaPlayer’s Component Inspector, or if you’re using the XML playlist, you can use the “instance” attribute in the <item> container at the top of the xml (xml settings override Skin Wizard and Component Inspector settings). This setting helps the player parse your rtmp path so it can connect to your server and play your stream. If the first instance in your rtmp path is part of the application, use the “application” setting; if the first instance is part of the stream name, use the “stream” setting. Below are examples of rtmp paths with instances (i.e. if your path contains more than one folder, you are using instances):
rtmp://www.yourfms.com/application/instance/stream.flv
rtmp://www.yourfms.com/application/instance1/instance2/stream.flv
The HD Media Player supports the use of FlashVars in the html “Flash Object and Embed Tags” for dynamic media loading. To enable the use of FlashVars, the embed script must be set up as shown below, the “mediaSource” parameter in the MediaPlayer’s Component Inspector must be blank prior to publishing the SWF (should be blank by default), and the action script in this post must be in the actions panel (included in all skins).
Embed Script:
Below is a typical set of object and embed tags used to embed one of our players into a webpage (notice the FlashVars in red). If you are not familiar with our recommended embed script, please see the “Simple Embed” tutorial for more details.
<object classid=”clsid:d27cdb6e-ae6d-11cf-96b8-444553540000″
codebase=”http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0″
width=”640″ height=”390″ id=”ESAHDMP” >
<param name=”movie” value=”default.swf” />
<param name=”allowfullscreen” value=”true”/>
<param name=”allowscriptaccess” value=”always”/>
<param name=”FlashVars” value=”media=media.xml” />
<param name=”wmode” value=”transparent” />
<embed src=”default.swf” width=”640″ height=”390″ FlashVars=”media=media.xml” allowfullscreen=”true”
allowscriptaccess=”always” type=”application/x-shockwave-flash” wmode=”transparent”
pluginspage=”http://www.macromedia.com/go/getflashplayer” name=”ESAHDMP” />
</object>
With all of our default players (starting v.1.5.3), you can use following FlashVars to configure the player on pageload:
- autoplay – Options: “Yes-always”, “Yes-on first video”, “No-always”, “No-on first video”.
- image - Absolute or relative path to an image file to be used as a preloader, pause image, or in support of an audio file. If you use a relative path it must be relative to the location of the page where the SWF is displayed, not the location of the SWF on your server.
- link – URL where user will be directed if they click the screen.
- instance – Options: “application” or ”stream”. Determines if the first instance in a rtmp path should be attributed to the application or stream name. For example: if your rtmp path is rtmp://www.server.com/application/instance/stream, and /instance/ is part of the stream name choose “stream”; or if /instance/ is part of the application name choose “application”.
- media – Absolute or relative path to a single audio/video file or a XML playlist file that has the “.xml” extension. In the above example, the player would load “media.xml”. If you use a relative path it must be relative to the location of the page where the SWF is displayed, not the location of the SWF on your server. Progressive (http) and streaming (rtmp or rtmpe) protocols are supported for audio and video files, meaning you can host your media files on any standard web server, Flash Media Server 3/4 (FMS or FMIS), Wowza, Red5, or YouTube.
- xml - Absolute or relative path to a XML playlist file that does not have the “.xml” extension (e.g. xml generated with ASP or PHP). If you use a relative path it must be relative to the location of the page where the SWF is displayed, not the location of the SWF on your server.
- wizard – (v.2 or later) wizard settings array; this variable should only be used with the Skin Wizard.
You must choose either the “media” or “xml” FlashVars to load your media item(s) – you can not use both at the same time. Typically, when you load a XML file the other FlashVars are unnecessary, because those variables can be defined in the XML. When loading single media items, you can define multiple FlashVars using the “&” symbol as a separator, and the “media” FlashVars should be defined last, as shown below:
“autoplay=No-always&image=image.jpg&link=http://www.domain.com&media=video.flv”
Action Script 3.0:
The following action script detects the FlashVars (red text) in the embed code upon pageload and passes those variables into the MediaPlayer component at run-time. This script is included in our default player FLA (v.2 or later; differs slightly in previous version numbers and other skins), and can be accessed in the actions panel (scene 1, frame 1).
//—Load Media Using FlashVars—
if(myMediaPlayer.mediaSource == “”){
try {
var media:String;
var id:*;
var xml:Boolean;
var keyStr:String;
var valueStr:*; //String
var paramObj:Object = LoaderInfo(this.root.loaderInfo).parameters;
for (keyStr in paramObj) {
valueStr = String(paramObj[keyStr]);
if(keyStr == “autoplay“) myMediaPlayer.mediaAutoPlay = valueStr;
if(keyStr == “image“) myMediaPlayer.imageSource = valueStr;
if(keyStr == “link“) myMediaPlayer.mediaLink = valueStr; //must set link target in fla or xml
if(keyStr == “instance“) myMediaPlayer.mediaSourceInstance = valueStr;
if(keyStr == “media” && media == “”) media = valueStr;
if(keyStr == “id” && id == 0) id = valueStr;
if(keyStr == “xml” && media == “”){
xml = true;
media = valueStr;
}
if(keyStr == “wizard“){
config(valueStr.split(”,”));
}
}
} catch (error:Error) {
trace(”Undefined Media”);
}
if(id != 0){
myMediaPlayer.loadXMLAtID(media,id);
} else if(id == 0 && xml){
myMediaPlayer.loadXML(media);
} else {
myMediaPlayer.loadMedia(media);
}
}
Working with a Flash Media Server?
If you are loading media files that are hosted on a Flash Media Server you should refer to our tutorial, “Working With A Flash Media Server” for instructions.
- Tags: dynamic media loading, dynamic xml, Flash Media Server, FlashVars, fms, html media loading, load audio, load media, load video, load xml, xml playlist
« Previous Page — Next Page »
|
|