tags:

views:

46

answers:

1

Hi, I have created a web application in that application i have added two folder. one is admin folder and under admin i have added a upload folder. In upload folder i have three different audio's. And also i have imported DLL for Windows media player. Through this media player im able to play the audios in local host.

By giving Direct path like MediaPlayer1.Filename="C:\User\sam\waka.mp3"

But when i host the website im getting problem the page is getting refreshed but the audio is not getting played. I have tried this path Server.Mappath(".\.\upload\waka.mp3")

and Server.Mappath("~\admin\upload\waka.mp3)

the above both paths are not working when i host the website please reply.

A: 

It's still a bit unclear, but it sounds like there's some kind of audio player in your website (an ActiveX control or something?) that's trying to reference a path on the server as though it were on the client that's loading the page. Naturally, this will work on your development machine because the client and the server are the same thing.

What's actually being rendered on the client side? What happens if you reference the audio file by its URL rather than its file system path?

Or are you trying to do something different than what I describe? Are you actually trying to play the audio on the server when the client accesses the site?

David
Yes you are exactly correct iam using windows media player in my web application trying to play the audio on the server when the client accesses the site.
If the media player is running in the client's browser then Server.Mappath() is definitely not going to help you. That will return the file system path on the server for server-side code. That path will be of no use to anything running on the client. You'll need the URL to the file (preferably relative so the site isn't tied to that particular installation of itself).
David
Thanks very much for your answer but in my application i have directly hard-coded the path like thisMediaPlayer1.Filename="http://easywebsurvey.info/Admin/upload/song.mp"But is there any way to access this audio from my application using Server.Mappath();
If the media player is running on the "client" then "server".Mappath() isn't going to do anything for it.
David
I have uploaded my audio into Database(SQL) and also im able to retrieve the audio (i.e, When i click retrieve button the audio will be downloaded from SQL(database) to desktop) but i dont know how to play this retrieved audio from SQL.
Why serve it from a database? It's a file, and file systems and web servers are very well suited to serve files. Besides, it sounds like you've entirely changed gears on whether you want to stream the file from a website or save it locally. I was under the impression you were attempting the former, so why the change to save it locally to the client instead? Does the media player not recognize a URL for the source of the file?
David
i dont know how to retrieve and play the audio and video from database moreover i want to implement like that please
It sounds like you're stuck on a lot more general design questions than the original question. It might be best to ask new specific questions on this site about places where you're stuck in the design/code.
David
Hi david please check my question regarding execution of time it is taking lot of time i have posted the code too