Creates an in-built media player that lets you play FLV, MPEG-3, and MPEG-4 files.
FLV files can be played from any web server. You can play MPEG-3/MPEG-4 only from Flash Media Server using RTMP.
Display management tags
<cfmediaplayer
align="alignment option"
autoplay="true|false"
bgcolor="hexadecimal value"
hideborder="true|false"
hidetitle="true|false"
controlbar="true|false"
fullScreenControl="yes|no"
name="name"
onComplete="JavaScript function name"
onLoad="JavaScript function name"
onStart="JavaScript function name"
quality="low|high|medium"
source="source name"
style=="style specification"
height="integer"
width="integer"
wmode="window|opaque|transparent">
</cfmediaplayer>
ColdFusion 9: Added this tag.
Attribute |
Req/Opt |
Default |
Description |
|---|---|---|---|
|
Optional |
|
Specifies the horizontal alignment of the
media player. You can select from |
|
Optional |
false |
A Boolean value that specifies if the media
player must automatically play the FLV file on loading the CFM page:
|
|
Optional |
6b7c85 |
The background color of the media player specified as a Hexadecimal value without a "#" |
|
Optional |
true |
A Boolean value that specifies if you want to display the control panel for the media player:
|
|
Optional |
true |
A Boolean value that specifies if you want a border for the media player panel:
|
|
Optional |
|
If |
|
Optional |
|
Whether full screen is enabled:
The following characteristics apply:
|
|
Optional |
360 pixels |
Height of the media player, in pixels. |
|
Required if |
Name of the media player. The name attribute is required when you invoke JavaScript functions. |
|
|
Optional |
Custom JavaScript function to run when the FLV file has finished playing. |
|
|
Optional |
Custom JavaScript function to run on loading of the player component. |
|
|
Optional |
Custom JavaScript function to run when the FLV file starts playing. |
|
|
Optional |
|
The quality of the media playback:
|
|
Required if |
The URL to the FLV file. This can be a URL relative to the current page. You can store the FLV file on the ColdFusion server or any other streaming server. |
|
|
Optional |
The following are the supported styles:
|
|
|
Optional |
480 pixels |
Width of the media player, in pixels. |
|
Optional |
window |
Specifies the absolute positioning and layering
capabilities in your browser:
|
In
this example, the FLV file is stored in the web root used by the
ColdFusion server. You need to store an FLV file - mediafile.flv in
the location web_root\xyz\. You can now create the
media player with the following content:
<h3>cfmediaplayer Example</h3>
<cfmediaplayer
name="Myvideo"
source="/xyz/mediafile.flv"
width=500
height=400
align="middle"
quality="high"
fullscreencontrol="true"/>
The following code illustrates styling of the media player:
<cfset bgColorTheme = "EDC393"> <cfset titleColorTheme = "800517"> <cfset controlsColorTheme = titleColorTheme> <cfset progressColorTheme = "E67451"> <cfset progressbgColorTheme = "FFF8C6"> <cfmediaplayer name="player2" style="bgcolor:#bgColorTheme#; titletextcolor:#titleColorTheme#;titlebgcolor:#bgColorTheme#;controlbarbgcolor:#bgColorTheme#;controlscolor:#controlsColorTheme#;progressbgcolor:#progressbgColorTheme#;progresscolor:#progressColorTheme#;borderleft:20;borderright:20;bordertop:10;borderbottom:13" hideborder="false" hideTitle=false controlbar="true" source="#defaultFlvfile#">