Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Mar 29, 2013 12:51 PM by oguzkaygun
Member
16 Points
41 Posts
Dec 28, 2012 07:26 AM|LINK
Hi
I want to make a one page in which I want to Upload a Video and play that one vedio.
and When I upload more than one vedio then i want to play the perticular Vedio on clik event of that specific vedio.
The list of vedio may be in repeater or grid or a datalist
Kindly suggest me how can i achieve this all requirements
Contributor
6129 Points
1172 Posts
Dec 28, 2012 08:47 AM|LINK
<div> <center> <object codebase='http://www.apple.com/qtactivex/qtplugin.cab' WIDTH='800' HEIGHT='600' classid='clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B'> <param name='src' value='you video path' /> <param name='controller' value='true' /> <embed src='you video path' CONTROLLER='true' WIDTH='800' HEIGHT='600' pluginspage='http://www.apple.com/quicktime/download/'></embed> </object> <div>My Quicktime Movie</div></div> </center>
Dec 28, 2012 08:52 AM|LINK
Thanks for giving your valuable reply
but i wanto to give the path of vedio dynamically at run time because i have multiple vedioes are there
<param name='src' value='you video path' />
<embed src='you video path' CONTROLLER='true' WIDTH='800' HEIGHT='600'pluginspage='http://www.apple.com/quicktime/download/'></embed>
Participant
1589 Points
512 Posts
Dec 28, 2012 08:58 AM|LINK
To upload video:
ASPX Page ------------------------
Select File : <asp:FileUpload ID="FileUpload1" runat="server" /> <br /><asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="FileUpload1" ErrorMessage="*" SetFocusOnError="True"></asp:RequiredFieldValidator>
.cs page ----------------
if (FileUploadPicture.HasFile) { try { string filepath = "~\\Gallery\\" + DdlFolder.SelectedItem.Text + "\\"; string filename=GenerateId()+ System.IO.Path.GetFileName(FileUploadPicture.FileName); string dbfilepath = filepath +filename; string filePathToSave = Server.MapPath(filepath) + filename; if (FileUploadPicture.FileName.ToLower().EndsWith(".jpg") || FileUploadPicture .FileName.ToLower().EndsWith(".jpeg") || FileUploadPicture .FileName.ToLower().EndsWith(".gif")) { FileUploadPicture .PostedFile.SaveAs(filePathToSave); // insert code to insert the data into tables
} else { ScriptManager.RegisterStartupScript(btnUpload, this.GetType(), "Added", "alert('This is not Valid file');", true); } } catch (Exception ex) { throw ex; }
To display the video
<asp:ListView runat="server" ID="ListGallery" GroupItemCount="3" > <LayoutTemplate> <div style="width: 503px;"> <asp:PlaceHolder runat="server" ID="groupPlaceHolder" /> </div> </LayoutTemplate> <GroupTemplate> <div style="clear: both;"> <asp:PlaceHolder runat="server" ID="itemPlaceHolder" /> </div> </GroupTemplate> <ItemTemplate> <div class="productItem" style="vertical-align:top;border-width:0px"> <div style="border-width:0px"> <a href='<%# "photogallery_events.aspx?name="+Eval("gfolderName") %>' style="border-width:0px; border-spacing:0px;"> <asp:Image ID="Image1" runat="server" ImageUrl='<%# Eval("galleryURL") %>' height="114" width="150" AlternateText="Mul"/> </a> </div> <div style="vertical-align:top;"> <%# Eval("gfolderName")%></div> </div> </ItemTemplate> <ItemSeparatorTemplate> <div class="itemSeparator"> </div> </ItemSeparatorTemplate> <GroupSeparatorTemplate> <div class="groupSeparator"> </div> </GroupSeparatorTemplate> <EmptyDataTemplate> No Video Found </EmptyDataTemplate> </asp:ListView>
Dec 28, 2012 09:31 AM|LINK
Thanks Rima
Your given code is working for Photos
but i want it for the Vedio files like Mp4,flv which are vedio files
Dec 28, 2012 09:47 AM|LINK
In this case you want to pass video path as query string
<form id="form1" runat="server"> <div> <asp:Literal ID="LtrlVdo" runat="server" Mode="Transform"></asp:Literal> </div> </form>
then recieve query string from code behind
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { ShowVideoFile(Request.QueryString["FileID"].ToString()); } } protected void ShowVideoFile(string value) { // LtrlVdo.Text = "<object width='1024' height='600'><param name='movie' value='" + value + "'></param><param name='allowFullScreen' value='false'></param><param name='allowscriptaccess' value='always'></param><param name='enableJavascript' value='true'></param><embed src='" + value + "' type='application/x-shockwave-flash' width='1024' height='600' allowscriptaccess='true' enableJavascript ='true' allowfullscreen='false'></embed></object>"; StringBuilder sb = new StringBuilder(); sb.Append("<div>"); sb.Append("<center>"); sb.Append("<object codebase='http://www.apple.com/qtactivex/qtplugin.cab' WIDTH='800' HEIGHT='600'"); sb.Append("classid='clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B'>"); sb.Append("<param name='src' value='" + value + "' />"); sb.Append("<param name='controller' value='true' />"); sb.Append("<embed src='" + value + "' CONTROLLER='true' WIDTH='800' HEIGHT='600' "); sb.Append("pluginspage='http://www.apple.com/quicktime/download/'></embed>"); sb.Append("</object>"); sb.Append("<div>My Quicktime Movie</div></div>"); sb.Append("</center>"); LtrlVdo.Text = sb.ToString(); }
Dec 28, 2012 09:49 AM|LINK
Thank
Let me try...
Dec 28, 2012 10:04 AM|LINK
How can i display all uploaded vedios on that page
Dec 28, 2012 10:09 AM|LINK
you can use any jquery model popup and load this page in this popup yar now i are behave like child. i think you can do this easily
i think your above question is solve this one is your new problem then post new question
Dec 28, 2012 10:17 AM|LINK
You may also upload the video from that and while showing in listview show it in pop up..
Like this
http://videolightbox.com/iphone-template.html
kapatel18
Member
16 Points
41 Posts
Upload and Play Video
Dec 28, 2012 07:26 AM|LINK
Hi
I want to make a one page in which I want to Upload a Video and play that one vedio.
and When I upload more than one vedio then i want to play the perticular Vedio on clik event of that specific vedio.
The list of vedio may be in repeater or grid or a datalist
Kindly suggest me how can i achieve this all requirements
SohailShaikh
Contributor
6129 Points
1172 Posts
Re: Upload and Play Video
Dec 28, 2012 08:47 AM|LINK
Sohail Shaikh
kapatel18
Member
16 Points
41 Posts
Re: Upload and Play Video
Dec 28, 2012 08:52 AM|LINK
Thanks for giving your valuable reply
but i wanto to give the path of vedio dynamically at run time because i have multiple vedioes are there
rimagandhi
Participant
1589 Points
512 Posts
Re: Upload and Play Video
Dec 28, 2012 08:58 AM|LINK
To upload video:
ASPX Page
------------------------
Select File : <asp:FileUpload ID="FileUpload1" runat="server" />
<br /><asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="FileUpload1" ErrorMessage="*" SetFocusOnError="True"></asp:RequiredFieldValidator>
.cs page
----------------
if (FileUploadPicture.HasFile)
{
try
{
string filepath = "~\\Gallery\\" + DdlFolder.SelectedItem.Text + "\\";
string filename=GenerateId()+ System.IO.Path.GetFileName(FileUploadPicture.FileName);
string dbfilepath = filepath +filename;
string filePathToSave = Server.MapPath(filepath) + filename;
if (FileUploadPicture.FileName.ToLower().EndsWith(".jpg") || FileUploadPicture .FileName.ToLower().EndsWith(".jpeg") || FileUploadPicture .FileName.ToLower().EndsWith(".gif"))
{
FileUploadPicture .PostedFile.SaveAs(filePathToSave);
// insert code to insert the data into tables
}
else
{
ScriptManager.RegisterStartupScript(btnUpload, this.GetType(), "Added", "alert('This is not Valid file');", true);
}
}
catch (Exception ex)
{
throw ex;
}
To display the video
<asp:ListView runat="server" ID="ListGallery" GroupItemCount="3"
>
<LayoutTemplate>
<div style="width: 503px;">
<asp:PlaceHolder runat="server" ID="groupPlaceHolder" />
</div>
</LayoutTemplate>
<GroupTemplate>
<div style="clear: both;">
<asp:PlaceHolder runat="server" ID="itemPlaceHolder" />
</div>
</GroupTemplate>
<ItemTemplate>
<div class="productItem" style="vertical-align:top;border-width:0px">
<div style="border-width:0px">
<a href='<%# "photogallery_events.aspx?name="+Eval("gfolderName") %>' style="border-width:0px; border-spacing:0px;">
<asp:Image ID="Image1" runat="server" ImageUrl='<%# Eval("galleryURL") %>' height="114" width="150" AlternateText="Mul"/>
</a>
</div>
<div style="vertical-align:top;">
<%# Eval("gfolderName")%></div>
</div>
</ItemTemplate>
<ItemSeparatorTemplate>
<div class="itemSeparator">
</div>
</ItemSeparatorTemplate>
<GroupSeparatorTemplate>
<div class="groupSeparator">
</div>
</GroupSeparatorTemplate>
<EmptyDataTemplate>
No Video Found
</EmptyDataTemplate>
</asp:ListView>
Regards
Rima Gandhi.
Software Developer.
kapatel18
Member
16 Points
41 Posts
Re: Upload and Play Video
Dec 28, 2012 09:31 AM|LINK
Thanks Rima
Your given code is working for Photos
but i want it for the Vedio files like Mp4,flv which are vedio files
SohailShaikh
Contributor
6129 Points
1172 Posts
Re: Upload and Play Video
Dec 28, 2012 09:47 AM|LINK
In this case you want to pass video path as query string
<form id="form1" runat="server"> <div> <asp:Literal ID="LtrlVdo" runat="server" Mode="Transform"></asp:Literal> </div> </form>then recieve query string from code behind
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { ShowVideoFile(Request.QueryString["FileID"].ToString()); } } protected void ShowVideoFile(string value) { // LtrlVdo.Text = "<object width='1024' height='600'><param name='movie' value='" + value + "'></param><param name='allowFullScreen' value='false'></param><param name='allowscriptaccess' value='always'></param><param name='enableJavascript' value='true'></param><embed src='" + value + "' type='application/x-shockwave-flash' width='1024' height='600' allowscriptaccess='true' enableJavascript ='true' allowfullscreen='false'></embed></object>"; StringBuilder sb = new StringBuilder(); sb.Append("<div>"); sb.Append("<center>"); sb.Append("<object codebase='http://www.apple.com/qtactivex/qtplugin.cab' WIDTH='800' HEIGHT='600'"); sb.Append("classid='clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B'>"); sb.Append("<param name='src' value='" + value + "' />"); sb.Append("<param name='controller' value='true' />"); sb.Append("<embed src='" + value + "' CONTROLLER='true' WIDTH='800' HEIGHT='600' "); sb.Append("pluginspage='http://www.apple.com/quicktime/download/'></embed>"); sb.Append("</object>"); sb.Append("<div>My Quicktime Movie</div></div>"); sb.Append("</center>"); LtrlVdo.Text = sb.ToString(); }Sohail Shaikh
kapatel18
Member
16 Points
41 Posts
Re: Upload and Play Video
Dec 28, 2012 09:49 AM|LINK
Thank
Let me try...
kapatel18
Member
16 Points
41 Posts
Re: Upload and Play Video
Dec 28, 2012 10:04 AM|LINK
How can i display all uploaded vedios on that page
SohailShaikh
Contributor
6129 Points
1172 Posts
Re: Upload and Play Video
Dec 28, 2012 10:09 AM|LINK
you can use any jquery model popup and load this page in this popup yar now i are behave like child. i think you can do this easily
i think your above question is solve this one is your new problem then post new question
Sohail Shaikh
rimagandhi
Participant
1589 Points
512 Posts
Re: Upload and Play Video
Dec 28, 2012 10:17 AM|LINK
You may also upload the video from that and while showing in listview show it in pop up..
Like this
http://videolightbox.com/iphone-template.html
Regards
Rima Gandhi.
Software Developer.