|
I tried to upload a video it accept (only MP4 format) but FLV format refuse.
But when I want to play it on a webpage it accept for some video, but other video just make sound but no video.
|
|
|
|
|
Excuse me for the delay to respond.
my problem is: I tried to upload a video it accept (only the MP4 format) but FLV format refuse.
But when I want to play it on a webpage it accept for some video, but other video just make sound but no video. I used the videohandler.ashx file for the video.
what I need is to upload any kind of video if it posible or if it not possible to convert a video in flv before insert it in sql server then show all the video in kind of a playlist so that a user can choose a video to play like in youtube.
I tried this codes but it have some problem Video Uploader Control for SQL Server
Video Uploader Control for SQL Server[^]
|
|
|
|
|
It takes a lot of code to do what you are asking, too much to be able to answer you easily here. You'll need to be more specific as to where exactly you are stuck.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Thank You Ryan,
I want to code which can shows how many time a video was watched.
I'm stuck here:
<asp:Repeater ID="Repeater1" runat="server">
<ItemTemplate>
<object id="player" classid="clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6"
height="170" width="300">
<param name="url" value='<%# "Handler1.ashx?id=" + Eval("ID") %>'/>
<param name="showcontrols" value="true" />
<param name="autostart" value="true" />
</object>
</ItemTemplate>
</asp:Repeater>
I can not see a video in the player
-- modified 11-May-13 15:12pm.
|
|
|
|
|
View Source in the browser and see if the url is getting set correctly.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Thank You Ryan. the URL is getting set correctly but I can't watch any kind of video
here are all steps I tried
A. I use those code for the aspx interface
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="ITube._Default" %>
<%@ Register src="UploadVideo.ascx" tagname="UploadVideo" tagprefix="uc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<uc1:UploadVideo ID="UploadVideo1" runat="server" />
</div>
<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/Artists.aspx">HyperLink</asp:HyperLink>
<asp:HyperLink ID="HyperLink2" runat="server" NavigateUrl="~/test2.aspx">HyperLink</asp:HyperLink>
<br />
<br />
<asp:Button ID="ButtonShowVideo" runat="server" onclick="ButtonShowVideo_Click"
Text="Show Video" />
<br />
<asp:Repeater ID="Repeater1" runat="server">
<ItemTemplate>
<object id="player" classid="clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6"
height="170" width="300">
<param name="url" value='<%# "Handler1.ashx?id=" + Eval("ID") %>'/>
<param name="showcontrols" value="true" />
<param name="autostart" value="true" />
</object>
</ItemTemplate>
</asp:Repeater>
<%--<asp:Repeater ID="Repeater1" runat="server">
<ItemTemplate>
<object id="MediaPlayer" height="200" width="300" classid="CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA6" TYPE="application/x-oleobject">
<%--<param name="FileName" value="video.axd?videoid=MyPostID">
<param name="url" value='<%# "Handler1.ashx?id=" + Eval("ID") %>'/>
<param name="autostart" value="true">
<param name="ShowControls" value="true">
<embed type="application/x-mplayer2" src="video.axd?videoid=MyPostID" name="MediaPlayer"
height="400" width="500" showcontrols="1" showstatusbar="0" showdisplay="0" autostart="1"> </embed>
<%--<object id="player" classid="clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6" height="170" width="300">
<param name="url" value='<%# "Handler1.ashx?id=" + Eval("ID") %>'/>
<param name="showcontrols" value="true" />
<param name="autostart" value="true" />
</object>
</ItemTemplate>
</asp:Repeater>--%>
<%--<asp:Repeater ID="Repeater1" runat="server">
<ItemTemplate>
<u>
<%# Eval("Video_Name") %></u>
<hr />
<a class="player" style="height: 300px; width: 300px; display: block" href='<%# "Handler1.ashx?id=" + Eval("ID") %>'/>
</a>
<%--</ItemTemplate>--%>
<%--<param name="filename" value ="a.MP4"/>
<PARAM name="autostart" VALUE="true"/>
<PARAM name="ShowControls" VALUE="true"/>
<param name="ShowStatusBar" value="true"/>
<PARAM name="ShowDisplay" VALUE="true"/>
</object>
</ItemTemplate>
</asp:Repeater>--%>
<br />
<br />
<br />
<asp:Button ID="ButtonBind" runat="server" onclick="ButtonBind_Click"
Text="Bind" />
<asp:GridView ID="GridView1" runat="server" BackColor="White"
BorderColor="#DEDFDE" BorderStyle="None" BorderWidth="1px" CellPadding="4"
ForeColor="Black" GridLines="Vertical">
<footerstyle backcolor="#CCCC99" />
<rowstyle backcolor="#F7F7DE" />
<Columns>
<asp:templatefield>
<ItemTemplate>
<u>
<%# Eval("Video_Name") %></u>
<hr />
<a class="player" style="height: 300px; width: 300px; display: block" href='<%# "Handler1.ashx?id=" + Eval("ID") %>'/>
</a>
</ItemTemplate>
</asp:templatefield>
</Columns>
<pagerstyle backcolor="#F7F7DE" forecolor="Black" horizontalalign="Right" />
<selectedrowstyle backcolor="#CE5D5A" font-bold="True" forecolor="White" />
<headerstyle backcolor="#6B696B" font-bold="True" forecolor="White" />
<alternatingrowstyle backcolor="White" />
</asp:GridView>
<script src="FlowPlayer/flowplayer-3.2.12.min.js" type="text/javascript"></script>
<script type="text/javascript">
flowplayer("a.player", "FlowPlayer/flowplayer-3.2.16.swf", {
plugins: {
pseudo: { url: "FlowPlayer/flowplayer.pseudostreaming-3.2.12.swf" }
},
clip: { provider: 'pseudo', autoPlay: false},
});
</script>
</form>
</body>
</html>
///////////////////
B. and for the aspx.cs
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.IO;
using System.Data.SqlClient;
namespace ITube
{
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void ButtonShowVideo_Click(object sender, EventArgs e)
{
Repeater1.DataSource = GetSpecificVideo(8);
//the video id (2 is example)
Repeater1.DataBind();
}
protected void ButtonBind_Click(object sender, EventArgs e)
{
GridView1.DataSource = GetVideoInfo();
GridView1.DataBind();
}
private DataTable GetVideoInfo()
{
string connectionString = ConfigurationManager.ConnectionStrings["uploadConnectionString"].ConnectionString;
SqlDataAdapter adapter = new SqlDataAdapter("SELECT * FROM VideoArts", connectionString);
DataTable table = new DataTable();
adapter.Fill(table);
return table;
}
private DataTable GetSpecificVideo(object i)
{
string connectionString = ConfigurationManager.ConnectionStrings["uploadConnectionString"].ConnectionString;
SqlDataAdapter adapter = new SqlDataAdapter("SELECT Video, ID FROM VideoArts WHERE ID = @id", connectionString);
adapter.SelectCommand.Parameters.Add("@id", SqlDbType.Int).Value = (int)i;
DataTable table = new DataTable();
adapter.Fill(table);
return table;
}
}
}
}
C. and for the Handler1.ashx i use those codes
//<%@ WebHandler Language="C#" Class="VideoHandler" %>
using System;
using System.Web;
using System.Data.SqlClient;
using System.Data;
using System.Configuration;
//using System;
//using System.Collections;
//using System.Data;
//using System.Linq;
//using System.Web;
//using System.Web.Services;
//using System.Web.Services.Protocols;
//using System.Xml.Linq;
//using System.Data.SqlClient;
//using System.Configuration;
namespace ITube
{
/// <summary>
/// Summary description for $codebehindclassname$
/// </summary>
//[WebService(Namespace = "http://tempuri.org/")]
//[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class Handler1 : IHttpHandler
{
public void ProcessRequest(HttpContext context)
{
// context.Response.ContentType = "text/plain";
// context.Response.Write("Hello World");
string connectionString = ConfigurationManager.ConnectionStrings["uploadConnectionString"].ConnectionString;
// string connectionString = ConfigurationManager.ConnectionStrings["ConnString"].ConnectionString;
SqlConnection connection = new SqlConnection(connectionString);
SqlCommand cmd = new SqlCommand("SELECT Video, Video_Name" + " FROM VideoArts WHERE ID = @id", connection);
cmd.Parameters.Add("@id", SqlDbType.Int).Value = context.Request.QueryString["id"];
try
{
connection.Open();
SqlDataReader reader = cmd.ExecuteReader(CommandBehavior.Default);
if (reader.HasRows)
{
while (reader.Read())
{
context.Response.ContentType = reader["Video_Name"].ToString();
context.Response.BinaryWrite((byte[])reader["Video"]);
}
}
}
finally
{
connection.Close();
}
}
public bool IsReusable
{
get
{
return true;
}
}
}
}
D. to the upload interface UploadVideo.ascx
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="UploadVideo.ascx.cs" Inherits="ITube.UploadVideo" %>
<head>
<style type="text/css">
.style1
{
width: 100%;
}
</style>
</head>
<table class="style1">
<tr>
<td>
<asp:FileUpload ID="FileUpload1" runat="server" />
</td>
<td>
</td>
</tr>
<tr>
<td>
<asp:Button ID="ButtonUpload" runat="server" onclick="ButtonUpload_Click"
Text="Upload" />
</td>
<td width="50%">
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
</td>
</tr>
</table>
//////////////////////////////////
but when I try to upload a video sometime it accept but for a mp4 video format it refuse
another problem when i want to watch a video, for some videos it just play the sound but no video.
Another thing is it possible that people can see howmany time a video was played on my playlist?
|
|
|
|
|
Hi All,
Is it possible to drag an object from the user's computer and drop it into a webpage using asp.net? I know dragging and dropping of objects into a windows app can be done but I've never seen it done in a web app. Please give an example of how this can be done or point me to a link that might help if you know of any. Thanks in advance for your reply.
|
|
|
|
|
|
Hi, thanks for replying. I've already read that very same article two days ago and it clearly states that the method featured in the article "is not like a Windows application where you can drag files from the user's PC to the application" and that drag drop is limited to the boundaries of the webpage. That means you can not grab something from the user's computer and put it into a webpage using the technique from that article.
modified 9-May-13 6:30am.
|
|
|
|
|
hey, what exactly do you want to do?
|
|
|
|
|
Hi, thanks for replying. I would like to be able to drag objects from my computer into my webpage and then manipulate them. I was able to drag objects from my computer into a windows app but not into a web app.
modified 9-May-13 5:50am.
|
|
|
|
|
Anyone tried the AddSite3 in SmarterStats web services?
it's asking for the LogLocations as ConfigLogLocation[] and I don't know how to pass it using C#.
This is what I am starting with:
AddSite3("statsadmin", "xxxxxxxxx", "usernameHmmm", "userPasswordHmmm", "userFirstName", "userLastName", "localhost", 0, "domainName", "W3Cex",
Technology News @ www.JassimRahma.com
|
|
|
|
|
Hello,
I downloaded and installed the ODAC for 64 bit machine. There were no issues installing, except that you have a to execute a sql file at the end of installation. It is located at
c:\app\<username>\product\11.2.0\client\Asp.net\SQL - Where would I execute this? From DOS prompt?
I added the Oracle.DataAccess.dll to VS 2010. I keep getting this error -
Error 2 Could not load file or assembly 'Oracle.DataAccess, Version=4.112.3.0, Culture=neutral, PublicKeyToken=89b483f429c47342' or one of its dependencies. The system cannot find the file specified. C:\projects\CSCC-DotNet\Web.config 14
any ideas? I did search the web, but with no luck.
Thanks!
|
|
|
|
|
It is telling you it can't find the DLL. On line 14 in your web.config, you're referencing a DLL, and for some reason the runtime system can't find it. Either the assembly is not in the GAC, or the path you specified is wrong. In my Web.config the tag looks like this:
<add assembly="Oracle.DataAccess, Version=4.112.3.0, Culture=neutral, PublicKeyToken=89B483F429C47342"/>
Which suggests the assembly is found in the GAC - which is where the installer should have placed it. This has nothing to do with the SQL scripts, which have probably already been run on your server - they only need to be run once for each server, so if you're the second or later developer to install this, you can skip it.
One way to "reset" VS in terms of finding this assembly is to go into your project property pages, open the "references" and remove the Oracle.DataAccess reference. Then save your project, I usually restart VS, then right-click the bin, choose "Add Reference..." and add the Oracle DLL back in. That should help it find the thing correctly.
If that doesn't work, drop a copy of the Oracle.DataAccess.DLL into the bin.
|
|
|
|
|
When I installed the ODAC componenets for .Net, there was a folder created, in addition to adding the dll to GAC,
C:\app\<username>\product\11.2.0\client_1\odp.net\bin\4\ORacle.DataAccess.dll. I am using this reference in my web site.
Maybe this is the problem. How can I un-reference this one and add this one - C:\Windows\Microsoft.NET\assembly\GAC_64\Oracle.DataAccess\v4.0_4.112.3.0__89b483f429c47342\ORacle.DataAccess.dll??
In m web.config file, there is the same listing
<assemblies>
<add assembly="Oracle.DataAccess, Version=4.112.3.0, Culture=neutral, PublicKeyToken=89B483F429C47342"/>
</assemblies>
Thanks so much for your help!!
|
|
|
|
|
I think you can do the swap with the references window in your project properties. I just checked my site, and I'm using the "DLL in the bin folder" method. I don't remember why, but I think it's because the locations are different in the server.
|
|
|
|
|
I need to generate a PDF report which contains some images, costume text info, and a table from my ASP.net MVC3 application. please give me any ideas on the best way to implement this?
|
|
|
|
|
hi all ,
Tracing web application with ASP.NET[^]
Tracing Methods
•
On the Page
When this method is used, the trace output is displayed on the page that is executed.
•
Out of Page
In this method, the tracing results are not displayed on the page but these are stored on the web server and in the root folder of the application in a file named as “trace.axd”. After execution of the pages, this file can be viewed on the browser.
“trace.axd”.-----here what is the expansion of axd...
|
|
|
|
|
Is there something troubling you? I don't see a question here. Can you rephrase and elaborate on what are you trying to ask?
|
|
|
|
|
hi,
what i mean is user control page has extension as .ascx---here the expansion of ascx is "active server control extension"
along the same lines .asax ----the expansion of asax is "active server application extension".
in the same manner just i wanna know the expansin of axd in tracefilename.axd
usually trace files have .axd extension
i googled it but i am unable to find the answer.ie y i asked in this blog....
|
|
|
|
|
I have a problem with using grideview to display data
I don't want to use Default display in gridview.
For example
-------------------------
Image1 Title="###" |
Date="###" |
Price="###" |
-------------------------|
Please all friends help me to solve this in asp.net
Please kindly to email to me by polen.lang@gmail.com
|
|
|
|
|
|
<asp:GridView ID="GridView1" runat="server">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Image ID="img1" runat="server" ImageUrl='<%#Eval("imageUrlFielName") %>' />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
|
|
|
|
|
create a generic handler file e.g.-> showpic.ashx
with code
<%@ WebHandler Language="C#" Class="showpic" %>
using System;
using System.Web;
using System.Data.SqlClient;
using System.Data;
using System.IO;
using System.Collections.Specialized;
public class showpic: IHttpHandler {
public string GetConnectionString()
{
return System.Configuration.ConfigurationManager.ConnectionStrings["b4mConnectionString"].ConnectionString;
}
public void ProcessRequest(HttpContext context)
{
string id = context.Request.QueryString["id"];
string img = context.Request.QueryString["img"];
if (id != null)
{
try
{
MemoryStream memoryStream = new MemoryStream();
SqlConnection connection = new SqlConnection(GetConnectionString());
string sql = "SELECT " + img + " FROM useraccount WHERE userid= @id";
SqlCommand cmd = new SqlCommand(sql, connection);
cmd.Parameters.AddWithValue("@id", id);
connection.Open();
SqlDataReader reader = cmd.ExecuteReader();
reader.Read();
byte[] file = (byte[])reader[0];
reader.Close();
connection.Close();
memoryStream.Write(file, 0, file.Length);
context.Response.Buffer = true;
context.Response.BinaryWrite(file);
memoryStream.Dispose();
}
catch
{
}
}
}
public bool IsReusable {
get {
return false;
}
}
}
change the database & query parameters
within the gridview create a templated field with Image control
In Image Url property set the following code
'<%# "generics/showpic.ashx?id="+Eval("userid")+"&img=picture" %>'
e.g-> <asp:Image ID="Image1" runat="server" Height="60px"
ImageUrl='<%# "generics/showpic.ashx?id="+Eval("userid")+"&img=picture" %>'
Width="60px" />
change as per your database configuration.
now you will be able to show picture in gridview
Regards
Bikash
|
|
|
|
|
Hi,
I want to ask what's the best way yo have a development environment and move it easily to the production?
Technology News @ www.JassimRahma.com
|
|
|
|