Thursday, 8 August 2013

Upload YouTube Video and On Video Click Display in Next Page (Similar to YouTube)

if you are looking for to make a website similar to YouTube Then You are At right place. I will not tell yo to make complete web site like YouTube but will give some idea to solve particular problems like
1. How to upload YouTube Video
2. How to get Thumbnail of YouTube Video in your Database.
3. Onclick Display it in New page and Play there with some details.
so here we go.....
1. how to upload video in Database.
    you do not need to upload video to your database because your hosting company will not give huge data storage. So you should keep only link of that video when user upload this take link of that image. so I have link for you already above you can do it easily. Do not worry i will do it here this again.

1. First of all create a data base with some columns like this.
You do not need to make LikeCount and ViewCount because i have this for to collect like and hits on my site.Here we will store our data in server in those columns.
In you Asp page create a text box in which user will give URL of YouTube videos and will click on upload like this.
You do not need to make User Name text box. On Code behind of Upload button Click write these code so that you can get Thumbnail and video converted in Embedded as well.

In the above picture it is clear that in comment you can get thumbnail of YouTube video.
Now display it in data list in horizontal direction and when some body click on that video display it in next page.
So you will need to first of all display these video in web page in our example we will display this video in same page in which we allow user to upload video for this we will take data list and code like this
we will take hep of Eval to display our Thumbnail in web page you may or may not display other things like upload date and uploaded user. we will use a method named connect_method to display video image in data list in web page.

in page load method call this function to display video links. 

Now when user click on video display this in next page. for this you will have to make a new page and take div in which you will have to define data list and a iframe inside data list tag to display video code will be like this. 

now that DataListItemCommand method we has declared in upload page (Look at the above data list code which display video in web page) here is that method with the help of this we will pass image "ID" in next page and display and play video in that page.

     here in Detail.aspx you should give the Url of that page in which you have declared data list and ifram to play video. and on that page you should write some code on behind page on page load event.
I tried my best to make it easy for you but if you have any doubt then you can send commend to me.

Thank you for your time at my blog..have nice day...