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