How can i run video songs on my asp.net page

Posted by Ankitagupta under ASP.NET on 6/16/2013 | Points: 10 | Views : 2803 | Status : [Member] | Replies : 12
hi
any body tel me how can i run vedio song on my asp.net page
and i want to run vedio on full screen pls help me

ankita


Responses

Posted by: Satyapriyanayak on: 6/17/2013 [Member] [MVP] Silver | Points: 25

Up
0
Down
http://www.codeproject.com/Questions/314192/how-to-play-a-video-file-in-asp-net

If this post helps you mark it as answer
Thanks

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

Posted by: Cherishma on: 6/17/2013 [Member] Starter | Points: 25

Up
0
Down
Hi,
First upload a movie clip using fileupload....and then the play button....it iwll play the uploaded video....

Kinldy change the path in button1_Click to the corresponding to the server path.....and also to upload videos more than 4mb...kindly change the following settings in web.config....

Hope it will help u..


<%@ Page Language="C#" %>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
}


protected void Button1_Click(object sender, EventArgs e)
{
if (FileUpload1.HasFile)
{
string path = @"E:\";
FileUpload1.SaveAs(path + FileUpload1.PostedFile.FileName);
Session["src"] = path + FileUpload1.PostedFile.FileName;
}
}
private string str;
protected void Button2_Click(object sender, EventArgs e)
{
str = Session["src"].ToString();
}
</script>


<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
Upload -
<asp:FileUpload ID="FileUpload1" runat="server" />
<asp:Button ID="Button1" runat="server" Text="Upload" onclick="Button1_Click" /><br />
Play -
<asp:Button ID="Button2" runat="server" Text="Button" onclick="Button2_Click" /><br />
<object id="mediaplayer" classid="clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#version=5,1,52,701" standby="loading microsoft windows media player components..." type="application/x-oleobject" width="320" height="310">
<param name="filename" value='<%=str %>'/>
<param name="animationatstart" value="true"/>
<param name="transparentatstart" value="true"/>
<param name="autostart" value="true"/>
<param name="showcontrols" value="true"/>
<param name="ShowStatusBar" value="true"/>
<param name="windowlessvideo" value="true"/>
<embed src='<%=str %>' autostart="true" showcontrols="true" showstatusbar="1" bgcolor="white" width="320" height="310"/>
</object>
</div>
</form>
</body>
</html>

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

Posted by: manoranjanguptaoutlook-19221 on: 6/17/2013 [Member] Starter | Points: 25

Up
0
Down
Hello Ankita
Its quite simple to play video on your asp.net page
Use HTML5 Control

Manoranjan Gupta Manu
9873306227

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

Posted by: Ankitagupta on: 6/17/2013 [Member] Starter | Points: 25

Up
0
Down
hallo cherisma
pls can you tell what mean of param tag
i m using vs 2008
this support 2008 ????

ankita

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

Posted by: Ankitagupta on: 6/17/2013 [Member] Starter | Points: 25

Up
0
Down
hallo
manoj gupta can you send any demo project

ankita

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

Posted by: Cherishma on: 6/17/2013 [Member] Starter | Points: 25

Up
0
Down
Hai,

it will work on vs 2008.. The <param> tag is used to define parameters for plugins embedded with an <object> element.

refer

http://www.w3schools.com/tags/tag_param.asp

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

Posted by: Ankitagupta on: 6/17/2013 [Member] Starter | Points: 25

Up
0
Down
dear cherisma
above code not working i m attached project pls
tell me where error...pls help me download the project

 Download source file

ankita

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

Posted by: Cherishma on: 6/18/2013 [Member] Starter | Points: 25

Up
0
Down
Hi Ankita,

I dont have permissions to download that project in my system. i will try above code in my system and i will give u...

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

Posted by: Cherishma on: 6/18/2013 [Member] Starter | Points: 25

Up
0
Down
Ankita,

Kinldy change the path in button1_Click to the corresponding server path.....and also to upload videos more than 4mb...kindly change the following settings in web.config....



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

Posted by: perfectchourasia-9163 on: 6/26/2013 [Member] Starter | Points: 25

Up
0
Down
http://www.w3schools.com/html/html5_video.asp


ER sandeep chourasia
sandeepchrs@yahoo.com (on facebook)
http://www.aspnetcodes.com/

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

Posted by: Jitendrasoft09 on: 6/26/2013 [Member] [MVP] Starter | Points: 25

Up
0
Down
Hi,
It is nice question, hope all are doing well, as HTML 5 provides <video> element to play video easily, copy and paste below code in your visual studio to play video without writing much code.

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

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



Jitendra Kumar
If my post helps you, plz mark as an answer.

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

Posted by: manoranjanguptaoutlook-19221 on: 6/26/2013 [Member] Starter | Points: 25

Up
0
Down
Hello
Ankita
If your are using vs2010 use sp1 for upgrade this it will support html5

=======================
<!DOCTYPE html>
<html>
<body>

<audio controls="controls" autoplay="true">
<source src="your song source will come here" type="audio/mp3">
</audio>

</body>
</html>
==============
paste this code in notepad and save test.htm>>>>> open in chrome and any other it works
Happy to help

Manoranjan Gupta Manu
9873306227

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

Login to post response