Click here to Skip to main content
15,867,895 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello everyone
I wanna to add an option of video play into my website?please tell me how can add video into my asp.net page which support all formats and play on every browser.
I tried html video tag but it is not working

here is the source of my page


HTML
<pre><pre lang="HTML">
UPLOAD VIDEO :<asp:FileUpload ID="FileUpload1" runat="server" />




<asp:Button ID="Button1" runat="server" onclick="Button1_Click"
Text="Upload Video" />


<asp:Label ID="Label1" runat="server" Text="">
<asp:ListView ID="ListView1" runat="server" DataSourceID="SqlDataSource1">
<layouttemplate>
<table id="tb1" runat="server">
<tr id="itemPlaceHolder" runat="server">

<itemtemplate>
<tr runat="server">
<td runat="server">

<object id="mediaPlayer" classid='clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95' standby='Loading....'

viewastext class='MediaPlayerWidth'>

<param name="fileName" value="<%#Eval(" videopath=")%>" />

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

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

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

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

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

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

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

<embed type="application/x-mplayer2" pluginspage="http://microsoft.com/windows/
mediaplayer/en/download/" id="" name="mediaPlayer" class="MediaPlayerWidth" src="<%#Eval("Videopath")%>"> </embed>

</object>


<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:demoConnectionString2 %>"
SelectCommand="SELECT * FROM [UploadVideos]">
</form>
</body>
</html>
HTML

C#

HTML

Posted
Updated 22-Jan-14 23:28pm
v3

1 solution

I am not certain but I don't think there isn't one fits all approach for video embedding into your webpage which supports all browsers. You may need to tweak a little for each browser. Since you haven't shared your code I can not comment on it or improve it.

But here are some reference links for you:
Walkthrough: Adding Video or Audio Media to a Web Application[^]
How To Play Flash Video Files In ASP.NET[^]
ASPNetFlashVideo for ASP.NET[^]

Also, you can embed videos ASP.Net MVC3 with the Razor easily if your main purpose is showing videos. Example usage:

Silverlight:
Video.Silverlight(filename, width, height)
Flash:
Video.Flash(filename [, width, height])
Media Player:
Video.MediaPlayer(filename [, width, height])

Good luck,
OI
 
Share this answer
 
Comments
Azad R Chouhan 11-Apr-13 6:12am    
i add my source code hi the question check this media player added successfully but video is not playing in this media player

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900