Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2010-11-22
3
Medium Priority
?
765 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 6

Accepted Solution

by:
Codebot earned 750 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I've been trying to accomplish this for a while and it just struck me yesterday how to accomplish this task. I have done searches all over the internet looking for ways to email pages from my applications and finally I have done it!!! Every single s…
This article discusses how to implement server side field validation and display customized error messages to the client.
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…

670 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