forum.coppermine-gallery.net

No Support => Modifications/Add-Ons/Hacks => Mods: Miscellaneous => Topic started by: rphMedia on October 23, 2004, 06:27:44 pm

Title: Music for your site
Post by: rphMedia on October 23, 2004, 06:27:44 pm
OK, here's a trick if you want music at your Coppermine Gallery.  I see many, many posts by users who are struggling with this one.  It's so simple, it's not even funny :) and this is really not that invasive (later I will try to create a dhtml to open and close the player [window]).

Put your start page in an iframe.  Here's the basic code, you can play with all the parameters to get it to where you want it.  Mine's pointing to a new age streaming radio station on the net (nice for viewing images anyway).

Code: [Select]
<html>
<head>
<title>Online Photo Album</title>
<link rel="stylesheet" href="themes/yourtheme/style.css" />
</head>
<body bgcolor="#000000" topmargin="0" leftmargin="0" scroll="no">
<div align="center">
<table width="100%" height="90%">
<tr>
<td align="center">
<iframe src="index.php" width="100%" height="100%" frameborder="0" ALLOWTRANSPARENCY="true" scrolling="auto" name="myInlineFrame">
Your browser doesn't seem to support "frames"</iframe>
</td>
</tr>
</table>
<object classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" id="WMP1" Style="border-style: none; border-width: 0; margin: 0" width="100%" height="60">
<param name="URL" value="yourmusic.mp3">
<param name="AutoStart"    value=false>
<param name="AutoRewind"   value=true>
</object>
</div>
</body>

Name it index.htm and you can still access your gallery with a folder. This is simply embedding the WMP ActiveX control below the iFrame.  Now, when your vistor navigates around your gallery, the music continues throughout and of course, they can stop/pause anytime.  Your visitor has the option to play music (or not) upon arrival.  I personally wouldn't want it to start auto, though it can be done by changing that parameter.  And it doesn't have to be on the bottom; I thought mine looked better this way. The music itself could be a playlist, one file, or a url to streaming media (lots of them out there).  I hope you find this useful - enjoy!




Title: Re: Music for your site
Post by: hama on November 18, 2004, 10:14:46 pm

Nice trick! At the moment I listen to the sound of your website ...

Some questions:

What about more than one mp3?

How can I point to a radio station of my choice? For example http://www.radiopilatus.ch/sound/low.asx.

What about two radio stations?

How can I build in "your trick"? Do I have to change the index.php or something else? Sorry, I'm a php-beginner ...  ::)

My gallery: http://www.dorfschule.ch/copper/index.php

Title: Re: Music for your site
Post by: hama on November 18, 2004, 10:36:15 pm

My gallery has also sound but with another solution, 'poubao' gave me the code.

-->  http://www.dorfschule.ch/copper/displayimage.php?album=48&pid=5420&slideshow=5000  -->  Sound ...

But your solution with radio stations ... sounds very good ...   8)

Do I have to change your code like that:

<param name="URL" value="yourmusic.mp3">  -->  <param name="URL" value="http://www.radiopilatus.ch/sound/low.asx">

Title: Re: Music for your site
Post by: rphMedia on November 18, 2004, 11:05:01 pm
Yes hama, you're exactly right as far as using the radio station URL.

As far as how you implement, your gallery is in a folder and your start page is index.php.....take that code above, puit it in Notepad, edit your particulars (theme, add your radio station URL) and that's it.  Save it as index.htm and put it in the same directory.  Your server should default to the index.htm file auto (unless you've manually configured otherwise).  Just put your link like so

My gallery: http://www.dorfschule.ch/copper/

Same as:  http://www.dorfschule.ch/copper/index.htm

Understand that search engines get confused with iFrames.  So you'd have to configure your meta tags and indexes differntly if you're concerned with that.   
Title: Re: Music for your site
Post by: hama on November 19, 2004, 01:16:46 am

Thanks, I did it and it works with "Radio Pilatus".

I think it would be very difficult to change between to radio stations or between some mp3's and one or two radio stations ...

Or do you know a solution?

The gallery is now in a frame. Is it possible to set the frame border to real 0? At the moment there is a little bit space ...

--> http://www.dorfschule.ch/copper/index.htm (I will change the menu-links on the top later.)

Anyway, thanks for the great music-trick!

hama
Title: Re: Music for your site
Post by: rphMedia on November 19, 2004, 12:24:06 pm
Yeah, a dropdown (or something to that effect) would be nice to pass to the iframe.  I'm sure it can be done, haven't tackled that yet.  Your site looks good as far as border (using IE) - you may have fixed it.  You could also try frameborder="0px".   Although, I haven't tried that either. Glad you liked it  ;D More stuff to come.
Title: Re: Music for your site
Post by: Justttt on November 19, 2004, 12:32:25 pm
your scipt looks great i would love to use it but my browser dose not support iframes i did when i first got it sorry if this is a bit off topic but do you no how to turn iframes on because i would like to use you scirpt
Title: Re: Music for your site
Post by: kiig on November 19, 2004, 12:43:39 pm
Thanx rphMedia.. worked just out of the box :-)

I didn't want the 'player' part at the bottom of the windows, - so changing the width and height of the 'player-part' of your script (to 0)  keeps the music, - but basically removes the player. I just wanted it to produce a non-looping sound at startup, - and it did.

Thanx, once again.

Kim Igel.
Title: Re: Music for your site
Post by: rphMedia on November 19, 2004, 01:20:19 pm
Justttt, what browser are you using?

And Kim, neat trick :)  But be aware that some people don't like music (uncontrolled) on a site.  It used to be an amazement, but nowadays, it drives users away, especially if it's a large audio file.  Just something to think about - alwayz give the option.  You could make that thing as small as a mere non-obtrusive "play" button in a corner someplace for control.  Totally up to you though.
Title: Re: Music for your site
Post by: kiig on November 19, 2004, 01:35:15 pm
yeah, - I don't like it either, - but it's for a site I did way back for selling used cars and they'd like a 10 second V8 engine intro sound.... so before visitors realise it has no play-control buttons, - the sound will be gone.... But I do agree with you.
Title: Re: Music for your site
Post by: hama on November 19, 2004, 02:06:02 pm

Quote
Yeah, a dropdown (or something to that effect) would be nice to pass to the iframe.  I'm sure it can be done, haven't tackled that yet.

That would be nice. 50% player at left bottom / 50% dropdown box at right bottom with different radio stations.  8)

One idea I have is to put some links in anycontent.php, for example:

--> Start gallery with radio 1
--> Start gallery with radio 2
--> Start gallery with mp3-1
--> Start gallery with mp3-2
--> ...

I know it's a "beginner idea" but changing rphMedia's code is something for profs.  :-\\
Title: Re: Music for your site
Post by: hama on November 25, 2004, 02:44:50 pm

I found another solution for the "music-anycontent.php".

It needs two files, anycontent2.php and player.php.

It works on my website (except two litte problems). --> http://www.dorfschule.ch/copper/index.php --> ("Sound :-)", at the bottom)

P1: At the moment it doesn't run with firefox.

P2: After choosing a radio station the website is in a frame and I have a little black space at right and at the bottom. After a refresh the space disappears.

These are the two scripts (maybe you find something to modificate):

anycontent2.php:

Code: [Select]
<?php

// ------------------------------------------------------------------------- //
// Coppermine Photo Gallery 1.3.0                                            //
// ------------------------------------------------------------------------- //
// Copyright (C) 2002,2003 Gregory DEMAR                                     //
// http://www.chezgreg.net/coppermine/                                       //
// ------------------------------------------------------------------------- //
// Updated by the Coppermine Dev Team                                        //
// see /docs/credits.html for details                                        //
// ------------------------------------------------------------------------- //
// This program is free software; you can redistribute it and/or modify      //
// it under the terms of the GNU General Public License as published by      //
// the Free Software Foundation; either version 2 of the License, or         //
// (at your option) any later version.                                       //
// ------------------------------------------------------------------------- //

/*
$Id: anycontent.php,v 1.7 2004/03/16 09:26:18 gaugau Exp $
*/

starttable("100%""Sound :-)"2);

echo 
"<tr><td class='tableb' colspan='2' align='center'><br><b>Ein bisschen Sound gefällig? Wähle deinen Sender und geniess es (eignet sich nur für TEP oder ADSL). - Viel Vergnügen!</b></br><br>";
echo 
"</td></tr>";
echo 
"<tr><td class='tableb' width='50%' align='center'><br>";
echo 
"<form action='player.php' method='post' target='_top'>";
echo 
"<select size='1' name='radiostation'>";
echo 
"<option selected>Bitte wählen ...</option>";

echo 
"<option value='http://windowsmedia.tiscali.ch/Radio105'>Radio 105 (Schweiz, 40 KBit/s)</option>";
echo 
"<option value='http://www.green-production.ch/asx/webradio_radio24.asx'>Radio 24 (Schweiz, 64 KBit/s)</option>";
echo 
"<option value='http://mediaserver1.3fach.ch/3FACH-Live'>Radio 3FACH (Schweiz, 128 KBit/s)</option>";
echo 
"<option value='http://www.surfmusik.de/radios/discoradiofmm.htm'>Radio Disco (Italien, 20 KBit/s)</option>";
echo 
"<option value='http://wms01.green.ch/djradio'>Radio DJ (Schweiz, 64 KBit/s)</option>";
echo 
"<option value='http://asx.skypro.tv/asx/radio-drs/drs1.asx'>Radio DRS 1 (Schweiz, 40 KBit/s)</option>";
echo 
"<option value='http://asx.skypro.tv/asx/radio-drs/drs3.asx'>Radio DRS 3 (Schweiz, 40 KBit/s)</option>";
echo 
"<option value='http://www.tv-radio.com/ondemand/rfi/mere/francais/../../../../station/rfi/rfi-20k.asx'>Radio France (Frankreich, 20 KBit/s)</option>";
echo 
"<option value='http://www.web-radio.com/stream.cfm?id=11489'>Radio Groove (USA, 32 KBit/s)</option>";
echo 
"<option value='http://www.radio-kosova.com/playlist/play.asx'>Radio Kosova (Kosova, 24 KBit/s)</option>";
echo 
"<option value='mms://stream2.orf.at/oe3_live'>Radio Ö3 (Österreich, 31 KBit/s)</option>";
echo 
"<option value='http://www.radiopilatus.ch/sound/high.asx'>Radio Pilatus (Schweiz, 48 KBit/s)</option>";
echo 
"<option value='http://sunshine.stream.green.ch/sunshine.wax'>Radio Sunshine (Schweiz, 40 KBit/s)</option>";
echo 
"<option value='http://lsd.newmedia.tiscali-business.com/bb/redirect.lsc?stream=swr3/livestream.wma&content=live&media=ms'>Radio SWR3 (Deutschland, 20 KBit/s)</option>";
echo 
"<option value='http://asx.skypro.tv/asx/radio-drs/virus.asx'>Radio Virus (Schweiz, 40 KBit/s)</option>";
echo 
"</select>&nbsp;<input type='submit' value='Und los!' name='Und los!'>";

echo 
"</form>";
echo 
"</td>";
echo 
"<td class='tableb' width='50%' align='center'><br>";
echo 
"<form action='player.php' method='post' target='_top'>";
echo 
"<select size='1' name='radiostation'>";
echo 
"<option selected>Bitte wählen ...</option>";

echo 
"<option value='http://xy.xy'>Air (128 KBit's)</option>";
echo 
"<option value='http://xy.xy'>B52's (128 KBit's)</option>";
echo 
"<option value='http://xy.xy'>Dire Straits (128 KBit's)</option>";
echo 
"<option value='http://xy.xy'>Saltimbanco (128 KBit's)</option>";
echo 
"<option value='http://xy.xy'>Züri West (128 KBit's)</option>";

echo 
"</select>&nbsp;<input type='submit' value='Und los!' name='Und los!'>";
echo 
"</form>";
echo 
"</td></tr>";

endtable();

?>


player.php:

Code: [Select]
<?php

echo "<html>";
echo 
"<head>";
echo 
"<title>OST-Gallery</title>";
#echo "<link rel='stylesheet' href='themes/default/style.css'>";
echo "</head>";
echo 
"<body bgcolor='#000000' marginwidth='0' marginleft='0' topmargin='0' leftmargin='0'>";
echo 
"<div align='center'>";
echo 
"<table width='100%' height='92%' cellspacing='0' cellpading='0'>";
echo 
"<tr>";
echo 
"<td>";
echo 
"<iframe src='index.php' width='100%' height='100%' frameborder='0' scrolling='auto' name='myInlineFrame'>Your browser doesn't seem to support 'frames'</iframe>";
echo 
"</td>";
echo 
"</tr>";
echo 
"</table>";
echo 
"<object id='mediaPlayer' classid='CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95' align='center' codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715' standby='Loading Microsoft Windows Media Player components...' type='application/x-oleobject' viewastext width='100%' height='67'>";
echo 
"<param name='loop' value='true'>";
echo 
"<param name='FileName' value='$radiostation'>";
echo 
"<param name='ShowStatusBar' value='true'>";
echo 
"<param name='animationatStart' value='false'>";
echo 
"<param name='transparentatStart' value='false'>";
echo 
"<param name='autoStart' value='true'>";
echo 
"<param name='showControls' value='true'>";
echo 
"<param name='volume' value='-200'>";
#echo "<object classid='CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6' id='WMP1' Style='border-style: none; border-width: 0; margin: 0' width='100%' height='60'>";
#echo "<param name='URL' value='$radiostation'>";
#echo "<param name='AutoStart' value=false>";
#echo "<param name='AutoRewind' value=true>";
echo "</object>";
echo 
"</div>";
echo 
"</body>";
echo 
"</html>";
?>

Title: Re: Music for your site
Post by: hama on November 25, 2004, 02:50:25 pm

a little preview ...
Title: Re: Music for your site
Post by: rphMedia on November 25, 2004, 02:59:16 pm
hama,

Remove the scrollbar from the body of player.php (scroll="no"), it's not needed and may correct the "refresh" problem  :)

Excellent work!
Title: Re: Music for your site
Post by: hama on November 25, 2004, 03:13:44 pm

Removing the scrollbar doesn't help.

Code: [Select]
"<iframe src='index.php' width='100%' height='100%' frameborder='0' scroll='no' name='myInlineFrame'>Your browser doesn't seem to support 'frames'</iframe>";

Here's a printscreen of my problem:
Title: Re: Music for your site
Post by: rphMedia on November 25, 2004, 03:21:31 pm
No, remove the scroll from the body tag in the page, not the iFrame.
Title: Re: Music for your site
Post by: hama on November 25, 2004, 09:45:56 pm

This solution works for the gallery part. For the other parts of my website (Home/Forum/News/...) the design problem is still there from the moment I start the player.

But I think this isn't a problem we can discuss in this forum.

So thank you for the help and have a good time.  :)

hama
Title: Re: Music for your site
Post by: itrends on November 27, 2004, 03:42:34 pm
hey all, thought you may be interested in my implementation of a music player which works on the entire site

Simply have a link that reloads the site into a frame set which contains the player.

This means that you can use the site as normal and still have the music playing

Also means that you wont upset the search engines as you have to actually click and load the frameset, leaving the rest of the pages un affected.

I am working on the player to use more formats instead of just WM so i can use realplayer etc.

Also plan to make the played look much neater, this is just a rough implementation at the moment.

The entire site is currently UNDER CONSTRUCTION!!!! here: http://www.seekoutproperty.com/

And once complete will be made live on here: http://www.sunnymonkey.com, http://www.sunnymonkey.co.uk, and http://www.uk-nightclubs.co.uk

So you should be able to find it on at least one of those addresses :-)

Let me know what you think, I know it is very simple, but it works. :-)

Oh and check out the gallery as I am modifying that quite a bit as well, so stick some music on and browse the site :-)

Look forward to your comments

TFFN
Dave

Title: Re: Music for your site
Post by: hama on November 27, 2004, 04:25:08 pm

That's a good idea and works fine!  :)

The only problem is that with your solution I have to reconstruct my whole website.  :-\\

First I'll try to solve my frameborder problem. If I can't I'll take your one.

P.S.: I'm happy that you inserted swiss radio stations into your uk clubbing information hub ...  ;)

hama
Title: Re: Music for your site
Post by: itrends on November 27, 2004, 04:34:28 pm
You sure you have to reconstruct? I wouldnt have thought you needed too >? maybe a few small mods? Anywho, you know better than me, its your site afterall :-)

I have left the stations in there as I am listening to them, and even though the HUB is uk oriented, music itself is worldwide :-) Variety is the spice of life etc :-)

Anyway, glad you like it, bit of a way to go before the site is complete, but I have done all that you see in just 1 day (I started yesterday) so i hope it wont take long until completion.

I also have a much larger collection of images, nights out, categories etc, but that will not be imported until I make the site live :-)

Again, thanks for the comments and I hope that this all evolves well with the coming future ;-)
Title: Re: Music for your site
Post by: hama on November 27, 2004, 04:45:29 pm

Quote
music itself is worldwide :-) Variety is the spice of life etc :-)

Yes, that's right! I'll have a look at your radio stations in a few days or weeks and maybe I'll find some for my website.

Have a good (clubbing) time!

hama
Title: Re: Music for your site
Post by: itrends on November 27, 2004, 07:34:52 pm
I should note that I have already changed my setup. I am no longer using frames, but instead a flash based player which loads in a pop up windows with playlist etc.

I am just figuring out how to stream a radio station stream into the player too so I can keep all the functionlity.

I would love your feedback on the new player.
Title: Re: Music for your site
Post by: rphMedia on November 28, 2004, 03:29:31 pm
hey all, thought you may be interested in my implementation of a music player which works on the entire site

Appreciate the thread hijack.  You really should've started a new thread. It's starting to get conveluted.
Title: Re: Music for your site
Post by: hama on November 28, 2004, 03:40:27 pm
Yes, I think we solved the problem "music for your website".

Other possibilities to implement music in a website should be discussed in a new thread.

hama
Title: Re: Music for your site
Post by: itrends on November 29, 2004, 10:28:16 am
Agreed, however when I first posted it was using the code that was provided at the start of this thread but implemented using Frames instead of an Iframe which removed the "scroll bar" problem. It was only afterwards that the new player (flash based) was implemented. No offence or thread hijacking intended :-(
Title: Re: Music for your site
Post by: rphMedia on December 15, 2004, 10:47:30 pm
Takin' a poll here.  I've implemented an "embed" tag to the WMP plugin on the page.  You guys with Firefox browser, can you check and tell me if you can see the media player now and if it plays?

*removed old link

Thanks

PS - edit, there's a link to send a Christmas E-Card at the site.  Be my guest.  They're very basic as I'm just testing the Flash/PHP integration, but from my tests, it's working quite well so far.  Happy Holidays to everyone here!
Title: Re: Music for your site
Post by: Casper on December 15, 2004, 10:56:51 pm
Yes, the media player is there, and it plays the music.
Title: Re: Music for your site
Post by: Tranz on December 15, 2004, 11:18:02 pm
Ditto on FF 1.0, WinXP SP2.
Title: Re: Music for your site
Post by: nol33t on December 16, 2004, 02:16:53 am

Removing the scrollbar doesn't help.

Code: [Select]
"<iframe src='index.php' width='100%' height='100%' frameborder='0' scroll='no' name='myInlineFrame'>Your browser doesn't seem to support 'frames'</iframe>";

Here's a printscreen of my problem:

Hi,
For those who got the same problem with Firefox (Ron fyi on your website the player is now indeed actually workin but the double scrollbar is still there),
the easiest solution is to set the height value of the <iframe> tag in pixel and not %, and to a value bigger than the height of the dynamically generated page, so:
- it takes a couple of tries to find the good one ( it you set it to a too high one your page will be way too long..)
- on some really long pages other than the index, like the configuration page, it could still show up if e.g.:
  (size index page) < (height chosen) < (size configuration page)
- if you add some content on your main page, you could have to adjust it again...

- BUT at least the double scroll does NOT SHOW UP ANYMORE ON THE MAIN PAGE  ;D (and it's late and i couldn't go to sleep without solvin' that one  :D)

Regards,
matt

P.S.: since i like IE users too ;)...for this solution to work with Firefox AND IE, you got to add scroll=yes in the <body> tag, and scroll=no in the <iframe> one
Title: Re: Music for your site
Post by: rphMedia on December 16, 2004, 05:55:54 pm
Good troubleshooting nol33t, but I've since found that this works every time -

Code: [Select]
<html>
<head>
<title>Our Online Photo Album</title>
</head>
<body bgcolor="#000000" topmargin="0px" leftmargin="0px" rightmargin="0px" bottommargin="0px" scroll="no">
<iframe src="index.php" width="100%" height="90%" frameborder="0" scrolling="auto" name="myInlineFrame">
Your browser doesn't seem to support "frames"</iframe>
<object classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" id="WMP1" Style="border-style: none; border-width: 0; margin: 0" width="100%" height="10%">
<param name="URL" value="your music here">
<param name="AutoStart"    value=false>
<param name="AutoRewind"   value=true>
<embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" width="100%" height="9%" src="your music here" ShowDisplay="0" showcontrols="1">
</object>
</body>
</html>

In essense, just change the embed tag to 9% (for some reason, Firefox doesn't like 100% height - adds scroll anyway).  This way, it looks perfect in IE, and a small bottom border occurs in Firefox, but absolutely no more double-scroll, no matter what the res/window size. Thanks for testing everyone.
Title: Re: Music for your site
Post by: nol33t on December 16, 2004, 06:29:49 pm
you sure ??? cuz i checked on your site (--edit: link removed on rphMedia request) and with firefox the player looks weird now and the double scroll is still here...
url of what i did if you want to compare http://nol33t.free.fr/cpg/

Title: Re: Music for your site
Post by: rphMedia on December 16, 2004, 06:42:12 pm
you sure ??? cuz i checked on your site (*removed old link) and with firefox the player looks weird now and the double scroll is still here...
url of what i did if you want to compare http://nol33t.free.fr/cpg/



I've been updating (3 of my sites) as you were writing that, so try it again.

*removed old links

I've also fixed some Firefox/css at my site and Firefox/Flash transparency issues. It's all coming together to satisfy both browsers.

PS, got all my mods there, looks good!
Title: Re: Music for your site
Post by: hama on February 17, 2005, 07:35:16 pm

I can't fix my player.php-firefox-problem ... works good with Internet Explorer, only black with Firefox ...  :-\\

It has something to do with "embedded" I know but my player.php looks a little bit crazy. I don't know which lines I can delete and where I have to put in the embedded tags.

Maybe somebody can help me a bit.

This is my player.php:

Code: [Select]
<?php
echo "<html>";
echo 
"<head>";
echo 
"<title>OST-Gallery</title>";
#echo "<link rel='stylesheet' href='themes/default/style.css'>";
echo "</head>";
echo 
"<body bgcolor='#000000' marginwidth='0' marginleft='0' topmargin='0' leftmargin='0' rightmargin='0' scroll='no'>";
echo 
"<div align='center'>";
echo 
"<table width='100%' height='92%' cellspacing='0' cellpading='0'>";
echo 
"<tr>";
echo 
"<td>";
echo 
"<iframe src='index.php' width='100%' height='100%' frameborder='0' scrolling='auto' name='myInlineFrame'>Your browser doesn't seem to support 'frames'</iframe>";
echo 
"</td>";
echo 
"</tr>";
echo 
"</table>";
echo 
"<object id='mediaPlayer' classid='CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95' align='center' codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715' standby='Loading Microsoft Windows Media Player components...' type='application/x-oleobject' viewastext width='100%' height='67'>";
echo 
"<param name='loop' value='true'>";
echo 
"<param name='FileName' value='$radiostation'>";
echo 
"<param name='ShowStatusBar' value='true'>";
echo 
"<param name='animationatStart' value='false'>";
echo 
"<param name='transparentatStart' value='false'>";
echo 
"<param name='autoStart' value='true'>";
echo 
"<param name='showControls' value='true'>";
echo 
"<param name='volume' value='-200'>";
#echo "<object classid='CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6' id='WMP1' Style='border-style: none; border-width: 0; margin: 0' width='100%' height='60'>";
#echo "<param name='URL' value='$radiostation'>";
#echo "<param name='AutoStart' value=false>";
#echo "<param name='AutoRewind' value=true>";
//<embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" width="100%" height="9%" enablecontextmenu="0" src="http://radio.msn.com/asx/generate.aspx?type=genre&amp;id=10002389" ShowDisplay="0" showcontrols="1"></embed>
echo "</object>";
echo 
"</div>";
echo 
"</body>";
echo 
"</html>";
?>


If somebody is interested, I have an anycontent-solution for "music for your site" where one part is visible for every gallery visitor and an additional part only for registered and logged in users (Casper helped me a bit).  :)

Here is this anycontent.php:

Code: [Select]
<?php
/*
$Id: anycontent.php,v 1.7 2004/03/16 09:26:18 gaugau Exp $
*/

if (USER_ID) {

starttable("100%""Sounds :-)"2);

echo 
"<tr><td class='tableb' colspan='2' align='center'><br><b>Ein bisschen Sound gefällig?</b></br><br>";
echo 
"</td></tr>";
echo 
"<tr><td class='tableb' width='50%' align='center'><br>";
echo 
"<form action='player.php' method='post' target='_top'>";
echo 
"<select size='1' name='radiostation'>";
echo 
"<option selected>Radios - Bitte wählen ...</option>";
echo 
"<option value='http://www.web-radio.com/stream.cfm?id=11489'>Radio Groove (USA, 32 KBit/s)</option>";
echo 
"<option value='http://www.radiopilatus.ch/sound/high.asx'>Radio Pilatus (48 KBit/s)</option>";
echo 
"<option value='http://asx.skypro.tv/asx/radio-drs/virus.asx'>Radio Virus (40 KBit/s)</option>";
echo 
"</select>&nbsp;<input type='submit' value='Play!' name='Play!'>";
echo 
"</form>";
echo 
"</td>";

echo 
"<td class='tableb' width='50%' align='center'><br>";
echo 
"<form action='player.php' method='post' target='_top'>";
echo 
"<select size='1' name='radiostation'>";
echo 
"<option selected>Songs - Bitte wählen ...</option>";
echo 
"<option value='http://www.yourdomain.ch/sounds/title.mp3'>Title</option>";
echo 
"<option value='http://www.yourdomain.ch/sounds/title.mp3'>Title</option>";
echo 
"<option value='http://www.yourdomain.ch/sounds/title.mp3'>Title</option>";
echo 
"</select>&nbsp;<input type='submit' value='Play!' name='Play!'>";
echo 
"</form>";
echo 
"</td></tr>";

endtable();

} else {

starttable("100%""Sounds :-)"2);

echo 
"<tr><td class='tableb' colspan='2' align='center'><br><b>Ein bisschen Sound gefällig?</b></br><br>";
echo 
"</td></tr>";
echo 
"<tr><td class='tableb' width='100%' align='center'><br>";
echo 
"<form action='player.php' method='post' target='_top'>";
echo 
"<select size='1' name='radiostation'>";
echo 
"<option selected>Radios - Bitte wählen ...</option>";
echo 
"<option value='http://www.web-radio.com/stream.cfm?id=11489'>Radio Groove (USA, 32 KBit/s)</option>";
echo 
"<option value='http://www.radiopilatus.ch/sound/high.asx'>Radio Pilatus (48 KBit/s)</option>";
echo 
"<option value='http://asx.skypro.tv/asx/radio-drs/virus.asx'>Radio Virus (40 KBit/s)</option>";
echo 
"</select>&nbsp;<input type='submit' value='Play!' name='Play!'>";
echo 
"</form>";
echo 
"</td>";

endtable();

}

?>

<br />

The "Music for your website"-anycontent in action: http://www.dorfschule.ch/copper/index.php (visible radio stations for everybody, more after login: test test)

hama
Title: Re: Music for your site
Post by: rphMedia on February 17, 2005, 09:00:25 pm
hama,

You're obviously trying to make this too hard and it's so easy.  If you click on my website and view the source, it should get you started.  Works in IE and Firefox.  I didn't go thru your code in detail, lots of stuff there that isn't really needed.  Understand that when you echo html, you can continue without all the line breaks.  You are correct in that it needs an embed tag, but I can't see where you went astray (no time to analyze right now :)).  Any questions, fire them at me - I'll be around off and on.

Title: Re: Music for your site
Post by: hama on February 17, 2005, 09:12:33 pm
hama,

You're obviously trying to make this too hard and it's so easy.  

I'll try it again, on your website it looks really easy ...

hama
Title: Re: Music for your site
Post by: gtwar3 on March 04, 2005, 06:24:04 am
Yeah so I am more than a noob and can't figure any of this out. I have a photo gallery and the link is http://gtwar3.com/ then the link to the photo gallery but i have no clue how or where or what the iframe is, where to put it or anything .... can someone help me with a tard proof way of doing this please! thanks  ???
Title: Re: Music for your site
Post by: rphMedia on March 19, 2005, 07:48:44 pm
Here's a new code for a dropdown menu if desired.  Works in all browsers (as far as I know - IE / FF for sure).  Modify the urls to your liking.

Enjoy!

Code: [Select]
<HTML>
<HEAD>
<title>Your Title</title>
<script type="text/javascript"><!--
function song(){
document.getElementById('music1').innerHTML="<embed type='application/x-mplayer2' id='music' pluginspage='http://www.microsoft.com/Windows/MediaPlayer/' src='"+document.getElementById('cancion').value+"' name='music' width='100%' height='45' controltype='2' showcontrols='1' showstatusbar='0' AutoStart='true'></embed>";
}
//-->
</script>
</head>
<body bgcolor="#E1E4F2" topmargin="0px" rightmargin="0px" bottommargin="0px" leftmargin="0px" scroll="no">
<center><iframe src="index.php" width="100%" height="92%" frameborder="0" allowtransparency="true" scrolling="auto" name="myInlineFrame"></center>
Your browser doesn't seem to support "frames"</iframe>
<div align="center">
  <center>
  <table border="0" cellpadding="0" cellspacing="0" width="100%">
    <tr>
      <td width="28%" valign="middle" align="center">
<select  id="cancion" onchange="song()" size="1">
<OPTION selected>::::::::::::: Choose Your Music Here :::::::::::::</OPTION>        
      <OPTION value=http://radio.msn.com/asx/generate.aspx?type=genre&id=10002389>New Age</OPTION>
      <OPTION value=http://radio.msn.com/asx/generate.aspx?type=genre&id=10002399>Pop</OPTION>
      <OPTION value=http://radio.msn.com/asx/generate.aspx?type=genre&id=10002392>Jazz</OPTION>
      <OPTION value=http://radio.msn.com/asx/generate.aspx?type=genre&id=10002364>Country</OPTION>
      <OPTION value=http://radio.msn.com/asx/generate.aspx?type=genre&id=10002378>Rock</OPTION></SELECT></td>
      <td width="72%" valign="bottom" align="center">
<span id="music1"><embed type="application/x-mplayer2" id="music" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" width="100%" height="45" enablecontextmenu="0" src="" ShowDisplay="0" showcontrols="1">
     </td>
    </tr>
  </table>
  </center>
</div>
</body>
</html>

You can see it here (http://s92220213.onlinehome.us/newgallery/)



Title: Re: Music for your site
Post by: Nik on March 25, 2005, 12:28:41 pm
rph, that code works perfectly.

gtwar3, copy rph's code and paste it into notepad. save as "index.html" and upload to the parent directory of CopperMine. point your browser to CopperMine's directory and you should be good to go. if not, make sure your browser is loading index.html and NOT index.php
Title: Re: Music for your site
Post by: rphMedia on March 25, 2005, 01:00:01 pm
 :)
Title: Re: Music for your site
Post by: Nik on March 26, 2005, 01:46:04 am
rph, once i start playing a station in Firefox i can't change to a different station... it sticks to the first station no matter what. do you know a way around this? it works fine in IE...
Title: Re: Music for your site
Post by: rphMedia on March 26, 2005, 04:48:25 pm
Opps, sorry about that.  Change the span tag and the document.getElementById to music1.  

<span id="music1">
document.getElementById('music1')


I also fixed the above posted code.

I guess FF was confused about the player and the span ID being the same name - IE didn't care.  Should work perfect now. Thanks for catching that!
Title: Re: Music for your site
Post by: Nik on March 27, 2005, 12:55:05 am
thanks
Title: Re: Music for your site
Post by: jarekn on November 07, 2005, 05:16:25 am
Nice One :)

Any way to set default song to play on load? and better yet any way for it to keep on playing the ohter songs after it in sequence? So if someone were to select 3rd song that it would play 4th song right after it and so on?



Here's a new code for a dropdown menu if desired.  Works in all browsers (as far as I know - IE / FF for sure).  Modify the urls to your liking.

Enjoy!

Code: [Select]
<HTML>
<HEAD>
<title>Your Title</title>
<script type="text/javascript"><!--
function song(){
document.getElementById('music1').innerHTML="<embed type='application/x-mplayer2' id='music' pluginspage='http://www.microsoft.com/Windows/MediaPlayer/' src='"+document.getElementById('cancion').value+"' name='music' width='100%' height='45' controltype='2' showcontrols='1' showstatusbar='0' AutoStart='true'></embed>";
}
//-->
</script>
</head>
<body bgcolor="#E1E4F2" topmargin="0px" rightmargin="0px" bottommargin="0px" leftmargin="0px" scroll="no">
<center><iframe src="index.php" width="100%" height="92%" frameborder="0" allowtransparency="true" scrolling="auto" name="myInlineFrame"></center>
Your browser doesn't seem to support "frames"</iframe>
<div align="center">
  <center>
  <table border="0" cellpadding="0" cellspacing="0" width="100%">
    <tr>
      <td width="28%" valign="middle" align="center">
<select  id="cancion" onchange="song()" size="1">
<OPTION selected>::::::::::::: Choose Your Music Here :::::::::::::</OPTION>        
      <OPTION value=http://radio.msn.com/asx/generate.aspx?type=genre&id=10002389>New Age</OPTION>
      <OPTION value=http://radio.msn.com/asx/generate.aspx?type=genre&id=10002399>Pop</OPTION>
      <OPTION value=http://radio.msn.com/asx/generate.aspx?type=genre&id=10002392>Jazz</OPTION>
      <OPTION value=http://radio.msn.com/asx/generate.aspx?type=genre&id=10002364>Country</OPTION>
      <OPTION value=http://radio.msn.com/asx/generate.aspx?type=genre&id=10002378>Rock</OPTION></SELECT></td>
      <td width="72%" valign="bottom" align="center">
<span id="music1"><embed type="application/x-mplayer2" id="music" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" width="100%" height="45" enablecontextmenu="0" src="" ShowDisplay="0" showcontrols="1">
     </td>
    </tr>
  </table>
  </center>
</div>
</body>
</html>

You can see it here (http://s92220213.onlinehome.us/newgallery/)




Title: Re: Music for your site
Post by: peps on May 11, 2006, 01:38:54 pm
The code works just fine. I have one small problem when I write out my page url the iframe does not show up! If I however write our mydomain.com/index.htm I can see the drop down menu with stations. What should I change in order to load index.htm as strat page and not index.php?
Title: Re: Music for your site
Post by: peps on May 11, 2006, 01:56:29 pm
OK i solved it. Here is the solution if some other newbie is looking for this:

With note pad make a file named: .htaccess (no txt extension or whatever just this)
Then add the line:

DirectoryIndex index.html index.htm index.php

Put the .htaccess file in your web root directory.
Title: Re: Music for your site
Post by: louisli on June 29, 2008, 10:29:32 am
Does this work for some specific albums?
I don't want the whole gallery has music, just 1 of my albums

same editing method? ???
thanks.
Title: Re: Music for your site
Post by: troy77 on November 13, 2008, 07:50:57 pm
Hi all.
The mod is great thanx, just 1 small thing. Im using mp3s instead of a station which works fine the only thing is i can only have 1 track on the site. Is it possible to put more in, say up 2 around 10 tracks?
This is what i tried:
<param name="URL" value="music/02.mp3, 01.mp3, 05.mp3">
But had no joy it will only play the first 1, 02.mp3.
Can someone help with this please?
Was going to start another thread but didnt think that would go down well so just hopeing someone sees this one.

Thanks guys
Title: Re: Music for your site
Post by: rphMedia on November 13, 2008, 08:25:01 pm
If you read through the thread, there are ways - http://forum.coppermine-gallery.net/index.php/topic,11106.msg74854.html#msg74854 ( hint - look for "option" [dropdown menu] ). Just replace the URLs with your MP3 paths.
Title: Re: Music for your site
Post by: troy77 on November 13, 2008, 08:46:02 pm
Thanx for that. I was going off the first code.
Is it possible to not have the dropdown and have it play automaticly with the media player at the bottom with the skip feature like the first code?
Thanx
Title: Re: Music for your site
Post by: rphMedia on November 13, 2008, 08:53:10 pm
A playlist is probably what you're looking for. Try Google for that and if you get stuck, I'll see what I can do.
Title: Re: Music for your site
Post by: troy77 on November 13, 2008, 08:58:38 pm
Yeah something like a playlist, ill keep looking for 1,
thanx alot mate
Title: Re: Music for your site
Post by: troy77 on November 13, 2008, 09:30:11 pm
Ok everyone I sorted it, I took the first code and just created a .m3u file which is just a list of the songs you want to play. This is what it should look like in the index.htm:
<param name="URL" value="play.m3u">

This gives your visitors the choice to change track as well
Title: Re: Music for your site
Post by: troy77 on November 16, 2008, 08:50:31 pm
Hi again, Im gonna be a pain now lol.

Is there a way to have diffrent music for certain albums??
I ask because Im do a special album for someone close who has passed so didnt want the music from the main site coming through but the music fron the memories.

Thanx again ;D
Title: Re: Music for your site
Post by: rphMedia on November 18, 2008, 01:08:55 pm
Hi again, Im gonna be a pain now lol.

Is there a way to have diffrent music for certain albums??
I ask because Im do a special album for someone close who has passed so didnt want the music from the main site coming through but the music fron the memories.

Thanx again ;D
Sorry, I have no idea if that's possible.
Title: Re: Music for your site
Post by: VaporDesigns on January 07, 2009, 06:17:40 pm
Interesting bit o code...i will test later :)
Title: Re: Music for your site
Post by: KOREntertainment on January 15, 2009, 03:46:07 am
OK, here's a trick if you want music at your Coppermine Gallery.  I see many, many posts by users who are struggling with this one.  It's so simple, it's not even funny :) and this is really not that invasive (later I will try to create a dhtml to open and close the player [window]).

Put your start page in an iframe.  Here's the basic code, you can play with all the parameters to get it to where you want it.  Mine's pointing to a new age streaming radio station on the net (nice for viewing images anyway).

Code: [Select]
<html>
<head>
<title>Online Photo Album</title>
<link rel="stylesheet" href="themes/yourtheme/style.css" />
</head>
<body bgcolor="#000000" topmargin="0" leftmargin="0" scroll="no">
<div align="center">
<table width="100%" height="90%">
<tr>
<td align="center">
<iframe src="index.php" width="100%" height="100%" frameborder="0" ALLOWTRANSPARENCY="true" scrolling="auto" name="myInlineFrame">
Your browser doesn't seem to support "frames"</iframe>
</td>
</tr>
</table>
<object classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" id="WMP1" Style="border-style: none; border-width: 0; margin: 0" width="100%" height="60">
<param name="URL" value="yourmusic.mp3">
<param name="AutoStart"    value=false>
<param name="AutoRewind"   value=true>
</object>
</div>
</body>

Name it index.htm and you can still access your gallery with a folder. This is simply embedding the WMP ActiveX control below the iFrame.  Now, when your vistor navigates around your gallery, the music continues throughout and of course, they can stop/pause anytime.  Your visitor has the option to play music (or not) upon arrival.  I personally wouldn't want it to start auto, though it can be done by changing that parameter.  And it doesn't have to be on the bottom; I thought mine looked better this way. The music itself could be a playlist, one file, or a url to streaming media (lots of them out there).  I hope you find this useful - enjoy!






I incerted this code in a blank page on dream weaver, added my file and opened it in the browser and it played.  Can I get some step by step instructions on how to import this code into my gallery?  I have no clue as to where to start.
Title: Re: Music for your site
Post by: Joachim Müller on February 05, 2009, 08:41:26 am
Don't use Dreamweaver. Please read up http://forum.coppermine-gallery.net/index.php/topic,57889.0.html or similar threads that explain what editors to use. Dreamweaver doesn't fall into the category "recommended editor", as it tends to "beautify" code by its own.