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

m4olivei’s picture

Assigned: Unassigned » m4olivei
Status: Active » Needs review

This 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:

function my_theme_soundmanager2_config() {
  drupal_add_js(drupal_get_path('theme', 'my_theme') . '/soundmanager2_config.js', array('type' => 'file', 'scope' => 'footer'));
}

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.

sam_squarewave’s picture

Thanks so much - the explanation is greatly appreciated :)

sam_squarewave’s picture

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

sam_squarewave’s picture

Would anyone else mind seeing if this setting will work for them - I'm still having no luck with this. Thanks again.

Sakrecoer’s picture

One year later, i have the same issue with page player.
This is how my config looks:

  this.config = {
    usePeakData: false,     // [Flash 9 only]: show peak data
    useWaveformData: false, // [Flash 9 only]: enable sound spectrum (raw waveform data) - WARNING: CPU-INTENSIVE: may set CPUs on fire.
    useEQData: false,       // [Flash 9 only]: enable sound EQ (frequency spectrum data) - WARNING: Also CPU-intensive.
    fillGraph: false,       // [Flash 9 only]: draw full lines instead of only top (peak) spectrum points
    allowRightClick: true,  // let users right-click MP3 links ("save as...", etc.) or discourage (can't prevent.)
    useThrottling: true,    // try to rate-limit potentially-expensive calls (eg. dragging position around)
    autoStart: false,       // begin playing first sound when page loads
    playNext: true,         // stop after one sound, or play through list until end
    updatePageTitle: false,  // change the page title while playing sounds
    emptyTime: '-:--',      // null/undefined timer values (before data is available)
    useFavIcon: false       // try to show peakData in address bar (Firefox + Opera) - may be too CPU heavy
  };

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

Sakrecoer’s picture

Hmm... 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. :)

Sakrecoer’s picture

Found 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

megthing’s picture

Wow! 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?