Solved

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

Posted on 2010-11-22
3
757 Views
Last Modified: 2012-08-13
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
Comment
Question by:soujohn
  • 2
3 Comments
 
LVL 6

Accepted Solution

by:
Codebot earned 250 total points
ID: 34196403
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
 

Author Comment

by:soujohn
ID: 34243574
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
 

Author Closing Comment

by:soujohn
ID: 34243604
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

In Part 1 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7849-Hex-Maze.html) we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now