display the videos in a grid view

Posted by Shreesh under ASP.NET on 10/18/2011 | Points: 10 | Views : 5293 | Status : [Member] | Replies : 1
hello,on your guidance i was able to save the filepath to my database while using the "FileUpload" control.thank you a lot. Now i need to display them in a grid view i.e display the videos that i have uploaded .its clear that the code in the "source" tab must be edited to suit the occasion.this is the code i have written.

<asp:TemplateField HeaderText="video">
<iframe id ="vd" height ="240" width ="320" runat ="server" src ="~/video.aspx"></iframe>

<asp:TemplateField HeaderText="download">
<asp:Button ID="btn1" runat="server" CommandName="download" />


i need to display the video and download it from the grisview.thanks in advance.


Posted by: SheoNarayan on: 10/18/2011 [Administrator] HonoraryPlatinum | Points: 25

Are you going to use HTML 5? If yes, write below code


<h1><%# Eval("Title") %></h1>
<div class="smallText">Note: In case video is not playing, use latest version of Google Chrome browser that supports HTML 5 completely.</div>
<p><video id="videoPlay" poster="/images/videoposter.jpg"
controls="controls" autoplay="autoplay" width="800" height="450">
<source src="<%# Eval("YourVideoPath") %>" type="video/mp4" />
<span style="color:Brown;"><i><b>Sorry, looks like your browser doesn't supports HTML5. You can <a href="<%# Eval("YourVideoPath") %>">Download file</a> instead and play at your local system.</b></i></span>

Here "YourVideoPath" is the url of the video you have stored into the database.

If you are not going to use HTML 5, its little cumbersome, you need to have a Flash player to play the video or you can use Silverlight.


Sheo Narayan

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

Login to post response