Needs review
Project:
SoundManager2
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Reporter:
Created:
2 Nov 2011 at 05:52 UTC
Updated:
17 Jun 2013 at 08:45 UTC
Hi,
I found this in the module code:
/**
* Theme function for adding the SoundManager 2 configuration JS file. Allows
* others to easily override it.
*/
function theme_soundmanager2_config() {
drupal_add_js(drupal_get_path('module', 'soundmanager2') . '/soundmanager2_config.js', array('type' => 'file', 'scope' => 'footer'));
}
How and where do I call this function to have it insert the altered .js??
Thanks for a great module!!
Sam
Comments
Comment #1
m4oliveiThis is a theme function just like any other. Override it as you would any other theme function. See http://drupal.org/node/341628 for details.
Basically though, in your theme you could implement a function like so:
Where 'my_theme' is the name of your theme. You would them copy soundmanager2_config.js from the soundmanager module to your theme. Make any adjustments you want to the soundmanager2_config.js file in your theme. Then clear the cache and your JS file should now be loaded over the one provided by soundmanager2 module.
Comment #2
sam_squarewave commentedThanks so much - the explanation is greatly appreciated :)
Comment #3
sam_squarewave commentedI've added
soundManager.playNext = true;
And it doesn't seem to be having an affect on the view I have set up to use some page players. Have you found the playNext setting to work?
I'm pretty confident it's using the custom properties file now as I broke the player and then got it working - missed substituting my_theme inside the function.
Comment #4
sam_squarewave commentedWould anyone else mind seeing if this setting will work for them - I'm still having no luck with this. Thanks again.
Comment #5
Sakrecoer commentedOne year later, i have the same issue with page player.
This is how my config looks:
No "soundmanager2.playNext" in my case... but i guess it is the same. However, "autoStart" and all other values will aply if i set it to "true"
Anybody knows anything by know?
Thanks alot!!!
Comment #6
Sakrecoer commentedHmm... i think the soundmanager2 code is fine. I have several sites using the same drupal install and only one is giving me this error. I haven't got the ability to check right now, but i believe they all run their individual soundmanager2 module, and i have probably omitted to make some change in the settings.
I'll keep you posted.
Writing this to make sure i wont waste someone's time. :)
Comment #7
Sakrecoer commentedFound the issue.
The page player only plays next song if they are part of the same node. But take for example a taxonomy page displaying teasers where the page-player is present, playNext will not load for songs across nodes on thats same page. But if one node on that taxonomy page has several audio files, it will play them as a list seemlessly.
This works fine with UI360.
Unfortunatley, i'm far too ignorant about codeing to improve it myself....
Thanks yaall!!
*Set
Comment #8
megthing commentedWow! That's good to know. I've been looking for a way to play next on a list of nodes in a view. Have you found a workaround? Perhaps with jQuery?