Embedding a video in a web applicaiton

Posted by Sankettt under ASP.NET on 10/11/2011 | Points: 10 | Views : 11922 | Status : [Member] | Replies : 9
i want to embed a video in a webpage.
can anyone help me with the script or a piece of code required for the same.

sankettt


Responses

Posted by: Blessyjees on: 10/11/2011 [Member] Bronze | Points: 25

Up
0
Down
Hi,

Your browser support html5, you can easily add video using html tag

<video width="320" height="240" controls="controls">

<source src="movie.mp4" type="video/mp4" />

</video>

For more information refer http://www.w3schools.com/html/html_videos.asp

Blessy Baby
Digitalmesh Softech pvt Ltd
https://blessybaby.wordpress.com/

Sankettt, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Ndebata on: 10/11/2011 [Member] Starter | Points: 25

Up
0
Down
you can use object tag to embed video
<object id="MediaPlayer" width="482" height="350" classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95"

standby="Loading Windows Media Player components..." type="application/x-oleobject">
<param name="FileName" value="videos/videofilename.wmv">
<param name="ShowControls" value="true">
<param name="ShowStatusBar" value="false">
<param name="ShowDisplay" value="false">
<param name="autostart" value="false">
<embed type="application/x-mplayer2" src="videos/videofilename.wmv" name="MediaPlayer"
width="482" height="350" showcontrols="1" showstatusbar="0" showdisplay="0" autostart="0"></embed>
</object>


Sankettt, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vuyiswamb on: 10/11/2011 [Member] [MVP] [Administrator] NotApplicable | Points: 25

Up
0
Down
This is normally done as Ndebata suggested. but normally you would upload the video in yotube and generate the markup that will be an Object and paste it in your webpage.


Thank you for posting at Dotnetfunda
[Administrator]

Sankettt, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sankettt on: 10/11/2011 [Member] Starter | Points: 25

Up
0
Down
i did as suggested by ndebata but then video is not be played.!
any suggesttion for this ?

sankettt

Sankettt, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Ndebata on: 10/11/2011 [Member] Starter | Points: 25

Up
0
Down
Please check you have written the correct path of the video.
One more thing what is the video format you are using?

Sankettt, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vuyiswamb on: 10/11/2011 [Member] [MVP] [Administrator] NotApplicable | Points: 25

Up
0
Down
lets see your code.

Thank you for posting at Dotnetfunda
[Administrator]

Sankettt, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sankettt on: 10/11/2011 [Member] Starter | Points: 25

Up
0
Down
.mp4 format.
and the code is same as mentioned by ndebata.
does it support ?


sankettt

Sankettt, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sankettt on: 10/11/2011 [Member] Starter | Points: 25

Up
0
Down
<body>
<form id="form1" runat="server">
<div>
<p align="left">
<object id="MediaPlayer" width="482" height="350" classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95"

standby="Loading Windows Media Player components..." type="application/x-oleobject">

<param name="FileName" value="2008-07-09-01.wmv"/>

<param name="ShowControls" value="true"/>

<param name="ShowStatusBar" value="false"/>

<param name="ShowDisplay" value="false"/>

<param name="autostart" value="false"/>

<embed type="application/x-mplayer2" src="2008-07-09-01.wmv" name="MediaPlayer"

width="482" height="350" showcontrols="1" showstatusbar="0" showdisplay="0" autostart="0"></embed>

</object>
</p>
</div>
</form>
</body>


this is the code.
and <embed> tag is not supported but .net framework it doesnt give any error as such .


sankettt

Sankettt, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vuyiswamb on: 10/11/2011 [Member] [MVP] [Administrator] NotApplicable | Points: 25

Up
0
Down
This does not look right. You mean the video is in the Root of your website ?

Better create a video folder in your project and Convert your code to this

<embed type="application/x-mplayer2" src="~/Videos/2008-07-09-01.wmv" name="MediaPlayer" 


width="482" height="350" showcontrols="1" showstatusbar="0" showdisplay="0" autostart="0">


Thank you for posting at Dotnetfunda
[Administrator]

Sankettt, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response