The first poster has done some good stuff by posting the piece of code, mainly indicates/shows the fetch part of the video and plays it in the web player.
As I do not have the code for storing the video (which is the initial part), but can guide you through some steps which can lead to it end with properness.
The videos or images are like binary files where the specific file type needs a specific/generic application to view or play the respective file. As the content is completely in the binary format, so need to be read in the stream by opening the data stream on the specific file using System.IO.FileStream and System.IO.Stream.
Once the Stream is loaded in the memory, you can pass the variable data in to the database like you do for storing the user name in the varchar field by creating one field in the table with Varbinary datatype, and you can use the binary equivalent in the declaration stage of your code in the client level and pass it to the method which does the data insert work.
In the same way as you store the binary in the database also can be used to fetch the data from the database and store back in the stream and use the stream to play the video directly feeding the stream to the source of the video or you can write back the stream to the hard-disk in any temp folder and then use the local path as the source of the stream to play it.
It might seems like a difficult task, but it is easier than how it looks or feels.
Okay.
Danny
2013-02-12 02:08:58 UTC
I generally prefer to upload file in the folder on the server using file upload component and then i would prefer to store name in the database so we can retrieve data faster while fetching the records.
?
2013-02-08 04:45:25 UTC
Well, I did an example on the Repeater control. You have to read the data from the SQL Server with a SQL adapter and bind the data source to the Repeater control. Well, here you can specify which videos to select in the datasource..
Collapse | Copy Code
private DataTable GetSpecificVideo(object i)
//pass the id of the video
{
string connectionString =
ConfigurationManager.ConnectionStrings[
"uploadConnectionString"].ConnectionString;
SqlDataAdapter adapter = new SqlDataAdapter("SELECT Video, ID " +
Now, its time for the player control.. In the Repeater (source view), add an ItemTemplate, and set the URL value parameter of the player control to <'%# "VideoHandler.ashx?id=" + Eval("ID") %'>. The ID is the name of the ID column of the data source that the Repeater binds to.
It began with MySQL, yet as quickly as Youtube grew to grow to be common, you ought to have observed it long previous so sluggish earlier Google gained it. around that factor, they have been fidgeting with multiple experients for scaling Write/study overall performance via DB partitioning etc. as quickly because it replaced into gained via Google, Youtube persisted to be using Python/Psyco/Cython/C ext platform, yet switched to Google inhouse Bigtable based Database, dispensed document storage. the belief is "don t save document in DB". Theoretically, there is no harm, practically it doesn t artwork. How might you seek for to end of document it relatively is stored in DB, you will ought to study all in memory, and picture of a 4GB video document being processed such way. in case you ought to technique thumbnails using ffmpeg, how can or no longer it rather is a probability if documents is in DB. How might you help streaming, the place the client can request to start video from 30 secs, no longer from beginning up, which you do once you pass video using slider in Youtube. Youtube supplies a special call to each uploaded video document (like UUID), sends it in processing batch for placed up-processing, conversion, and thumb-era. It shops those metadata (width/top/unique-call/converted-va... etc) in DB. Video is pushed to CDN, Colo, to many servers. So comparable video may be served to you via distinctive server than helping me.