Music for your site - Page 3 Music for your site - Page 3
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Music for your site

Started by rphMedia, October 23, 2004, 06:27:44 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

rphMedia

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!

Nik


jarekn

#42
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?



Quote from: 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!

<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





peps

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?

peps

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.

louisli

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.
QNAP TS-109 pro NAS box
Apache 1.3.28
PHP 5.2.0
MySQL 5.0.27
CPG 1.4.18

troy77

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

rphMedia

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.

troy77

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

rphMedia

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.

troy77

Yeah something like a playlist, ill keep looking for 1,
thanx alot mate

troy77

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

troy77

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

rphMedia

Quote from: 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
Sorry, I have no idea if that's possible.

VaporDesigns

Interesting bit o code...i will test later :)

KOREntertainment

Quote from: 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).

<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.

Joachim Müller

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.