Friday, June 1, 2012

Video Player in Visual Force


Video Player in Visual Force:
Visual Force page supports HTML tags and we can embed in our VF code. We are using Windows Media Player in Visual Force page. For that we have used basic HTML tags. Also this media player directly calls from Microsoft URL and plays our video which is placed in Static Resource.
Following are the HTML tags we have used in visual force page.

1. Object Tag:
This tag is used to the include objects such as images, audio, videos, Java applets, ActiveX, PDF, and Flash. This object tag element was intended to the replace Image and applet elements which are used in old languages. However, because of bugs and a lack of browser support this object has not happened. Means this tag is browser support tag with different attributes.

2. Param Tag:
This tag is used to define the parameters or the variables for an object or applet element. This is used within Object tags.

3. Embed Tag:
Embed tag is mostly used in Visual force which is embed plugin and lay out the player. Here are the attributes in embed tag embed type,pluginspage, src, autostart, align, width, height, defaultframe, showstatusbar.

Visual Force page code:
<apex:page title="Vidio Player in VF">
<!--Upload Mpg video on Static Resource like Geographic -->
<body>
<object id="MediaPlayer1" width="180" height="200" classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" standby="Media Player components..." type="application/x-oleobject" align="middle">
<apex:param name="FileName" value="{!$Resource.Geographic}"/>
<apex:param name="ShowStatusBar" value="True"/>
<apex:param name="DefaultFrame" value="mainFrame"/>
<apex:param name="autostart" value="false"/>

<embed type="application/x-mplayer2" pluginspage = "http://www.microsoft.com/Windows/MediaPlayer/" src="{!$Resource.Geographic}" autostart="false" align="middle" width="200" height="150" defaultframe="rightFrame" showstatusbar="true">
</embed>
</object>
<a href="{!$Resource.Geographic}"><font size="2">Click here for Player</font></a>
<a href="http://www.microsoft.com/windows/windowsmedia/mp10/default.aspx">
<font size="1">Download Media Player Here</font></a>
</body>
</apex:page>

No comments:

Post a Comment