Trying to get continuous music on site....

General questions relating to Joomla! 1.5 There are other boards for more specific help on Joomla! features and extensions.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting.
Forum Post Assistant - If you are serious about wanting help, you should use this tool to help you post.
Locked
cmcsweeney
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Mon Mar 30, 2009 9:01 pm

Trying to get continuous music on site....

Post by cmcsweeney » Tue Mar 31, 2009 1:31 am

Hi,

I am working on a site wherein the client has asked me to include music. I was able to do this with "Premium beat player", but with each new page click the music reloads (which might be kind of irritating because this will be an e-commerce site, which could have endless 'links' of content).

What I want to find out is if anyone knows anything that would allow music to play uninterrupted during the time someone is on the site.

I saw another forum that mentioned that a php function could (theoretically) be used to call in the music player from elsewhere. This sounded like a great idea except that while I can rearrange preexisting PHP code, I haven't the first clue how to write it from scratch.

The test site can be found here: http://www.mcsweeneydesign.com/Joomlatest/ (note: ignore the look/placement of the music player, it's all going to be changed once I get the designer's mockup)

Thanks :D

cmcsweeney
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Mon Mar 30, 2009 9:01 pm

Re: Trying to get continuous music on site....

Post by cmcsweeney » Tue Mar 31, 2009 6:38 pm

Update:
Ok, a friend of mine found a way around it. I'm writing my findings here in case there are other people with this issue (and it wouldn't be fair of me to ask for an answer, then withhold my findings from others).

It's not my favourite solution, but here it is:

1) First off, make sure all your joomla files are contained within a directory (in my http://www.mcsweeneydesign.com/Joomlatest/ test site, "Joomlatest" was my directory, for example)

2) Put the music player code in a separate php file (call it musicplayer.php or something) and store it in your main Joomla directory.

3) Create a new file (ex: test.php), put it in the joomla directory, so you would access it http://www.mcsweeneydesign.com/Joomlatest/test.php (I tried to put it ABOVE the joomla directory and encountered problems, so it seems it HAS to be in the same directory as the rest of the joomla files).

4) What you put in the test.php file (between the <body> tags):

<?php include("musicplayer.php"); ?>

<iframe src="index.php" width="100%" height="85%" scrolling="auto" style="border:none"></iframe>

The width/height/scrolling/border attributes are entirely up to you, mine are just set like that (for now) because they work best with what I'm trying.

In summary, your test.php file is 'calling in' your music player and displaying your joomla portion in an iframe. Once again, not the best solution, but it DOES let you navigate the site without having the music restart with each click.

reddie
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Tue Jan 06, 2009 9:14 pm

Re: Trying to get continuous music on site....

Post by reddie » Thu Apr 09, 2009 5:47 am

I tried what you're saying, but it's not working out for me. I made a copy of the music player code (mod_premiumbeat_player.php), renamed it musicplayer.php and place it in my main joomla directory. Then I created new php file and put in the info of your test.php example and called it test.php. I then placed it into the main joomla directory too, but the music still reloads after clicking for a new page of the site. I don't know code but I can follow steps pretty well. I'm thinking maybe there's more to what you've posted. Please help me with more details. I can't Thank you enough. This is the site I'm working on: http://www.drsholesdouglas.com/home

cmcsweeney
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Mon Mar 30, 2009 9:01 pm

Re: Trying to get continuous music on site....

Post by cmcsweeney » Fri Apr 10, 2009 6:56 pm

Hey,

Sorry I couldn't answer sooner. I actually altered my original solution (iframes started to go a little weird on me) to something even more risky: frames.

I'm ashamed to admit it, but the <frame> solution worked for me. The downside is that my Virtuemart has gotten some problems now, but I think that might be remedied by reinstalling Joomla (the frames came into use rather late into the Joomla experiment, so I'm sure something's not connecting properly somewhere).

So, in summary, here's how the Joomlatest directory goes now:
[]=folder,
--=file name

[Joomlatest]
--index.html
[site] (this is the directory where you install Joomla)
--index.php
--musicplayer.php
--all the other Joomla files...etc

*****************
Here is the index.html code I used:
<frameset rows="35, *" frameborder="0">
<frame src="site/musicplayer.php" scrolling="no" noresize="noresize">
<frame src="site/index.php" name="main" scrolling="auto" noresize="noresize">
</frameset>

Once again, the test site: http://www.mcsweeneydesign.com/Joomlatest/
(I haven't reinstalled it yet, so the the 'Virtuemart testing' link is a bit iffy. I'm holding off on doing any more alterations till the graphic designer sends me the mockup)

One last thing that should be noted: if you do use the <frames> option, you might want to buy the music player. The reason I mention this is that the free version has the creator's logo on it and if a user clicks the logo, it opens http://www.premiumbeat.com/ in the same frame (try it on my page and you'll see what I mean).

Anyway, I hope you can get it to work the way you want it to.

User avatar
ItchySox
Joomla! Guru
Joomla! Guru
Posts: 666
Joined: Thu Jul 13, 2006 9:53 am
Location: Wirral, UK

Re: Trying to get continuous music on site....

Post by ItchySox » Fri Apr 10, 2009 7:07 pm

Have you considered popping a player up in another window?

reddie
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Tue Jan 06, 2009 9:14 pm

Re: Trying to get continuous music on site....

Post by reddie » Fri Apr 10, 2009 10:54 pm

Thank you very much for helping me cmcsweeney.

Here's a couple of question before I proceed. Does the "musicplayer.php" need to contain the exact info that's in the original player code "mod_premiumbeat_player.php" (in other words, a duplicate of the "mod_premiumbeat_player.php" file? Also, do I keep this original player code in it's original place which is: /home/modules/mod_premiumbeat_player/mod_premiumbeat_player.php while the musicplayer.php file is placed in the main joomla folder (in my case this folder is called "home")? Sorry, I'm know very little about coding but I'm currently learning it today with Lynda.com. ;)

reddie
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Tue Jan 06, 2009 9:14 pm

Re: Trying to get continuous music on site....

Post by reddie » Fri Apr 10, 2009 11:02 pm

Thank you for the optional method, ItchySox. Could you please elaborate for me? Are you saying create an article that pops up the player? If so, how would I do that? If that's not what you meant, please tell me what I should do to accomplish this option. Thank you!

cmcsweeney
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Mon Mar 30, 2009 9:01 pm

Re: Trying to get continuous music on site....

Post by cmcsweeney » Sat Apr 11, 2009 3:46 am

To Reddie (brace yourself, my reply is practically an essay, lol):
reddie wrote:Thank you very much for helping me cmcsweeney.

Here's a couple of question before I proceed. Does the "musicplayer.php" need to contain the exact info that's in the original player code "mod_premiumbeat_player.php" (in other words, a duplicate of the "mod_premiumbeat_player.php" file? Also, do I keep this original player code in it's original place which is: /home/modules/mod_premiumbeat_player/mod_premiumbeat_player.php while the musicplayer.php file is placed in the main joomla folder (in my case this folder is called "home")? Sorry, I'm know very little about coding but I'm currently learning it today with Lynda.com. ;)
Actually, the "musicplayer.php" file contains different code. Also, the Premiumbeat player I used is actually a package separate from the Joomla module one (I originally DID try that one, but it kept restarting the music each time I navigated...etc)

Since you mentioned that you don't know the code that well, I'm going to state what you can do, step by step, as I always find that easier to take when I'm looking for Joomla help :) (I also made a file of ItchySox's popup suggestion, which may work better for certain designs that don't work too well with frames. I'll list that method later in this message).

Also, for clarity's sake, I refer to the Joomla directory as the "home" folder (so there's a lot of code below that you'll be able to copy/paste)

1) Go to http://www.premiumbeat.com/flash_resour ... ic_player/ and choose a player that best fits your purpose. In this case, I chose the first one ("Mini Flash mp3 Player") because it's small and unobtrusive.

2) Unzip the zip folder and place the "playerMiniPackage" folder in your "Home" directory (i.e. the directory where all the Joomla stuff is stored)

3) The "sampleEmbedCode.html" file in the folder contains the code that goes in the musicplayer.php file.

Here is the the code (I'll list it below to save you the trouble of locating the file). This is the only code that follows the <title>...</title> tags:

Code: Select all

<body>

<script type="text/javascript" src="playerMiniPackage/swfobject.js"></script>
<div id="flashPlayer">
  This text will be replaced by the flash music player.
</div>
<script type="text/javascript">
   var so = new SWFObject("playerMiniPackage/playerMini.swf", "mymovie", "75", "30", "7", "#FFFFFF");
   so.addVariable("autoPlay", "yes");
   so.addVariable("soundPath", "playerMiniPackage/song.mp3");
   so.write("flashPlayer");
</script>
</body>
</html>

4) From what I could see of your http://www.drsholesdouglas.com/home/ site, I'm guessing your directories would look like this (please let me know if this is incorrect):
[]=folder

[public_html] (the directory that contains all the http://www.drsholesdouglas.com online files)

[Home] (your Joomla folder, which contains files/folders listed on the next 4 lines)
--index.php
--musicplayer.php
--[playerMiniPackage]
--all the other Joomla files...etc

5) Now you're going to make a index.html file and you're going to put it one directory above the Home folder (so it's put directly into the Public_html folder and therefore would be the first thing people see when they access http://www.drsholesdouglas.com, instead of it going straight to /home/index.php). This is the file we're going to be using for the last few steps.

(now I'll list the two possible ways you can display the player)
6) THE FRAMES METHOD:
put this code in your index.html (have it replace everything after your <title>...</title>) tags:

Code: Select all

</head>
<frameset rows="40, *" border="0">
<frame src="home/musicplayer.php" scrolling="no"/>
<frame src="home/index.php" />
</frameset>
</html>
You can change various attributes of the frames (more on that can be found here )

An example of the 'Frames' method:
http://mcsweeneydesign.com/Joomlatest/


7) THE POPUP METHOD (thanks once again to ItchySox for his suggestion, as this might be the better solution). I got this one from http://www.codelifter.com: (once again, this replaces all code after the <title>...</title> tags):

Code: Select all

<script>
var theURL = 'home/musicplayer.php';
var width  = 300;
var height = 400;

function popWindow() {
newWindow = window.open(theURL,'newWindow','toolbar=no,menubar=no,resizable=no,scrollbars=no,status=no,location=no,width=50,height=50');
}

</script>
  <style type="text/css">
   html, body, div, iframe { margin:0; padding:0; height:100%; }
   iframe { display:block; width:100%; border:none; }
  </style>
</head>
<body onload="popWindow()">
   <iframe src="home/index.php" height="100%" width="100%">
   </iframe>
</body>
</html>
Just to mention: the elements between the <style .... </style> tags makes sure that the 'iframe' that holds the joomla content takes up the entire page (and that it doesn't have borders, looks natural...etc)

An example of the 'popup' method: http://mcsweeneydesign.com/Joomlatest/index2.html

Last thing to note: if you want to change the song, you just need to rename the file you want to 'song.mp3' and replace it in the playerMiniPackage folder.

Phew. I hope that makes sense. If you have any more questions, feel free to ask.

****

To ItchySox: If you happen to know a php way of 'making a pop up' occur in the Joomla index.php file (similar in appearance to the popup method I used, but could be used in an already created php file), that would be fantastic.

I tried the Joomla Popin plugin, which worked smoothly (and would be great for several other uses), but sadly reloads when the user navigates.

Anyway, thanks once again for the popup suggestion! I might actually end of using it as it's the more flexible option :D

User avatar
ItchySox
Joomla! Guru
Joomla! Guru
Posts: 666
Joined: Thu Jul 13, 2006 9:53 am
Location: Wirral, UK

Re: Trying to get continuous music on site....

Post by ItchySox » Sat Apr 11, 2009 8:42 am

reddie wrote:Thank you for the optional method, ItchySox. Could you please elaborate for me? Are you saying create an article that pops up the player? If so, how would I do that? If that's not what you meant, please tell me what I should do to accomplish this option. Thank you!
A number of the embeddable players have a pop-up option, so instead of appearing in the page they will open their own re-sized window and as such are not subject to page changes - they simply play in the background. I have found this a very simple alternative to frames (we don't like frames :-\ ).

http://www.mikesstudio.co.uk Try it.

User avatar
ItchySox
Joomla! Guru
Joomla! Guru
Posts: 666
Joined: Thu Jul 13, 2006 9:53 am
Location: Wirral, UK

Re: Trying to get continuous music on site....

Post by ItchySox » Sat Apr 11, 2009 8:53 am


To ItchySox: If you happen to know a php way of 'making a pop up' occur in the Joomla index.php file (similar in appearance to the popup method I used, but could be used in an already created php file), that would be fantastic.

I tried the Joomla Popin plugin, which worked smoothly (and would be great for several other uses), but sadly reloads when the user navigates.

Anyway, thanks once again for the popup suggestion! I might actually end of using it as it's the more flexible option :D
Ah, there you are, you're welcome.

reddie
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Tue Jan 06, 2009 9:14 pm

Re: Trying to get continuous music on site....

Post by reddie » Sun Apr 12, 2009 12:14 am

Mr. cmcsweeney, YOU ARE A GENIUS!!!!!!!!!!!!!! OMG, that totally worked! I'm so happy right now I can't think. And I can not thank you enough cmcsweeney. Thank you so much for the all the time you spent to explain this to me. It seemed like I searched every for the answer. But your post was the only one that even touched on how to do this. Without you I'd have to search everywhere again.

Both solutions worked well. And Thank you too, ItchySox!

I decided to go with the frames method because the pop-up blockers (execept for google chrome) would prevent the music from playing with the Pop-up method. I figured that there are too many folks like myself who won't allow any pop-ups (or very seldom allow them), so with that the music obviously wouldn't be heard. At least that's what I was experiencing.

But once again cmcsweeney, thank you, thank you, THANK YOU!

The best to you. You ROCK my friend!!! :D

Reddie

cmcsweeney
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Mon Mar 30, 2009 9:01 pm

Re: Trying to get continuous music on site....

Post by cmcsweeney » Tue Apr 21, 2009 6:15 am

Hey Reddie, I'm glad it worked for you and hope the rest of the site development goes well :D

reddie
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Tue Jan 06, 2009 9:14 pm

Re: Trying to get continuous music on site....

Post by reddie » Tue Apr 21, 2009 6:39 am

Thank you cmcsweeney! So far, so good (thanks to you). :)

perspective
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 154
Joined: Thu Oct 04, 2007 7:45 pm

Re: Trying to get continuous music on site....

Post by perspective » Fri Jun 12, 2009 6:03 pm

Isn't there a way to bypass pop up blockers? I will be searching for this info.

perspective
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 154
Joined: Thu Oct 04, 2007 7:45 pm

Re: Trying to get continuous music on site....

Post by perspective » Fri Jun 12, 2009 6:09 pm

Also is there a javascript / ajax pop us that does not refresh, if you notice facebook does something similar with there bottom bar, when you chat.

Flashwood59
Joomla! Intern
Joomla! Intern
Posts: 93
Joined: Wed Dec 10, 2008 6:44 pm

Re: Trying to get continuous music on site....

Post by Flashwood59 » Fri Jun 12, 2009 7:19 pm

If the above method works for you, I am happy for you. However, it doesn't seem like an ideal fix. I have been using UnMP3 player, it does reload on every new page load when you use it on your pages initially. There is a button which is probably driven by the flash actionscript that makes it open in a separate window, the player on the page stops and the player in the separate window plays. If there was some way to get that actionscript to run when the player first loads onto the page would be the ideal solution. I have tried to get in touch with the creator of the app but there has been no reply. I am not much into hacking flash but that might be the road to take.

Jeff

jccreations
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Wed Jun 24, 2009 11:12 am

Re: Trying to get continuous music on site....

Post by jccreations » Wed Jun 24, 2009 11:19 am

It took me sometime to find this information, but THANK YOU VERY MUCH! I am a newbie but I wanted music playing while the user surfs through the site (band website) and the frames coding explained in this section did the job for me!

I am only curious if by doing frames you are not allowing Search Engines such as Google and Yahoo to find your pages quite as easily? Do pages in the lower frame not appear as active to search engines or become harder to pull information from?

Lotharian
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Sun Feb 14, 2010 4:10 pm

Re: Trying to get continuous music on site....

Post by Lotharian » Sun Feb 14, 2010 4:19 pm

I was successful in getting the music to play using frames, but the problem I have now is that whenever I click on "Home" in the main menu, a completely new frameset is opened in the main frame containing another copy of the mp3 player along with the web page. (Joomla submits the site's URL whenever "Home" is clicked).

Is there a way to close any open frames before opening a new one?

Any help will be greatly appreciated !!!

Flashwood59
Joomla! Intern
Joomla! Intern
Posts: 93
Joined: Wed Dec 10, 2008 6:44 pm

Re: Trying to get continuous music on site....

Post by Flashwood59 » Tue Feb 16, 2010 3:47 pm

jccreations and lotharian
Frames will allow you to have uninterrupted music playing while a visitor surfs your site, HOWEVER, if you look at the address bar in your browser you will see that it doesn't change. Search Engines will only see one page. If this is Okay with you, then might I suggest making your entire site in FLASH. You will be able to have continuous music and a fully navigable site.
I am using Joomla! to take advantage of the Database and Content Management system. Joomla1.5 has the Search Optimization tool that will allow you to reach higher rankings with the major search engines. This is what your customers will leave you for.
The stand-alone mp3 player, which can be made to start automatically, is the option that I feel is the best fit. I have a button on the template that allows the visitor to start the player in a separate window. This way the visitor is aware that the player is in a separate window and can leave it play even when they navigate away from the site. I personally do not like, especially if my speakers are on fairly loud, to have music start up as a surprise.
You can see what I mean by going to http://www.rebeccalappa.com

I hope this helps with your decisions.

Jeff

toolbox978
Joomla! Intern
Joomla! Intern
Posts: 59
Joined: Thu Jan 03, 2008 5:41 am

Re: Trying to get continuous music on site....

Post by toolbox978 » Wed Aug 04, 2010 7:40 am

This code makes it so that the player is on the top portion of the website. I tried switching it so it appears on the bottom, but it didn't want to work.

toolbox978
Joomla! Intern
Joomla! Intern
Posts: 59
Joined: Thu Jan 03, 2008 5:41 am

Re: Trying to get continuous music on site....

Post by toolbox978 » Wed Aug 04, 2010 8:04 am

Nevermind my last post, I figured that part out. How do I center the player on the page? It is left aligned.

Flashwood59
Joomla! Intern
Joomla! Intern
Posts: 93
Joined: Wed Dec 10, 2008 6:44 pm

Re: Trying to get continuous music on site....

Post by Flashwood59 » Wed Aug 04, 2010 2:16 pm

There are many ways to change the position of an object on a webpage.
If you are using CSS to style you page you can just change the position of the Div that it is in, or conversely change the Div that contains it.
If you are using mostly HTML then there are many more ways to change the position of an object.
Change the position of the <td> containing the object or change the <td> containing the object.
We can get deeper into it with tags, etc., for that visit http://www.w3.org/.


Locked

Return to “General Questions/New to Joomla! 1.5”