473,322 Members | 1,494 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Problem with media player

12
Hi, my media player is not working i have imported dll of windows player. And i have a folder name called upload in my application itself.In the first button i will upload the audio and in the second button im getting the filename using session and using it in the second button when ever i click second button media player is getting disappeared and im getting the fullpath with filename in the second button dont know why media player getting disappeared and i want this website too host also please help its very urgent.


Expand|Select|Wrap|Line Numbers
  1. protected void Button1_Click(object sender, EventArgs e)
  2. {
  3.     string sr = Server.MapPath("./upload/");
  4.     if (FileUpload1.HasFile)
  5.         try
  6.         {
  7.             FileUpload1.SaveAs(Server.MapPath("./upload/") +
  8.                  FileUpload1.FileName);
  9.             Label1.Text = "File name: " +
  10.                  FileUpload1.PostedFile.FileName + "<br>" +
  11.                  FileUpload1.PostedFile.ContentLength + " kb<br>" +
  12.                  "Content type: " +
  13.                  FileUpload1.PostedFile.ContentType;
  14.             Session["v"] = FileUpload1.PostedFile.FileName;
  15.         }
  16.         catch (Exception ex)
  17.         {
  18.             Label1.Text = "ERROR: " + ex.Message.ToString();
  19.         }
  20.     else
  21.     {
  22.         Label1.Text = "You have not specified a file.";
  23.     }
  24. }
  25. protected void Button2_Click(object sender, EventArgs e)
  26. {
  27.     string dr1 = Session["v"].ToString();
  28.     string dr2 = Server.MapPath("./upload/" + dr1);
  29.     MediaPlayer1.Filename = dr2;
  30. }
  31.  
Sep 15 '10 #1
12 1400
Frinavale
9,735 Expert Mod 8TB
Um, Is this an ASP.NET application?

If it is...do your realize that your C# code is executed on the Server?

-Frinny
Sep 15 '10 #2
vj4u
12
yes please it is asp.net application i can execute this in my local system but i belive that it may not work when i host the web site please help it is very urgent
Sep 15 '10 #3
Plater
7,872 Expert 4TB
Find a free media player flash object (there must be dozens by now) and use that.
Or is that what MediaPlayer1 is? It needs to be a web object, and your files need to be available from the website on the clients machine, not just on the backend
Sep 15 '10 #4
This is not going to work. I assume media player is the windows media player activex control running on the server.

The client needs to watch the video on the browser. I guess using windows media player is what you want to do. You can use an object tag with the windows media player class id. You must specify the filename and this must be something that is being served from a web server the client can access. More info on the w3c schools page.

<object
classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95">
<param name="FileName" value="http://mywebsite/mymove.avi" />
</object>

http://www.w3schools.com/media/media_playerref.asp
Sep 22 '10 #5
Frinavale
9,735 Expert Mod 8TB
Media player is only available in Windows; however, people using the website may not be using the Windows Operating system.

I would load the file into an iframe and let the browser determine how to display it.

-Frinny
Sep 22 '10 #6
The browser cannot just determine how to play it. In HTL5 there is the new video element. Otherwise you need to use something to play the video in a browser.
Sep 22 '10 #7
Frinavale
9,735 Expert Mod 8TB
Please note that at this time HTML5 is not support by all major browsers.

I still think that, right now, it's a good idea to use the iframe technique.

-Frinny
Sep 22 '10 #8
Can you provide an example of playing a video with just an iframe? As far as I know you need some kind of pluggin to play the video in a browser. Flash, windows media player activex control, silverlight, etc. An Iframe is just used to nest another documents with different uris in a single window.

If working in other OS besides windows is important than probably a silverlight or flash video player would be what you need.

Like I said the new video tag in HTML5 is going to eliminate the need for an external plugin to play video. But until then we need to use some kind of plugin for video.
Sep 23 '10 #9
Frinavale
9,735 Expert Mod 8TB
Silverlight might be a good idea...except that I can't get it to work on my iPod Touch.

It's really easy, have the iframe's src point to the video that you want to play. The web browser will use the appropriate plugin to open and display the video. If there is no plugin, then it will let the users save the file and decide how to open it using applications installed on the computer (well, I'm not sure how mobile browsers will handle this...)

-Frinny
Sep 23 '10 #10
Again can you point me to an example.

The only thing I can find is this they use object element inside an iframe.
http://nunzioweb.com/misc/movies/ifr...ed_example.htm


I am pretty sure it will just open the file. It will not play in the browser.

I made a little test and tried in firefox and IE and it doesnt work.

<html>
<body>
<IFRAME src="http://nunzioweb.com/misc/wacky/Dogsmoke.mpg" width="280" height="256" scrolling="no"
frameborder="0"></IFRAME>
</body>
</html>
Sep 23 '10 #11
Frinavale
9,735 Expert Mod 8TB
Do you have a plugin for the browser that will play .mpg files?
Sep 24 '10 #12
I a on a Windows machine so obviously yes. Sorry Frinavale it seems like I offended you. I was not trying to be rude.

Can you please provide a working example though or a link to some documentation or blog confirming this. Object tags are used to plugins as far as I know. If there is another way I would love to learn. Please provide the information.
Sep 24 '10 #13

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Anise | last post by:
I have a question concerning embedding a windows media player into a web application in .net.. I download Windows Media Player 10 and its SDK On the .ascx page I placed a windows media player...
1
by: Stephen Adam | last post by:
Hi there, Have spent a while trying to find out how to connect to Windows Media Player through COM. Unfortunately there doesnt seem to be much stuff about it on the web. What I need to do is...
1
by: sri2097 | last post by:
Basically, I want to check if a URL is playable or not (without actually playing it). i.e. given a URL I want to write an automation script to figure it out for me if it's playable or not. If...
19
by: Tony | last post by:
I'm working on project that plays movies using Windows Media Player and I'm controlling everything with JavaScript. Per the client I only need to support IE 6 or greater which happens to make...
2
riptide2049
by: riptide2049 | last post by:
I really have a problem here. I have a code that is suppost to take the href of a link from the right class;value of a link maked toreturn false. the value is a Media file the file is sent to...
1
by: xhunter | last post by:
I am streaming some files on my site (progressive http streaming), I use php to authenticate logged in users with sessions and cookies, and then send the stream to be opened. All my Quicktime...
6
by: xhunter | last post by:
I have this problem on my website and no matter what I have not been able to get over it, it is really getting on my nervers. it's a problem that only exists in non IE browsers. the frame work...
3
by: =?Utf-8?B?U3VzYW4=?= | last post by:
I have a tool that uses the Windows Media Player to display certain products to users. It works great on my machine, but I am having great difficulty on one of the "product" machines. To help find...
5
by: Fred Chateau | last post by:
I am currently using an Object element of type "application/x-mplayer2" to create a media player in ASP.NET 3.5, and was wondering if there is a better way to instantiate WMP in a browser. I'm...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.