Note: This feature applies only to Flash videos.

Using FlashVars, you can extend the media player to use capabilities of both OSMF plug-ins and Strobe media player.

As this section describes, you can use plug-ins in the OSMF market. Two popular plug-ins are demonstrated.

The general procedures to extend the media player capability are as follows:

  1. Get the FlashVars and SWFs (from the plug-in vendor)
  2. In the cfmediaplayer, insert a param tag with the FlashVars.

Playing videos on YouTube server

The following example shows how to play a video hosted on YouTube server using cfmediaplayer:

<html>
<head>
</head>
<body>
<cfmediaplayer
name="player_youtube"
source="http://www.youtube.com/watch?v=gv68hDObACk&feature=feedrec_grec_index"
type="flash"
>
<param name="flashvars" value="plugin_YoutubePlugin=YouTubePlugin.swf" />
</cfmediaplayer>
</body>
</html>

Here, source is the actual YouTube video link. You point to the YouTube plug-in SWF using FlashVars.

Playing linear and non-linear advertisements using stage video

You can extend the mediaplayer to play advertisements using a staged video. The advertisements play within the video in linear and non-linear mode.

Example

<html>
<head>
<script type="text/javascript">
function nonLinear()
{
var player = ColdFusion.MediaPlayer.getPlayer('player');
player.displayNonLiniarAd (
"http://gcdn.2mdn.net/MotifFiles/html/1379578/PID_938961_1237818260000_women.flv", {
right: 10 * Math.random(),
bottom: 10 * Math.random(),
scaleMode: "none"});
}
</script>
</head>
<body style="background:#FFFFFF">
<input name = "AdvertisementPlugin" value="Advertisement" type="button" onClick="nonLinear('player')">
<cfmediaplayer
name="player"
source="/videos/cathy2_HD.mp4"
type="flash"
>
<param name="flashvars" value="plugin_ads=/CFIDE/scripts/ajax/resources/cf/assets/AdvertisementPlugin.swf" />
</cfmediaplayer>
</body>
</html>

In this example, using FlashVars, you point to the advertisement plug-in. Custom JavaScript function from the plug-in is used to play video in linear and non-linear mode.

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