media player on a asp.net web form [Resolved]

Posted by mpiloadvocate-2219 under C# on 4/28/2011 | Points: 10 | Views : 38308 | Status : [Member] | Replies : 11
i have tried to make my media player work..bt its not working..i used these lines of code only to display the player:

<object height="320px" width="240px" type ="video/x-ms-wmv">
<param name="src" value="http://localhost/Music.wmv" />
</object>

it is only displaying the player..how do i add music with the format of mp3,wav to it.. how do i make to play,select the song from some folder and is this the right player formart for audio player?




Responses

Posted by: Nishithraj on: 4/28/2011 [Member] Bronze | Points: 50

Up
0
Down

Resolved
Try this

<html>
<head>
</head>
<body>
<object classid="clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6" id="Player1" width="424" height="379">
<param name="URL" value="http://localhost/Music.wmv">
<param name="http://path_to_the_video">
<param name="AutoStart" value="1">
<param name="ShowControls" value="1">
<param name="ShowStatusBar" value="1">
<param name="ShowDisplay" value="1">
<param name="stretchToFit" value="1">
<embed type="application/x-mplayer2"
pluginspage="http://www.microsoft.com/Windows/Downloads/Contents/MediaPlayer/"
width="424" height="379" src="http://localhost/Music.wmv"
filename="http://localhost/Music.wmv" autostart="1" showcontrols="1" showstatusbar="1" showdisplay="1">
</embed>
</object>
</body>
</html>


Mark this as answer, if it is.....

With regards
Nishithraj Narayanan

mpiloadvocate-2219, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Nishithraj on: 4/28/2011 [Member] Bronze | Points: 25

Up
0
Down
Can you try this

<html>

<head>
</head>
<body>
<object classid="clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6" id="Player1" width="424" height="379">
<param name="URL" value="C:\WINDOWS\clock.avi">
<param name="http://path_to_the_video">
<param name="AutoStart" value="1">
<param name="ShowControls" value="1">
<param name="ShowStatusBar" value="1">
<param name="ShowDisplay" value="1">
<param name="stretchToFit" value="1">
<embed type="application/x-mplayer2"
pluginspage="http://www.microsoft.com/Windows/Downloads/Contents/MediaPlayer/"
width="424" height="379" src="C:\WINDOWS\clock.avi"
filename="C:\WINDOWS\clock.avi" autostart="1" showcontrols="1" showstatusbar="1" showdisplay="1">
</embed>
</object>
</body>
</html>



Also change the file name to your file name instead of clock.avi in the two places



Mark this as answer, if it is.....

With regards
Nishithraj Narayanan

mpiloadvocate-2219, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: mpiloadvocate-2219 on: 4/28/2011 [Member] Starter | Points: 25

Up
0
Down
thanks a lot but there are three "clock.avi"...which two should i change?...and please would u give me a hint on what should i change "clock.avi" to...?..eg misic.mp3(song or folder) or the actual song name..one more time please Nishithraj

mpiloadvocate-2219, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Nishithraj on: 4/28/2011 [Member] Bronze | Points: 25

Up
0
Down
Sorry for the typo error it's three not two. Change in all the places.

Mark this as answer, if it is.....

With regards
Nishithraj Narayanan

mpiloadvocate-2219, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: mpiloadvocate-2219 on: 4/28/2011 [Member] Starter | Points: 25

Up
0
Down
change them to what exactly? can u give me a HINT please eg from "C:\WINDOWS\clock.avi"> to ="C:\WINDOWS\music.mp3">



mpiloadvocate-2219, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: mpiloadvocate-2219 on: 4/28/2011 [Member] Starter | Points: 25

Up
0
Down
plz can you help one more time than m no more trouble

mpiloadvocate-2219, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: mpiloadvocate-2219 on: 4/28/2011 [Member] Starter | Points: 25

Up
0
Down
thanks Nishithraj....what i dont get now is should i drag the song into the player..bcouse it not doing anything when press play?..when i drag it ,it cut off

mpiloadvocate-2219, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: mpiloadvocate-2219 on: 5/2/2011 [Member] Starter | Points: 25

Up
0
Down
:) i know i troubled u to much...it worked thanx

mpiloadvocate-2219, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sravanthi1 on: 1/19/2012 [Member] Starter | Points: 25

Up
0
Down
Hi Nishithraj

I have a doubt on Video streaming on a web application

it follows the following



1. Any video file in your local system [Can be replaced later with a Video URL from different source]

2. Play that video in a web application [Ex : like youtube]


can you please help on this.

thanks in advance
sravanthi





mpiloadvocate-2219, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Shanish on: 4/4/2012 [Member] Starter | Points: 25

Up
0
Down
thanks for the code nithish raj, i dont want the controls under the video to be displayed, i need to hide the controls and should play the video only, how can I do this......

mpiloadvocate-2219, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Bhatta on: 5/25/2012 [Member] Starter | Points: 25

Up
0
Down
Hi Nishithraj,

In the above code that you've written for playing audio/video files using html, can you tell me how to change the source path dynamically instead of stating 1 path in the code? We have developed a website in asp.net which saves audio/video recordings on the local host. These recordings need to be browsed and played on the website.

Please help at the earliest!!

Thank you!!

mpiloadvocate-2219, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response