Clicking on a radio station that resides in an ap div using href, I need to be able to have them play om a Media Player applet inside an ap Div

For the Experts,

I am trying to make a web page, where I can click on a link and it will play withing a media player applet on the web page.  I can do the initial with no problem, playing when the page opens, but when I click on another radio station, it is opening outside the web page and into real player.

I am also trying to make my own Play, Pause and Stop buttons because I will keep the control bar hidden.

Any help you can give would be greatly appreciated and any information needed, please let me know.

Thanks in advance.
<body>
<div id="player1">
  <object id="musicplayer" classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" name="MusicPlayer" width="750" height="425" title="MusicPlayer">
    <PARAM NAME="URL" VALUE="http://www.orsradio.com/wma/80s.asx">
	<PARAM NAME="SendPlayStateChangeEvents" VALUE="True">
	<PARAM NAME="AutoStart" VALUE="True">
	<PARAM name="uiMode" value="none">
	<PARAM name="PlayCount" value="9999">
 
  </object>
</div>
<div id="clips">
  Action<br><br>
  <a href="http://uni4.sa.streamaudio.com/KIXQ_FM">KIXQ FM</a><br>
</div>
<div id="Screen"></div>
<div id="StopMe" onmousedown="stopmovie()"></div>
<div id="pauseme" onmousedown="pausemovie()"></div>
<div id="playme" onmousedown="playmovie()"></div>
<script>
	var links = document.getElementById("clips").getElementsByTagName("a"); 
	for (var i = 0; i < links.length; i++) { 
    links[i].onclick = function() { 
	var MC = document.getElementById("MusicPlayer");
	MC.URL(his.getAttribute("href", 2));
    }; 
};
</script>
<script>
function stopmovie() {
	var MC = document.getElementsByName("MusicPlayer");
	MC.stop
};
function pausemovie() {
	var MC = document.getElementsByName("MusicPlayer");
	MC.pause
};
function playmovie() {
	var MC = document.getElementsByName("MusicPlayer");
	MC.play
};
</script>
</body>

Open in new window

corterpAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

selvolCommented:
I don't use Real Player.

But I thought I'd toss this out.  Could not test this.....APologies

Have you Tried    <a href="http://uni4.sa.streamaudio.com/KIXQ_FM" target="_self"> KIXQ FM</a>
OR <a href="http://uni4.sa.streamaudio.com/KIXQ_FM target="musicplayer" >KIXQ FM</a>

Here are some more param"s..

<param name="AllowChangeDisplaySize" value="0">
<param name="AutoRewind" value="1">
<param name="Autosize" value="1">
<param name="AutoStart" value="1">
<param name="Balance" value="0">
<param name="BufferingTime" value="3">
<param name="ClickToPlay" value="1">
<param name="DisplaySize" value="4">
<param name="EnableContextMenu" value="1">
<param name="EnableFullScreenControls" value="1">
<param name="EnableTracker" value="1">
<param name="Filename" value="crystalvid04.wmv">
<param name="Mute" value="0">
<param name="PlayCount" value="1">
<param name="ShowControls" value="1">
<param name="ShowAudioControls" value="1">
<param name="ShowDisplay" value="0">
<param name="ShowGotoBar" value="0">
<param name="ShowPositionControls" value="0">
<param name="ShowStatusBar" value="0">
<param name="ShowTracker" value="1">
<param name="VideoBorderColor" value="0">
<param name="VideoBorderWidth" value="0">
<param name="Volume" value="-500">
0
corterpAuthor Commented:
Thanks for the info selvol,

I do not want to use real player, the applet within the web page is a Media Player Applet.

I tried what you suggest but

<a href="http://uni4.sa.streamaudio.com/KIXQ_FM" target="_self"> KIXQ FM</a>
Opened up in real player outside my web page.  Real player is the default player.

and

<a href="http://uni4.sa.streamaudio.com/KIXQ_FM target="musicplayer" >KIXQ FM</a>
Opened another page and then closed it, opened Real Player and started playing.

MusicPlayer, is the Media Player Applet sits inside an apDiv called player1.  What I need is for when they click on the radio station, it changes the URL parameter of MusicPlayer and replaces what is already playing.

Also I need to find a ways to Play/Pause/Stop the MusicPlayer from buttons outside it's control bar.

Thanks
0
selvolCommented:
<OBJECT ID="MediaPlayer1" CLASSID="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95"
CODEBASE="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab# Version=5,1,52,701"
STANDBY="Loading Microsoft Windows® Media Player components..." TYPE="application/x-oleobject" width="280"
height="300">
<param name="fileName" value="a.asx">
<param name="animationatStart" value="true">
<param name="transparentatStart" value="true">
<param name="autoStart" value="true">
<param name="showControls" value="true">
<param name="Volume" value="-300">
<embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/"

src="http://www.mywebsite.org/file.m3u" name="MediaPlayer1" width=280 height=46 autostart=1 showcontrols=1

volume=-300>
</OBJECT>


Here's the a.apx

<ASX VERSION = "3.0"><TITLE>Title</TITLE>
<ENTRY>      <REF HREF = "http://www.orsradio.com/wma/80s.asx" />   </ENTRY>

<ENTRY>      <REF HREF = "http://www.streamaudio.com/stations/asx/WSB_AM.asx"/>   </ENTRY>
</ASX>
0
Build an E-Commerce Site with Angular 5

Learn how to build an E-Commerce site with Angular 5, a JavaScript framework used by developers to build web, desktop, and mobile applications.

selvolCommented:
I ment the a.asx


I attached the a.asx

Regards.

Hope this helps some what,,
0
corterpAuthor Commented:
I am sorry selvol,

Will that work on a Linux Server?

Thanks
0
corterpAuthor Commented:
I am able to send the file name when I click the link using

var links = document.getElementById("clips").getElementsByTagName("a");
// loop those links and alter their click behaviour
for (var i = 0; i < links.length; i++) {
    links[i].onclick = function() {
        // play the clip specified in href- attribute
document.musicplayer.filename = (this.getAttribute("href", 2));
document.musicplayer.scr = (this.getAttribute("href", 2));
document.musicplayer.play();

But what happens is it stops the music playing in music player, then loads up Real Player outside the web page and plays it.

I would prefer it to be in the musicplayer playing.

Thanks
0
selvolCommented:
The code I sent you will work on a linux server. As if were Html...
I did not have any problem changing the channel between the two stations in th a.apx file.
With the player staying on the page.

Possible unistall RPlayer???


I am on XP IE 8.


Hope it all works out for you.

I'll check back is a bit,


Regards

0
corterpAuthor Commented:
Okay,

Not to smart on this, is a.asx a separate file?

Thanks
0
corterpAuthor Commented:
I made it into a separate file but all I get is the player on screen
0
selvolCommented:
Apologie... Did not mean to leave you hanging;....
a is seperate,...
WOrkin on answer NOW and finished example....
0
corterpAuthor Commented:
selvol,

I thought it was working, but when I click on the link it is just opening, it is not running the script as it should.

I can not make a function with the script because then the whole div becomes clickable.

Getting really stuck and thank you for your help on this.
0
selvolCommented:
Can you send me the html for the layout of the page....

Or the exact stations you want.....


Is the page up yet? If so where is it??


@asu.edu <-second..

Swilli19       <---this first  
0
selvolCommented:
Hope this helps...
0
selvolCommented:
Here.
0
corterpAuthor Commented:
selvol,

I sent you the html file to your email address.

Thanks
0
selvolCommented:

<OBJECT ID="MediaPlayer1" CLASSID="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95"
CODEBASE="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab# Version=5,1,52,701"
STANDBY="Loading Microsoft Windows® Media Player components..." TYPE="application/x-oleobject" width="280"
height="300">
<param name="fileName" value="a.asx">
<param name="animationatStart" value="true">
<param name="transparentatStart" value="true">
<param name="autoStart" value="true">
<param name="showControls" value="true">
<param name="Volume" value="-300">
<embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/"
 
src="http://www.mywebsite.org/file.m3u" name="MediaPlayer1" width=280 height=46 autostart=1 showcontrols=1
 
volume=-300>
</OBJECT>
 
 
Here's the a.apx
 
<ASX VERSION = "3.0"><TITLE>Title</TITLE>
<ENTRY>      <REF HREF = "http://www.orsradio.com/wma/80s.asx" />   </ENTRY>
 
<ENTRY>      <REF HREF = "http://www.streamaudio.com/stations/asx/WSB_AM.asx"/>   </ENTRY>
</ASX>

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
corterpAuthor Commented:
Thank you for all your help, I have been gone for a while.
I will email you with what I found.

Thanks
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Digital Audio

From novice to tech pro — start learning today.