Click here to Skip to main content
16,020,447 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
<object width="100%" height="100%"
type="video/x-ms-asf" url="3d.wmv" data="3d.wmv"
classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6">
<param name="url" value="3d.wmv">
<param name="filename" value="3d.wmv">
<param name="autostart" value="1">
<param name="uiMode" value="full" />
<param name="autosize" value="1">
<param name="playcount" value="1">
</object>


1):I added player with this code now how could i play video.

2):How can i store address of video in database and then open specific video by clicking on it.
Posted

1 solution

to upload video in database
C#
protected void btnSub_Click(object sender, EventArgs e)
   {
       try
       {
           UploadVideo obj = new UploadVideo();
           string filename = fuUploadVideo.FileName;
           string path = Server.MapPath("Uploads4");
           string strFinalFileName = Path.GetFileName(fuUploadVideo.FileName);
           long FileLength = fuUploadVideo.PostedFile.ContentLength;
           long uploadchunklimit;
           int SizeLimit = (int)FileLength;
           if (FileLength <= 1024)
           {
               uploadchunklimit = 1;
               SizeLimit = (int)FileLength;
           }
           else if (FileLength > 1024)
           {
               uploadchunklimit = FileLength / 1024;
               SizeLimit = 10;
           }
           else if (FileLength <= 10240 && FileLength > 1024)
           {
               uploadchunklimit = FileLength / 1024;
           }
           else
           {
               uploadchunklimit = FileLength / 1024;
           }

           long lngSize = (long)SizeLimit;
           lngSize = 1024 * 1024;
           string ext = Path.GetExtension(fuUploadVideo.PostedFile.FileName);

           fuUploadVideo.PostedFile.SaveAs(Server.MapPath("~\\Uploads4\\" + filename));
           path = "~\\Uploads4\\" + filename;
           SqlConnection con = new SqlConnection(str);
           lblinfo.Text = " uploaded successfully ";
           cmd = new SqlCommand("Insert into electronicmedia(Video_Name,url) values(@Video,'" + path + "')", con);
           cmd.Parameters.AddWithValue("Video", TextBox2.Text);
           cmd.CommandType = CommandType.Text;
           con.Open();
           cmd.ExecuteNonQuery();
           con.Close();
       }
       catch (Exception ex)
       {
           Response.Write(ex.ToString());
       }
       }

to play video chech the link for the same discussion
Play video
 
Share this answer
 

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