Apart from playing Flash videos, you can play videos in any format supported by HTML 5 compliant browsers.

Specify the source for HTML 5 videos in one of the following ways:

  • If you feed only one video source, specify it as shown in the following example:

    <cfmediaplayer name="Player" source="myvideo.mp4" width="200" height="200" />

  • To feed multiple videos, specify the source as shown in the following example:

    <cfmediaplayer name="Player" width=200 height=200>
    <source src="movie.ogg" type="video/ogg" />
    <source src="movie.mp4" type="video/mp4" />
    <source src="movie.webm" type="video/webm" />
    </cfmediaplayer>

Note: The source tag represents the HTML 5 video source tag. When source tag is specified, you are recommended to use the attribute type.

  • Dynamically set the media player source using the JavaScript function ColdFusion.MediaPlayer.setSource.

For best results with the player, ensure that you specify doctype in your code as follows: <!DOCTYPE html>

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy