Solved

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

Posted on 2010-11-22
3
761 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to read data from SQL server  to sharepoint 2013 ? 3 31
Add or delete table rows 10 55
removing a class in javascript 4 51
JQuery Syntax... 4 38
In my daily work (mainly using ASP.net), I need to write a lot of JavaScript code. One of the most repetitive tasks I do are the jQuery Ajax calls. You know: (CODE) I don't know if for you it's the same, but for me is soooo tedious to write the …
The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
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…

808 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