From 753f60c7d4769fa72d3b910e491f37db6f130898 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Fri, 2 Aug 2013 17:19:21 -0500 Subject: dymaxion --- .../demo/template/deferred-example.html | 127 ++++++++++++++++++++ .../demo/template/html5-dtd-test.html | 77 ++++++++++++ .../demo/template/index.html | 131 +++++++++++++++++++++ .../demo/template/template.css | 67 +++++++++++ .../demo/template/xhtml-test.xhtml | 86 ++++++++++++++ 5 files changed, 488 insertions(+) create mode 100755 docs/dymaxion/soundmanagerv297a-20101010/demo/template/deferred-example.html create mode 100755 docs/dymaxion/soundmanagerv297a-20101010/demo/template/html5-dtd-test.html create mode 100755 docs/dymaxion/soundmanagerv297a-20101010/demo/template/index.html create mode 100755 docs/dymaxion/soundmanagerv297a-20101010/demo/template/template.css create mode 100755 docs/dymaxion/soundmanagerv297a-20101010/demo/template/xhtml-test.xhtml (limited to 'docs/dymaxion/soundmanagerv297a-20101010/demo/template') diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/template/deferred-example.html b/docs/dymaxion/soundmanagerv297a-20101010/demo/template/deferred-example.html new file mode 100755 index 0000000..2f33a55 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/template/deferred-example.html @@ -0,0 +1,127 @@ + + + +SoundManager 2: Deferred loading / Lazy-loading / Dynamic script loading Example + + + + + + + + + + + + +
+

SoundManager 2: Lazy Loading Example

+

This is an example of dynamically loading SoundManager 2 using JS, after window.onload() has fired.

+

How it works

+

This page waits until window.onload(), delays 1 second and loads soundmanager2.js, which should then start up.

+ +

SoundManager 2 status: Waiting for window.onload()...

+ +
window.onload = function() {
+  // Window loaded, waiting 1 second...
+  setTimeout(function() {
+    // Loading soundmanager2.js...
+    loadScript('../../script/soundmanager2.js',function() {
+      // SM2 script has loaded
+      soundManager.url = '../../swf/';
+      soundManager.onready(function() {
+        if (soundManager.supported()) {
+          soundManager.createSound({
+            id:'foo',
+            url:'../_mp3/mouseover.mp3'
+          }).play();
+        }
+        // msg(soundManager.supported()?'started OK':'Loaded OK, but unable to start: unsupported/flash blocked, etc.');
+      });
+      soundManager.beginDelayedInit(); // ensure start-up in case document.readyState and/or DOMContentLoaded are unavailable
+    });
+  },1000);
+}
+ +

Handling flash blockers

+

It's good to let users see the flash component of SM2, so those with flash blockers can unblock it and allow SM2 to start. For more info on this, see the Flashblock example.

+ +

Making SM2 wait for window.onload()

+

If you prefer to have the library wait for window.onload() before calling soundManager.onload()/onerror() methods, you can modify SM2's "waitForWindowLoad" property:

+soundManager.waitForWindowLoad = true; +

Disabling debug output

+

SoundManager 2 will write to a debug <div> element or a javascript console if available, by default. To disable it, simply set the relevant property to false:

+soundManager.debugMode = false; +

To see related configuration code, refer to the source of this page which basically does all of the above "for real."

+

Troubleshooting

+

If SM2 is failing to start and throwing errors due to flash security, timeouts or other issues, check out the troubleshooting tool which can help you fix things.

+

No-debug, compressed version of soundmanager2.js

+

Once development is finished, you can also use the "minified" (60% smaller) version of SM2, which has debug output and comments removed for you: soundmanager2-nodebug-jsmin.js. If you can, serve this with gzip compression for even greater bandwidth savings!

+ +
+ + + diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/template/html5-dtd-test.html b/docs/dymaxion/soundmanagerv297a-20101010/demo/template/html5-dtd-test.html new file mode 100755 index 0000000..4d1b102 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/template/html5-dtd-test.html @@ -0,0 +1,77 @@ + + + +SoundManager 2: HTML 5 DTD test + + + + + + + + + + diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/template/index.html b/docs/dymaxion/soundmanagerv297a-20101010/demo/template/index.html new file mode 100755 index 0000000..214342c --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/template/index.html @@ -0,0 +1,131 @@ + + + +SoundManager 2 Template + + + + + + + + + + + + + + + + + + + + + +
+

SoundManager 2 Template Example

+

This is a basic template for adding SoundManager to your page.

+

How it works

+

This page includes the SM2 script, which starts up on its own as appropriate. By default it will try to start as soon as possible.

+

The minimal code needed to get SoundManager 2 going is below, with configurable parts:

+ +
+
+<!-- include SM2 library -->
+<script type="text/javascript" src="/path/to/soundmanager2.js"></script>
+
+<!-- configure it for your use -->
+<script type="text/javascript">
+
+soundManager.url = '/path/to/sm2-flash-movies/'; // directory where SM2 .SWFs live
+
+// Note that SoundManager will determine and append the appropriate .SWF file to the URL,
+// eg. /path/to/sm2-flash-movies/soundmanager2.swf automatically.
+
+// Beta-ish HTML5 audio support (force-enabled for iPad), flash-free sound for Safari + Chrome. Enable if you want to try it!
+// soundManager.useHTML5Audio = true;
+
+// do this to skip flash block handling for now. See the flashblock demo when you want to start getting fancy.
+soundManager.useFlashBlock = false;
+
+// disable debug mode after development/testing..
+// soundManager.debugMode = false;
+
+// Option 1: Simple onload() + createSound() method
+
+soundManager.onload = function() {
+  // SM2 has loaded - now you can create and play sounds!
+  soundManager.createSound('helloWorld','/path/to/hello-world.mp3');
+  soundManager.play('helloWorld');
+};
+
+// Option 2 (better): More flexible onload() + createSound() method
+
+soundManager.onload = function() {
+  var mySound = soundManager.createSound({
+    id: 'aSound',
+    url: '/path/to/an.mp3'
+    // onload: [ event handler function object ],
+    // other options here..
+  });
+  mySound.play();
+}
+
+// Option 3 (best): onready() + createSound() methods, handle load/failure together:
+
+soundManager.onready(function() {
+  // check if SM2 successfully loaded..
+  if (soundManager.supported()) {
+    // SM2 has loaded - now you can create and play sounds!
+    var mySound = soundManager.createSound({
+      id: 'aSound',
+      url: '/path/to/an.mp3'
+      // onload: [ event handler function object ],
+      // other options here..
+    });
+    mySound.play();
+  } else {
+    // (Optional) Hrmm, SM2 could not start. Show an error, etc.?
+  }
+});
+
+</script>
+ +

Handling flash blockers

+

It's good to let users see the flash component of SM2, so those with flash blockers can unblock it and allow SM2 to start. For more info on this, see the Flashblock example.

+ +

Making SM2 wait for window.onload()

+

If you prefer to have the library wait for window.onload() before calling soundManager.onload()/onerror() methods, you can modify SM2's "waitForWindowLoad" property:

+soundManager.waitForWindowLoad = true; +

Disabling debug output

+

SoundManager 2 will write to a debug <div> element or a javascript console if available, by default. To disable it, simply set the relevant property to false:

+soundManager.debugMode = false; +

To see related configuration code, refer to the source of this page which basically does all of the above "for real."

+

Troubleshooting

+

If SM2 is failing to start and throwing errors due to flash security, timeouts or other issues, check out the troubleshooting tool which can help you fix things.

+

No-debug, compressed version of soundmanager2.js

+

Once development is finished, you can also use the "minified" (down to 10% of original size with gzip!) version of SM2, which has debug output and comments removed for you: soundmanager2-nodebug-jsmin.js. Serve with gzip compression wherever possible for best bandwidth savings.

+ +
+ + + diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/template/template.css b/docs/dymaxion/soundmanagerv297a-20101010/demo/template/template.css new file mode 100755 index 0000000..448853e --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/template/template.css @@ -0,0 +1,67 @@ +/* + + DEMO ONLY, just to make the demo page pretty. + + You don't need this stuff for SM2 to work. :) + +*/ + +body { + font-size:75%; +} + +code, pre { + font-family:"lucida console",monaco,courier,terminal,system; + font-size:100%; + color:#2233cc; +} + +em em { + font-weight:normal; + font-style:normal; + color:#339933; +} + +h1, +h2.special { + letter-spacing:-1px; +} + +h1, h2, h3, h4 { + font-family:"helvetica neue",helvetica,verdana,arial,tahoma,"sans serif"; + font-size:1em; + margin:0px; + padding:0px; + vertical-align:middle; +} + +h1 { + font-size:2em; +} + +h2 { + font-family:helvetica,arial,verdana,tahoma,"sans serif"; + font-size:1.5em; +} + +h3 { + font-size:1.17em; + border-bottom:1px solid #ccc; + padding-bottom:0.25em; + margin-top:1.5em; +} + +h4 { + margin:1.5em 0px 0.5em 0px; + font-size:1.1em; +} + + +p { + font:normal 1em verdana,tahoma,arial,"sans serif"; +} + +code span, +pre span { + color:#666; +} \ No newline at end of file diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/template/xhtml-test.xhtml b/docs/dymaxion/soundmanagerv297a-20101010/demo/template/xhtml-test.xhtml new file mode 100755 index 0000000..a77db8f --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/template/xhtml-test.xhtml @@ -0,0 +1,86 @@ + + + +SoundManager 2 Template + + + + + + + + + + + + + + + + + + + + + +
+

SoundManager 2 Template Example

+

This is a basic template for adding SoundManager to your page.

+

How it works

+

This page includes the SM2 script, which starts up on its own as appropriate. By default it will try to start as soon as possible.

+

The minimal code needed to get SoundManager 2 going is below, with configurable parts:

+ +
+
+<-- include SM2 library -->
+<script type="text/javascript" src="/path/to/soundmanager2.js"></script>
+
+<-- configure it for your use -->
+<script type="text/javascript">
+
+soundManager.url = '/path/to/sm2-flash-movies/'; // directory where SM2 .SWFs live
+
+// Note that SounndManager will determine and append the appropriate .SWF file to the URL.
+
+// disable debug mode after development/testing..
+// soundManager.debugMode = false;
+
+soundManager.onload = function() {
+  // SM2 has loaded - now you can create and play sounds!
+  soundManager.createSound('helloWorld','/path/to/hello-world.mp3');
+  soundManager.play('helloWorld');
+}
+
+</script>
+ +

Making SM2 wait for window.onload()

+

If you prefer to have the library wait for window.onload() before calling soundManager.onload()/onerror() methods, you can modify SM2's "waitForWindowLoad" property:

+soundManager.waitForWindowLoad = true; +

Disabling debug output

+

SoundManager 2 will write to a debug <div> element or a javascript console if available, by default. To disable it, simply set the relevant property to false:

+soundManager.debugMode = false; +

To see related configuration code, refer to the source of this page which basically does all of the above "for real."

+

No-debug, compressed version of soundmanager2.js

+

Once development is finished, you can also use the "minified" (60% smaller) version of SM2, which has debug output and comments removed for you: soundmanager2-nodebug-jsmin.js. If you can, serve this with gzip compression for even greater bandwidth savings!

+ +
+ + + -- cgit v1.2.3-70-g09d2