• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 771
  • Last Modified:

How can I get SoundManager2 script to initiate on page load?

Can I get SoundManager to initiate on pageLoad instead of on click?
I am using SoundManager2 in two instances on this website. The 360 player and the inline player. There is some conflict with the two. Once the page loads you can see that the 360 is visible, but clicking on it does nothing. The player is in the wrong location also, and that is because there is a class that gets applied to it once the SoundManager script initiates. The 360 player won't work until you click on the Music link, which is the top left square. This link opens the section that contains the inline music player, and for some reason once this player becomes visible the SoundManager2 script initiates. Now the 360 player appears in its proper position, and functions properly (plays music).

I think this is happening is because for some reason the SoundManager script isn't being initiated until the Inline player is activated by clicking on the Music link. Is it possible to initiate the SoundManager script immediately, so that the 360 player will function right away without having to wait for the user to click on the correct link? Is there someway I can declare for the SoundManager2 script to initiate in my index.html file, or perhaps in the inlineplayer.js file?

Thanks for any help. You can find the active issue here:
http://www.siegeink.net/clients/tsk/index2.html
0
soujohn
Asked:
soujohn
  • 2
1 Solution
 
CodebotCommented:
http://pbskids.org/scripts/soundmanager2/doc/getstarted/
soundManager.onload = function() {
  // SM2 is ready to go!
  var mySound = soundManager.createSound({
    id: 'aSound',
    url: '/path/to/an.mp3',
    volume: 50
  });
  mySound.play();
}

soundManager.onerror = function() {
  // SM2 could not start, no sound support, something broke etc. Handle gracefully.
  disableSoundInMyApp(); // for example
}

Open in new window

0
 
soujohnAuthor Commented:
Thanks Codebot,

you indirectly answered my question. Although this information didn't solve the issue I was facing you did lead me back the SoundManager homepage. Which lead me to search throughout the website, and find the forum section. There, I also asked my question and received feedback from one of the creators of the SoundManager2 script.

Here is a link to the question and response:
http://getsatisfaction.com/schillmania/topics/how_can_i_initiate_soundmanager_on_page_load_instead_of_onclick?utm_content=reply_link&utm_medium=email&utm_source=reply_notification#reply_4006927

Again, thank you very much Mr. Codebot.
0
 
soujohnAuthor Commented:
Although this solution did show me how the script was being initiated on the demo provided by he website, it didn't provide info pertaining to my particular issues. However the provided response did lead me to find the correct asnwers.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now