Pages

Sunday, August 15, 2010

Embedding Video in a Web Page

The following is a sample code that shall help you embed a custom vedio of your choice in a web page.

Note: This code works fine in IE/Fire Fox. Holds good when included in a XPage as well. The same fails when previewed on notes client though... i mean XPages in 8.5.1

The code below shall have two fragments one is <object> tag for IE and  <Embed> for Firefox,

Hence you got to specify your video url in two places in the following code.


<object ID="MediaPlayer" WIDTH="400" HEIGHT="300" CLASSID="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" STANDBY="Loading Windows Media Player components..."
TYPE="application/x-oleobject">   <param NAME="FileName" VALUE="http://www.youtube.com/v/bz6BA1heMSI?fs=1&amp;hl=en_US" />
<param name="ShowControls" VALUE="true" />
<param name="ShowStatusBar" value="false" />
<param name="ShowDisplay" VALUE="false" />
<param name="autostart" VALUE="true" />
<embed TYPE="application/x-mplayer2" SRC="http://www.youtube.com/v/bz6BA1heMSI?fs=1&amp;hl=en_US" NAME="MediaPlayer" WIDTH="400" HEIGHT="300" ShowControls="1" ShowStatusBar="0" ShowDisplay="0" autostart="1">   </EMBED> </OBJECT>

2 comments:

  1. Hi Karthikeyan..i tried to embedded the video in xpage.but when i am previewing it i am not getting the plugin for it.i installed all the plugin in firefox but its not helping me out.can you pls help me to solve this issue..

    ReplyDelete
  2. Hi Roopesh, send plz post your code along with the url you are trying to consume into inorder to display the vedio. I will take a look into it and let you know

    ReplyDelete