Skip to content
Tags give the ability to mark specific points in history as being important
  • V2.97a.20150601
    e45d0fe7 · Latest ·
        Bug fixes
    
            Added forceUseGlobalHTML5Audio setup option, to address desktop Safari breaking playlist-style playback when in a background tab (something with new Audio() prevents playback from starting automatically?)
    
            Improved RequireJS compatibility, correct define() usage and support for SM2_DEFER.
    
        API Updates
    
            API now fires onstop() when destroying a sound.
    
            New setup option: ignoreMobileRestrictions. Enable if you want to avoid the singleton HTML5 object pattern used for mobile devices. iOS WebView purportedly allows use of multiple HTML5 Audio() objects.
    
            soundManager.setVolume(33) now applies to all sounds. (Overloaded form; standard is soundManager.setVolume('mySound', 33).)
    
        Bar UI Updates
    
            Added window.sm2BarPlayers API including data and methods. Players are now scriptable / controllable from JS.
    
            on object for event callbacks, global and per-instance - e.g., window.sm2BarPlayers.on = { play: function() { ... }, stop: function() { ... } }); - or, per-instance: window.sm2BarPlayers[0].on = { ... }
    
            New config option: stopOtherSounds (i.e., only one player active at a time)
    
            More config: excludeClass (default: sm2-exclude), prevents SM2 from playing link. Will fall through, download etc.
    
            Added support for additional links in playlist: shopping cart ("buy now"), and music note ("download") next to each playlist item.
    
            Playlist now scrolls currently-playing item into view by default.
    
            Fix timing issue when user switches tracks in error case.
    
            Improved playlist open-by-default UI state. Added playlist toggle to demo.
    
            Check for defaultItem, handle case when starting with an empty playlist.
    
            Workaround for non-zero scrollTop offset the first time the playlist is opened.
    
            Minor UI tweaks for alignment, polish.
    
        Miscellaneous
    
            New 2015 Turntable UI Demo. Based on the 2011 "Wheels Of Steel" browser-based turntable UI prototype. Basic UI, API and load/play ability with easily customizable slipmats, record and album artwork.
    
            Added bower.json, component.json and npm package.json definition files.
    
            Improved RequireJS compatibility, correct define() usage and support for SM2_DEFER.
    
            soundmanager2.js code style review (mostly for consistency.) Line breaks, quotes on strings, conditions and ternary statements, comment formatting etc.
    
            Side note: The prior release's pre-emptive fix for iOS 8 ended up being a non-issue, as the official iOS 8 release did not use "OS 10" in the user-agent string. Nonetheless, SM2 will now correctly identify iOS 10+ vs. incorrectly flagging it as "iOS 1".
  • V2.97a.20140901
    V2.97a.20140901 - iOS 8 compatibility fix, "Bar UI" player demo, durationchange, buffering, edge case tweaks for HTML5 and RTMP, and browser environment checks.
    
    *Bug fixes*
    Why UA sniffing is generally bad, real-world example #1048577: "That time a missing /s on navigator.userAgent (based on single-digit UA version assumptions) broke SM2 on iOS 8+ devices."
    
    The upside: The fix is adding \s to a UA regex check targeting legacy iOS devices with broken HTML5 Audio() support, so that the "OS 10 " portion of the UA string does not match the pattern "OS 1 ".
    
    This is a pre-emptive fix for the pending iOS 8 release, which reportedly includes the string "iPhone OS 10_10 like Mac OS X". Due to SM2 checking for /os ([12|3_0|3_1])/i which had broken HTML5 Audio() support, and not considering the far future possibility of "iOS 10" being included in the userAgent string at the time, HTML5 audio is incorrectly disabled on iOS 8 beta 3 and is likely to apply to the final iOS 8 release.
    
    This is a good example and reminder of why UA checks are generally bad, and dangerous; similar issues hit other libraries doing UA and plugin checks both client and server-side when IE hit 10, and Flash hit version 10, so this iOS pattern change may affect some other libraries targeting iOS as well.
    
    HTML5: Listen to durationchange event, catch-all for duration update events. May help on mobile if duration is determined late. (Related discussion.)
    
    Explicitly provide buffering status to onbufferchange(). Don't set buffering(0) when loading, since playback may still be paused.
    
    Flash: Fix edge case where play({ url: xxx, position: 0 }); on existing sound with assigned URL. New URL wouldn't take effect.
    
    *API Updates*
    SMSound onwarning and onfailure options for NetStream / RTMP error/exception handling. Removed additional sound param on onfailure() callback. Apologies if this breaks anyone's implementation (disclaimer: these options are still experimental, and undocumented. :D) "Unhandled" exceptions are now considered non-fatal, using onwarning instead of presuming playback has failed etc.
    
    *Miscellaneous*
    "Bar UI" player demo added. SVG-based iconography, degrades nicely down to IE 8. See live demo.
    
    Retina/hi-dpi updates for 360° canvas, small 360° player buttons and basic button player demo image assets.
    
    CommonJS + AMD (requireJS) module.exports / define() compatibility (see commit for details.)
    
    Check window && window.document, barf if loaded in server-side node environment vs. in a browser. (Even if Node.js etc. support Audio() at some point, SM2 was designed for a browser; this check is probably A Good Thing™ to have in place.) If you feel you have a use case that makes sense here, feedback is appreciated.
  • V2.97a.20131201
    815f62e1 · Fix GitHub link ·
    V2.97a.20131201 - 100% HTML5 mode by default. Duration fix for Adobe FMS/RTMP server-based streaming. HTML5 unload, multiShot and autoPlay tweaks.
    
    *Bug fixes*
    
    Adobe FMS (RTMP Server) fix: Invoke server-side getStreamLength() call to determine duration. (Red5 and other free RTMP servers use NetStream onMetaData() to pass duration.)
    
    Fix html5Unload() by loading a tiny base64-encoded data: URI WAVe file where supported. Elsewhere, use about:blank. This fixes errors in Chrome where the browser attempts to load the url "null" (a string.)
    
    D'oh! Fix HTML5 sprite regression where _oncanplay() was not being picked up & fired, sound would not play on first click.
    
    HTML5: Fix double-play bug with autoPlay: true. Correct edge case where onposition() items would sometimes be cleared if called/assigned before play().
    
    ontimeout: function(status) {} callback parameter corrections. Fix missing error { type: 'INIT_TIMEOUT' } for missing/404 SWF case, and INIT_FLASHBLOCK for flashblock-specific case.
    
    HTML5: Apply volume to cloned sounds in HTML5 multiShot case.
    
    Fixed issue in _processOnPosition where the item in onPositionItems[i] can be undefined mid-loop if the callback that is triggered changes the length of the onPositionItems array, where onPositionItems.length becomes zero and there's an uncaught TypeError when trying to access item.fired the next time around.
    
    Fixed mute in HTML5.
    
    Fix onload in Firefox 3.6 with no flash (and yes, Firefox 25 is the current release. :D)
    
    Correct event removal (cloned HTML5 nodes) - onended → ended
    
    *API Updates*
    
    Use 100% HTML5 mode by default, where available. preferFlash: false is now the default setting. Firefox does MP3 on Vista (and newer) via HTML5, and recently (via Firefox Aurora builds) on OS X - the last major hold-out. The vast majority of browsers now support MP3 via HTML5, thus reducing the reliance on Flash.
    
    Reboot into 100% HTML5 mode where supported if flash fails after loading, i.e., local/offline/file:// or other edge case.
    
    *Miscellaneous*
    
    Fixed canPlayMIME() documentation example.
  • V2.97a.20130512
    519e65f3 · Updated file size table ·
    V2.97a.20130512 - multiShot for polyphonic HTML5 clients. createSound() no longer requires an id. Auto-reboot() into 100% HTML5 mode where supported. HTML5 unload tweaks.
    
        Bug fixes
    
            Init enhancement: If preferFlash: true but useFlashBlock: false (the default SM2 config) and flash timeout / blocked case occurs, SM2 will reboot reboot into 100% HTML5 mode if available so init can succeed. If flash block handling is enabled, user interaction will be required to whitelist the flash movie and init will be delayed until the SWF loads.
    
            Correct reboot() to allow 100% HTML5 mode when Flash was previously required due to preferFlash: true. Previously, soundManager.audioFormats.mp3.required = false; soundManager.reboot() did not result in 100% HTML5 mode under Firefox. Now works as expected.
    
            HTML5 unloading: Firefox was supposed to like assigning '' to Audio().url for canceling requests, unloading and destroying the decoder (perhaps only on <audio>, in retrospect?) - similarly, .src = null did not seem to work, possible request to ./ - undesirable.
    
            Now using more-conservative null URL for unload / destruct on webkit, iOS and others, and emptyURL for Firefox (user-customizable, 'about:blank' by default.)
    
            More HTML5 safety checks so that buffered can't go beyond 100%.
    
            Improve Flash 9 load() -> onload() failure case, when loading a non-404 (eg., HTTP 301 -> 200) with non-audio content. Improved messaging for Flash 8, Flash 9 + HTML5 with zero-duration (invalid / unsupported sound) case.
    
            Fix flash-only (no HTML5 / useHTML5Audio: false) init case, e.g., running under IE 8.
    
            HTML5: Fix legacy "overloaded" case when soundManager.play('someID', 'some.mp3'); is called twice, second call would fail. This shortcut method is deprecated, and not recommended for use other than a conveience when in development / testing.
    
        API Updates
    
            createSound() no longer requires an id property. If omitted, a unique id will automatically be generated for the new sound object with a prefix based on the SM2 setup option idPrefix.
    
            Specifying an id is useful if you want to look up the sound via getSoundById() - otherwise, you can simply use the object returned by the createSound() call.
    
            multiShot + multiShotEvents for HTML5 Audio()-based sounds, allowing layered / "chorused" playback if play() is called and multiShot: true has been specified to either createSound() or play(). Behaviour should mimic that of Flash 9. If multiShotEvents: true is specified, onfinish() will fire for each instance. Does not apply to mobile clients (e.g., iOS and Android) which only allow one sound to be played at a time.
    
            Implementation summary: A new Audio(src) instance is created with an onfinish listener, and played immediately. It is unloaded and destroyed when playback finishes.
    
            Caveat #1: If a position argument is provided eg., play({ position: 1000 }), the cloned Audio() instance must wait for a HTML5 canplay event before a seek and playback can begin. This may mean playback *could* have a slight delay vs. playing without the position offset.
    
            Caveat #2: The from/to parameters used for "sound sprites", e.g., { from: 500, to: 1500 }, are not presently supported under multiShot.
    
            Caveat #3: multiShot is not supported where only a single audio instance can be playing at once, e.g., iOS (iPhone/iPad) and some Android devices.
    
            Secondary instances are "fire-and-forget", similar to the Flash 9 implementation, and fire no events other than onfinish(). They do not respond to position, volume etc. after playback has begun.
    
        Miscellaneous
    
            Remove debug-related complain() calls from -nodebug and minified script builds
    
            Force data: URLs over to HTML5. Catch unsupported case under 100% HTML5 mode, preventing attempt to use Flash fallback.
    
            Edge case: Fix error case if setup() called without arguments inline, before DOMReady / init etc.
    
            Tweak soundManager.getSoundById() to not throw error if ID omitted. Improve language on "not found" messaging.
    
            Warn on possible 32-sound channel Flash ceiling/limit, which can occur when Flash tries to begin playback and fails to start.
    
            Documentation updates: How Clients Download Audio (Flash/HTML5 progressive download vs. byte streaming)
    
            Improved API Examples page design, two-column layout with navigation
  • V2.97a.20130324
    V2.97a.20130324 - Fix for playlist/event chaining when using flashVersion = 8 with Flash Player 11.6.602.171. HTML5 iOS load() fix. Added Opus to audio formats.
    
    Bug fixes
    
        Flash Player 11.6.602.171, released by Adobe on 02/26/2013, introduced an issue with SM2's default Flash 8 (flashVersion: 8) API-based JS/Flash interaction, where SM2 methods called from callbacks such as onfinish() would not work. This primarily broke methods used for playing sounds in sequence, serially loading a series of sounds and so on. (See discussion for more.)
    
        Note that this does not affect cases where soundManager.setup({ flashVersion: 9}) is being used; however, SM2 does use flashVersion: 8 by default.
    
        Specifically, Flash-initiated events (such as a sound finishing) make Flash -> JS calls to the SM2 API, which subsequently call user-specified event handlers. If the user-specified SM2 onfinish() handler immediately calls a SM2 method like play() that makes a JS -> Flash call, this call either silently fails or is blocked. Other JS + Flash libraries that use similar callback patterns may also be affected, if their SWF is built targeting the Flash 8 API.
    
        Suspecting a timing or recursion/stack issue, it was found that introducing a setTimeout(callback, 0) to user-specified SM2 callbacks like onfinish() restored sequential/playlist functionality.
    
        Flash Player 11.6.602.180, relased by Adobe on 3/12/2013, exhibits the same behaviour. To avoid additional hacks, SM2 applies this to all Flash 8-based API callbacks regardless of what version of Flash Player is installed. No regressions are anticipated as a result of this change.
    
        Alternately, this issue can be avoided by using soundManager.setup({ flashVersion: 9 }) as the Flash 9-based API does not appear to have this problem.
    
        HTML5: Fix for iOS load() case when using an auto-load and looping pattern (related discussion).
    
    API Updates
    
        HTML5: Added check for Opus (OGG-based audio codec, audio/opus).
    
    Miscellaneous
    
        Added documentation for Serving To Clients, and Mobile Device Limitations.
    
        Minor SM2 homepage + documentation CSS tweaks (design)
    
        This SM2 release is tagged "Mahalo Edition" to say thank-you, and because some SM2 work was done while on vacation in Hawai'i. Also, some new demo sound recordings from the beach on Kaua'i were added.
  • V2.97a.20130101
    e0a7da58 · New file sizes ·
    V2.97a.20130101 - Strict Mode. Android 2.3 HTML5 fixes, cleaner debug output, improved default flashblock handling. Confirmed compatibility with Firefox WMF-based HTML5 MP3 support. New reset() method, reboot() tweaks.
    
        Bug fixes
    
            HTML5: Reset last URL and load state for "singleton" (global HTML5 audio) case, on iOS + Android <= 2.3 for specific use case - createSound() -> play() -> destruct() -> createSound() -> play() with same URL/parameters.
    
            HTML5: Fix for Android 2.3 / Nexus 7 - they work better with the singleton HTML5 audio() instance as well, same as iOS, for chained (i.e., playlist-style) playback cases.
    
            soundManager.setup() now allows html5Test (regular expression, eg. /probably|maybe/i) to be passed. Was previously unrecognized/rejected.
    
        API Updates
    
            The SoundManager 2 core API (soundmanager2.js) now runs in Strict Mode, via "use strict";. This is scoped to a closure within soundmanager2.js, and should not cause issues when combined (rolled-up and/or minified) with other JavaScript code.
    
            New soundManager.reset() method. Similar to reboot(), but also nukes any registered onready() and related callbacks. Based on pull request from Github user jabr. Chaining is now possible too, e.g., soundManager.reset().setup({onready:function(){console.log('reset() complete, reboot OK')}});. Call soundManager.beginDelayedInit() to re-init after a reset().
    
            soundManager.setup({url:...}) + lazy-loading (dynamically-loaded JS) case: If setup() given a url parameter after DOMContentLoaded has fired, assume we should start right away. (Helps reduce need for beginDelayedInit() + "just works" for most users).
    
            Don't init inline after document.readyState === 'complete' (improve lazy-loading case, wait for setup() with url instead).
    
        Miscellaneous
    
            Prerelease Firefox builds can play MP3 audio via HTML5 in some cases, as part of a move to support H.264 video (see Bugzilla #799318 for details). Firefox 20 (nightlies, and Aurora channel builds in January 2013) can get native MP3 support via Windows Media Foundation (OS-level codec support) components on Windows 8, Windows 7, and soon, Windows Vista. As of 12/2012, OS X support is planned, and Windows XP support is not. (Disclaimer: Vista, OS X and XP notes sourced from comments on Hacker News; see links).
    
            When enabled with media.windows-media-foundation.enabled = true under about:config, Firefox may be able to play MP3s via HTML5 and thus get "100% HTML5 mode" when soundManager.setup({preferFlash: false}) is used.
    
            At time of writing (12/30/2012), Firefox 20 (nightly) returns "" for canPlayType('audio/mpeg; codecs="mp3"'), a test commonly used to query for MP3 support under HTML5 and one which works in other modern browsers. Firefox's behaviour differs because it is trying to follow the MPEG spec, which does not include an explicit MP3 MIME type. Instead, canPlayType('audio/mpeg'), which is in-spec, presently returns a "maybe" when MP3 is supported under Firefox.
    
            Improved SM2 console.log() debug output, aiming to be less "noisy". Core setup options are shown better at start-up, eg. "SoundManager V2.97a.20130101 (AS3/Flash 9) + HTML5 audio + preferFlash + html5PollingInterval (50ms) + flashBlock".
    
            Christmas light demo: Tweaks for iOS + Android touch devices.
    
            MP3 Player Button demo: Include HTML type (MIME hint) attribute, if specified.
  • V2.97a.20121104
    V2.97a.20121104 - HTML5 + iOS load fixes, Windows 8 App Store compatibility tweak, code pattern improvements.
    
        Bug fixes
    
            Fix HTML5 unload() -> play() case (re-use of same object without assigning new URL).
    
            More global (iOS) HTML5 object unload() / play() re-use tweaks, improved handling of re-use and empty / load() cases
    
            HTML5: Ensure instanceOptions are set after play() call results in load(). Noted instanceOptions not being set from within whileplaying().
    
            Fix call signature for Flash 8 load method, was tying usePolicyFile (enables remote crossdomain.xml request for ID3/waveform data on 3rd-party domains) to precence of whileloading() due to driver error. Derp. :D
    
            Windows 8 Store Apps (IE 10/"MSAppHost" in UA) don't support Flash or ActiveX, except for (at time of writing), three special ActiveX controls. Thus, new window.ActiveXObject('ShockwaveFlash.ShockwaveFlash') seems to work without error. However, an error is thrown if an <object> with a Flash ActiveX CLSID is appended to the DOM. http://msdn.microsoft.com/en-us/library/windows/apps/hh465143.aspx
    
        Miscellaneous
    
            Death to underscores! Removed legacy pattern of var _foo = ... for most private internals.
    
            Better typeof x === 'undefined' -> x === undefined pattern per newer jslint rules.
  • V2.97a.20120916
    V2.97a.20120916 - Inline, deferred and lazy-load init improvements, HTML5 format / detection improvements, "re-use" load/play URL fix.
    
        API Updates
    
            Init improvement: Don't fail if Flash URL is null in normal include + init case. Instead, show note in debug input and wait for soundManager.setup() with url param, then treat as delayed init case. Improved experience if including <script>, then trying to do setup() after DOM Ready (common jQuery case).
    
            soundManager.setup({url:...}) + lazy-loading (dynamically-loaded JS) case: If setup() given url parameter after DOMContentLoaded has fired, assume we should start right away. (Helps reduce need for beginDelayedInit() + "just works" for most users)
    
            Don't init inline after document.readyState === 'complete' (improve lazy-loading case, wait for setup() with url: instead)
    
        Bug fixes
    
            Fix 'audio/mpeg' canPlay() checks, was incorrectly returning false due to audio/mpeg; codecs="mp3" working and preventing audio/mpeg from being checked.
    
            More paranoid Audio() handling for "bad" Opera (< 10) where new Audio() would throw not_enough_arguments (always required URL).
    
            Safer HTML5 duration checks - null now assigned instead of undefined.
    
            Improve durationEstimate under HTML5 during whileloading().
    
            Flash 9/RTMP: Actually provide caption data to oncaptiondata().
    
            Fix SMSound.play({url:...}) "re-use" case where new URL wasn't being assigned + loaded right away, and SMSound.url property was not being updated.
    
            Correct load() and play() with new URL parameter, so that subsequent play() call uses new URL (and not URL assigned with original createSound() call).
    
            Use seconds for SMSound.buffered (time ranges) whether HTML5 or Flash, since SM2 API uses seconds for setPosition() etc.
    
            Correct play() -> pause() -> setPosition(0) -> play() -> pause() case where the latter wasn't firing due to invalid state.
    
        Miscellaneous
    
            New Cassette Tape UI Prototype/demo (experimental).
    
            Tweaked documentation layout for legibility. Webfont (deja vu sans mono) from dejavu-fonts.org for code examples.
    
            Improved lazy-load / deferred example based on new setup() logic
    
            Added SMSound.buffered documentation
    
            Added m4b extension as an mp4 format
    
            Safer initial HTML5 support checks
  • V2.97a.20120624
    V2.97a.20120624 - New soundManager.setup() method, numerous HTML5 improvements for createSound(), load(), progress and reuse cases, and minor flash audio bug fixes
    
        API: New sugar-like stuff
    
            New soundManager.setup() mixin-style method for assigning properties and common start-up callbacks. Collects top-level soundManager configuration properties and object collections - onready, ontimeout, defaultOptions, flash9Options and movieStarOptions - under a single method call.
    
            Upgrade / legacy note: This is a modern replacement for the direct property assignment method used in all previous versions - eg., soundManager.url = '/swfs/' - the old method continues to work for legacy support, but you should migrate to using the new method as it's much cleaner. All included demos use the new method where applicable.
    
            New soundManager.setup() method example
    
            soundManager.setup({
              // required
              url: '/path/to/swfs/',
              // optional
              flashVersion: 9,
              // convenience
              onready: function() {
                console.log('Ready to play sound!');
              },
              ontimeout: function() {
                console.log('SM2 start-up failed.');
              },
              // more custom parameters
              defaultOptions: {
                volume: 50
              }
            });
    
            See soundManager.setup() for details.
    
        Bug fixes
    
            Improve HTML5 audio load/playback reliability + stability on iOS, and for object reuse cases (play() -> load({url: ...}). Prior behaviour was making initial HTTP request when object was created (meta/preload, not necessarily loading entire file.) Request now only happens with preload/load/play-related calls.
    
            HTML5: Firefox seems to have changed when unloading HTML5 audio, url = '' now loads hosting page HTML (boo) instead of null / no request. Changed to about:blank like everyone else. Also fixed boolean logic on isMovieStar assignment.
    
            Add audio/mp3 and related MIME checks for flash, correct edge case where play({type:'audio/mp3'}) would use HTML5 when preferFlash = true, due to seeming lack of Flash support for the MIME type.
    
            Fixed old Flash 8 onload() edge case where loading from cache might return incorrect didLoad: false result - corrected by checking for a non-zero sound duration.
    
            Properly reset SMSound.id3 = {} with internal resetProperty and public methods like load().
    
            Edge case fix: Don't attempt to remove flash unless reference exists (prevent false warning when reboot() called in 100% HTML5 mode.)
    
            Correct empty options JS error on internal _setup_html5() when reusing HTML5 audio object per V2.97a.20120527 bug report
    
            Fix minor false positive (undocumented error handler case) with HTML5 play() falsely reporting 32-sound ceiling edge case and calling SMSound.onplayerror() (if assigned) when using flashVersion = 9. Should only apply when flash 9 is being used for playback, and ceiling hit.
    
        Miscellaneous
    
            Finally assign + use SMSound.id (instead of sID), matching createSound({id: 'foo'}) pattern; maintain legacy sID property (ancient behaviour, originally intended to avoid potential namespace conflicts many years ago - now silly and not a concern.)
    
            Improved handling of whileloading() vs. HTML5 onload (when using HTTP range/partial requests).
    
            HTML5 onload() (now triggered via native canplaythrough event) may fire early, followed by numerous HTML5 progress requests during playback as the audio object requests and buffers more audio ranges (eg., 0-10 seconds), eventually matching the total sound duration.
    
            Bytes loaded / total are not available, so bytesLoaded instead reflects a fraction of "duration loaded", between 0 and 1 as data is buffered in. Previously, whileloading events would not fire once onload had fired under HTML5.
    
            New (undocumented, for now) buffered array on SMSound objects; list of objects following the pattern SMSound.buffered = [{ start: 0, end: 706 }] representing loaded time ranges (somewhat similar to HTML5 TimeRanges spec, but using static properties instead of method calls with an index parameter.) Array will initially be empty, zero-length. This can be looped through to show overlays of "loaded" time fragments on progress bars, for example.
    
            SMSound buffered is updated during whileloading() calls, where values are provided by the browser. For flash, will always be one item with { start: 0, end: SMSound.duration } assigned. Also stopped sending 1/1 values to whileplaying() at onload(), since HTML5 can fire onload() (via canplaythrough) very early followed by many progress (whileloading()) events.
    
            Support note: Not all browsers (eg., Safari 5.1.7) appear to provide buffer / TimeRanges data for HTML5 audio objects. At time of writing (06/2012), Firefox, Chrome Canary, IE 9 and Opera provide TimeRanges alongside progress events.
    
            Upgraded demos to use to soundManager.setup({...}) for most configuration cases (vs. setting soundManager.url, soundManager.defaultOptions.autoLoad directly etc.)
    
            Warn if soundManager.setup() called with url or flashVersion, and init has already fired (ie., flash options already set + movie already loaded) where changes will not take effect until soundManager.reboot().
    
            Assign top-level soundManager properties (eg. soundManager.url) from soundManager.setupOptions at DOMReady time; this allows legacy soundManager.url = ... assignment to work, and helps to ensure legacy-style, directly-assigned top-level property values get written back to soundManager.setupOptions.
  • V2.97a.20120527
    31c95c5b · Latest build ·
    V2.97a.20120527 - Fix for ontimeout() regression. GWT/JSNI compatibility, slow connection and Safari "background tab" SWF load handling improvements
    
        Bug fixes
    
            Fix for ontimeout() regression seen when using lazy-loading / SM2_DEFER introduced with V2.97a.20120513; bug introduced when making edits to pass newer jslint rules regarding return within if...else blocks.
    
            Replaced instanceof Function with "safer" typeof x === 'function' for onready(), ontimeout() and related callback argument checks as GWT + JSNI was passing arguments that failed the instanceof check. (Related bug report.)
    
            Corrected another small regression for the ontimeout() -> onready() "recovery" edge case, ensuring "ready" does not fire after a timeout when init was unsuccessful.
    
        Miscellaneous
    
            Improved handling for special Safari page load case: When a new tab is opened that does not have focus, the Flash SWF does not load/init until the tab is brought to the foreground. SM2 now recognizes this special case and waits until window.onfocus() before attempting to do the JS/Flash part of init. Previously, it would fail with a timeout.
    
            Code written to originally handle Safari 3.1, which did not support document.hasFocus(), was modified and updated for this purpose. The Safari 3.1 logic previously deferred SM2's start-up in a similar fashion. (The old Safari 3.1 mousemove() focus-detection hack has been removed as Safari 4 has been out since mid-2009, and Safari 5 since mid-2010.)
    
            SM2 init process will now delay and retry if no Flash response, and SWF has loaded > 0 and < 100%. Timeout will now happen only after delay and when SWF has loaded 100%. Should help prevent first-visit (non-cached) failure on very slow or laggy connections.
    
            Added note about potential Firefox regression: Offline JS/Flash start-up (viewing HTML pages via file:// and/or c:/ and so forth), possibly not working as of Firefox 9 and newer (at time of writing, also up to and including Firefox 12), even despite special security whitelisting under Flash Player "trusted locations" preferences / control panel.
    
            After successful Flash -> JS call, SM2's "return" JS -> Flash call fails with unusual JS/Flash exception, "Error in ActionScript" error with no further detail. Offline viewing still works in other browsers.
  • V2.97a.20120513
    V2.97a.20120513 - Fixes for Android 2.3 playback, onPosition() in HTML5, Flash 9 double-play edge case. Minor new Flash 9-specific features.
    
        Bug fixes
    
            Android 2.3 playback fix (some sounds started only after 2+ play attempts due to Android not liking load() immediately followed by play()?)
    
            onPosition() fix for HTML5 playback, items were mistakenly being removed.
    
            Fix RTMP stream duration reporting via onmetadata() (wrong value was being returned, previously.)
    
            Fix for Flash 9 double-play edge case found with pause() + setPosition() calls.
    
            JSLINT validation per 04-15-2012 edition rules, mostly removal of multiple return statements within if ... else blocks and inverted loop tricks.
    
        API updates
    
            Enabled waveform/eq/spectrum data features for MovieStar (H.264/NetStream content.)
    
            Added oncaptiondata() callback for caption data from Flash 9 (NetStream/RTMP-only, similar to onmetadata(). Contributor: GitHub user karma.)
    
            Added SMSound.onplayerror(), presently for Flash 9 (non-MovieStar/NetStream) which can detect lack of available sound hardware or 32-channel ceiling as reasons for playback failure.
    
            Added oncaptiondata() callback for caption data from Flash 9 (NetStream/RTMP-only, similar to onmetadata().)
    
        Miscellaneous
    
            Scaling added to 360 UI (via GitHub user tomasdev)
  • V2.97a.20120318
    ba28eeae · +archived download ·
    V2.97a.20120318 - Minor updates. from / to and onplay() bug fixes, canPlayMIME() and canPlayLink() Flash-specific corrections.
    
        Bug fixes
    
            Fix silly undefined"soundID" debug output message shown at SMSound.onload (now says SMSound._onload() as previously.)
    
            soundManager.sounds = {} instead of [] on reboot (per bug report)
    
            Fix logic for calling onplay(), was always non-truthy. D'oh!
    
            Add missing typeof to fix html5 MIME check for playability tests
    
            Don't apply width:auto to SWF (invalid per HTML5, allegedly: Related patch.)
    
            Make soundManager.canPlayMIME() and canPlayLink() check flash support before returning (check after ontimeout() was returning truthy when flash required under Firefox, for example, for 'audio/mp3')
    
            Fix play() "from" + "to" sound sprite playback issue: In some cases, previously-fired "to" events were re-firing due to not being removed, because an equality check was comparing against a potential "to" value of a string rather than a number. (eg., 0-700 followed by 1500-2000; playback would stop in second case, saying 700 had been reached. (Related bug report.)
    
            Re-appeased the jslint gods, removed unused variables and two-statement reverse loop (for i=x; i--;) { } trickery.
    
        Miscellaneous
    
            The SoundManager project turned 10 years old, having originally launched in late 2001. Thanks for using it!
  • V2.97a.20111220
    V2.97a.20111220 - HTML5 src/onload()/onstop() fixes, new HTML5 polling, onPosition() updates, "audio sprites" (from/to) and multiple URL support. (Also: New homepage design!)
    
    Fixes for HTML5 audio including redundant src assignment, onload and onstop. New html5PollingInterval property, onPosition() and clearOnPosition() methods, "audio sprites" support via from and to parameters. Updated onposition() sound method, added new onposition sound parameter, and multiple URLs / URL formats now allowed for a sound. Also: Version checking between JS and SWF, brand-new optimized homepage design and demo UI tweaks + optimizations.
    
        Bug fixes
    
            HTML5: Fixed Audio() src attribute re-assignment bug seen in createSound()->play() use case.
    
            HTML5: mySound.load({onload:function(){}}) callback fixed so it works.
    
            HTML5 + Flash: onload() now called immediately when load({onload:function(){}}) is used on a sound with the same URL which has already loaded.
    
            onstop() now mimics onfinish() in terms of sequence. HTML5 sets position to 0, but retains pre-stop() position property value (like Flash does.)
    
            Amazon Kindle Fire UA looks like Safari on OS X 10.6.3, but does not have broken HTML5 audio (i.e., intermittent playback failure) like the "isBadSafari" case.
    
            MovieStar/NetStream (non-RTMP) edge case: Correct onfinish() after play() and a seek so that it always fires. Remove metadata() after first call (as it was) for non-RTMP. Reduce buffer-near-end logic to 3 seconds from 5.
    
            Flash 9 MovieStar/RTMP: Only fire onconnect() for RTMP (was firing for flash 9/NetStream, too, breaking MovieStar createSound({autoLoad:true,onload:function(){this.play()}}) case.)
    
            RTMP: Exclude RTMP from 30-second resume() reposition hack (streaming does not have this issue.) May have been breaking buffer due to seek on resume.
    
            Fix edge case where soundManager.waitForWindowLoad = true (non-async startup case), but _initComplete() may fire after window.onload() and thus onready() never fired.
    
        API updates
    
            Added soundManager.html5PollingInterval property, for increased whileplaying() callback frequency (higher UI framerates) similar to flashPollingInterval. (By default, null/off.) Also excludes mobile (eg., iOS) by default.
    
            soundManager.onPosition(): Queues a callback that will be fired each time a sound reaches a given position during playback. Applies for the life of the sound object.
    
            soundManager.clearOnPosition(): Removes onPosition() callback(s) from a sound, by position and/or callback. (If no position or callback are specified, then all callbacks are cleared for the given sound.)
    
            Optionally, an onstop: function(){} handler can be passed to capture the moment when "to" is reached. When using Flash, sound is preloaded 100% in order to guarantee playback can start at the "from" position.
    
            Added support for "audio sprites." New sound options, from and to allow segments, samples or slices of sound to be played. eg., mySound.play({ from: 5000, to: 10000});
    
            New sound option, onposition, defines times and related callbacks for positions of interest within a sound. Applies on a per-play basis. eg. onposition: {500: function(p) { console.log('position ' + p + ' was reached.') } }
    
            Experimental: Multiple formats/encodings support in the sound url parameter; now accepts an array as an alternate to a single string. eg. soundManager.createSound({id:'foo', url:['bar.ogg','bar.mp3']}); - SM2 will use the first playable URL it finds and the URL property will then reflect the one URL after that point. Note that this means the original array data will be lost.
    
            Also accepts type attributes, eg. url:[{type:'audio/mp3',url:'/path/to/play.php?song=123'},...] - useful for URLs without obvious filetype extensions.
    
            Flash 9 + MovieStar (NetStream) / RTMP: onmetadata (sound parameter) callback, allows capturing of metadata events from flash (eg., streaming song / title updates) similar to onid3(). Can now fire multiple times, eg., when RTMP streaming and new song / artist info is provided.
    
            Added JS version + Flash SWF build/version check to SM2 during start-up. (Finally! :D) ... Will now throw new Error() if soundmanager.js version reports V2.97a.20111030 and SWF version is V2.97a.20110918, for example. (Happens when upgrading/replacing old versions of SM2, you may forget to update one of the SWFs etc.)
    
        Miscellaneous
    
            Homepage: Brand-new, shinier design, improved three-column layout; looks better even in IE 6. Small UI tweaks on inline demos. Combined demo JS + CSS files for performance; cut HTTP requests by over 50% (now down to 14 HTTP requests in most cases) via concatenation and data: URIs for some background images and sprites.
    
            360 player demos: Updated UI with more circles and a few gradients, border-radius etc. Small 50x50 UI is now clickable over entire area, rather than small circular button.
    
            Demos: Some data: URIs added to inline player and 360 player for performance (reduced HTTP requests.) Christmas lights demo now uses YUI 3 seed + animation.
    
            soundManager.useConsoleOnly = true by default, was previously false. New "true" default means no HTML debug output if console.log() is available.
    
            soundmanager2.js: Micro-optimizations, further -nodebug-jsmin optimizations and minor comment formatting. Eliminated last Google Closure Compiler warning (caused by an empty "if" block.)
    
            Debug output no longer shows "loops: 1" (redundant), only interesting values eg. 2+ are reported.
    
            Documentation: Small theme tweaks, textured background and re-organization of properties (left menu) for easier navigation. Fixed "onsuspend" event labeling, clarify SMSound events as properties and not methods. Re-sorted property lists, tidied up code formatting. Added missing soundManager.onPosition() documentation (side note: previously named onposition(), old lower-case method name maintained for backward compatibility.)
    
            Page player / Muxtape demos: Removed useMovieStar sound option - no longer exists, redundant.
  • V2.97a.20111030
    8d9213ea · Updated file size charts ·
    V2.97a.20111030 - HTML5 unload() improvements, Android 2.3 fix and new onsuspend() event
    
    Fixes for HTML5 unload() on Webkit (connection was not closing), playback on Android 2.3, and IE 9 "not implemented" / unsupported HTML5 case. Addition of onsuspend() HTML5 event, possibly applicable to iOS where stalled events suggest that user action is needed to play or resume audio playback.
    
        Bug fixes
    
            HTML5 unload(): Correctly apply about:blank (_emptyURL default) to everyone except Firefox, which allegedly likes ''. Webkit was not actually closing the connection of loading streams, in this case.
    
            HTML5 audio playback fix for Android 2.3 (Honeycomb), which doesn't seem to like new Audio('foo.mp3') followed by load() -> play(); first request/attempt stalls and eventually fires ended event. Rather odd. (Related discussion.)
    
            Added try...catch for dumb IE 9 Audio() "not implemented" error in Windows server case without "desktop experience" installed, means no HTML5 audio/video support. Hat tip: Modernizr issue 224
    
        API updates
    
            Added soundManager.noSWFCache (boolean) for easy cache busting - good for dev/testing. SWFs tend to be aggressively cached by browsers, especially in offline cases.
    
            HTML5 suspend events are now listened for and fired via SMSound option onsuspend(). This event may be the best way to detect when mobile Safari (eg. iOS) is blocking autoplay-style behaviour, and user interaction is required to start or resume playback.
    
        Miscellaneous
    
            Fix "playable MP3 links" demo for iOS, playing 2nd+ sound now works. Due to single sound object reuse, "old" sound must be paused before new one is created. Previously, playing sound 1 -> sound 2 -> sound 1 would fail.
    
            Tweaked 360player behaviour to support being initialized multiple times (for dynamic content, "decorating" new MP3 links etc.)
    
            Modified soundManager core property documentation to be multi-line, allowing longer comments
  • V2.97a.20110918
    26c566fb · V2.97a.20110918 ·
    V2.97a.20110918 - Code clean-up, improved comments and formatting, generated documentation, polling and onbefore- removal, HTML5 stop()/unload() fixes
    
    Added block comments above major SM2 methods (and Docco-generated documentation), more line breaks for consistent vertical spacing and readability, removal of onbefore-related SMSound options, allowPolling + useFastPolling features. Improved build task optimizing of -nodebug JS build, removing comments, extra line breaks and debug code blocks which were previously only commented out.
    
        Bug fixes
            HTML5 unload: Gecko can use url = '' to cancel request etc., others seem to need about:blank or similar empty URL (matching Flash 8.)
            HTML5 stop(): Don't call unload() here (file under "durrr." This fixes a few state-related bugs.)
            Fire the onposition callback after setting item.fired, instead of before. This allows looping in the form of mySound.onposition(200, function(){ mySound.setposition(100); });
            Fix movieStar (MPEG-4) handling for URLs without MIME hints (eg. a URL ending in .php) if type: 'audio/mp4' is passed, for example. (Possible regression introduced with V2.97a.20110801, one report was received.)
            Fire onposition() after increasing the internal "onPositionFired" counter.
    
        API updates
    
            Clean-up time! The following soundManager properties have been removed as they're ineffective and/or have modern replacements:
    
            soundManager.nullURL = 'about:blank'; (internalized; search for 'about:blank' in the source if you want to customize it.)
    
            soundManager.allowPolling = true; (ignored, always true now. whileloading() / whileplaying() calls rely on it.)
    
            soundManager.useFastPolling = false; (redundant, now determined by flashPollingInterval now being specified as a number eg., 20, instead of the default of null.)
    
            The following SMSound (sound options) have been removed, in favour of modern replacements (and also didn't work with HTML5 sounds.)
    
            soundManager.defaultOptions.onbeforefinish = null;
            soundManager.defaultOptions.onbeforefinishtime = 5000;
            soundManager.defaultOptions.onbeforefinishcomplete = null;
            soundManager.defaultOptions.onjustbeforefinish = null;
            soundManager.defaultOptions.onjustbeforefinishtime: 200;
    
            As a replacement, use the SMSound.onposition() method to assign an event callback handler to fire at the relevant time.
    
            mySound.onposition(10000, function() {
              console.log('the sound ' + this.sID + ' is now at position ' + this.position);
            });
    
            If you need to fire an event relative to the true end of the sound, reference its duration once the sound has fully-loaded - ie., at or after the onload() event - as the duration will not be completely accurate until that time. durationEstimate may be referenced before onload(), but it should not be relied on when "precise" timings of say, < 1 second are desired.
    
            mySound.load({
              onload: function() {
                this.onposition(this.duration - 5000, function() {
                  console.log('the sound ' + this.sID + ' is now at position ' + this.position);
                }
              }
            });
    
            Again, note that due to the interval / polling-based methods of both HTML5 and flash audio, sound status updates and thus precision can vary between 20 msec to perhaps 0.5 seconds and the sound's position property will reflect this delta when the onposition() callback fires.
    
            Added soundManager.onposition() (forgot to mirror the SMSound method)
    
            Privatize soundManager.netStreamMimeTypes, etc. soundManager.mimePattern, the resulting one applied to canPlayMIME() etc., is still exposed.
    
            Simplify getMovie() to use _id(smID) || _doc[smID] || _win[smID] rather than IE / Safari special checks. Sometimes (old?) IE and Safari would return null on getElementById(), but window[id] or document[id] would work. Presumably related to Flash + ExternalInterface wackiness.
    
        Miscellaneous
            Reviewed soundmanager2.js code for readability and comments. Added linebreaks, spacing and block-style comments around main functions.
            Added generated documentation via "Rocco" (ruby port of Docco.)
            Added build.xml notes re: Closure compiler, MTASC and where to find working builds
            Modified soundmanager-nodebug.js build so comments and debug blocks are removed entirely from the code. Double-spaced linebreaks are also removed.
            Removed executable permissions from almost all files
            parseInt() on soundManager.flashVersion, invalidate strings like "9"
            Use 10 / 50 msec polling interval for high performance mode vs. regular mode
            Page cache/unload/restore (back button case): Only apply window unload event if using flash, since plugin is more likely to break (ie., state won't be recalled correctly.)
  • V2.97a.20110801
    V2.97a.20110801 - "100% HTML5 mode" desktop browser (+no flash) fix, useHTML5Audio enabled by default, flash 9 end-of-sound correction, ClickToFlash improvements
    
    Last release introduced a regression with HTML5-only mode on desktops when flash was not installed/present, now fixed; HTM5 audio support is enabled by default, although flash is still preferred for MP3/MP4 by default. probably|maybe is now the default when testing HTML5 format support. Flash 9 now does not reset sound position to 0 at onfinish(), matching flash 8 and HTML5 behaviour. Better ClickToPlugin / ClickToFlash compatibility (CSS tweaks for display of blocked SWF.) Minor internal flash polling loop improvements. soundManager onload, onerror and oninitmovie events have been deprecated in favour of onready() and ontimeout(), but remain functional.
    
        Bug fixes
            A regression was introduced in V2.97.20110706 where SM2 would fail to start in HTML5-only mode on supported desktop browsers when flash was disabled or not installed, eg., Safari on new Macs or IE 9 without flash. (iOS was not affected.) This has been fixed with the 2.97.20110801 release.
    
        API Updates
    
            soundManager.useHTML5Audio is now true by default; however, soundManager.preferFlash is also true and HTML5 browsers will still attempt to use flash for playing MP3/MP4 by default, if those formats are marked as "required".
    
            If you wish to have 100% HTML5 mode in more cases, set soundManager.preferFlash = false. Presently, the MP3 links and MP3 button SM2 demos are more HTML5-friendly and will serve as a test for exposing bugs that may be in the wild.
    
            soundManager.html5Test has been relaxed to use (probably|maybe) for Audio's canPlayType() test (previously, was only "probably") - so formats will be more likely to work on HTML5-only devices that conservatively report "maybe" for MIME types like audio/mpeg; codecs="mp3" at this point.
    
            Certain mobile and tablet-like devices are special-cased as preferring HTML5, and will ignore checking for flash altogether; this presently includes the iPad, iPhone and iPod, Palm Pre and Motorola Xoom.
    
            The HTML5 audio "loadeddata" event triggers an SMSound onload() event, which now fires whileplaying() and tries to pass identical bytesLoaded, bytesTotal parameters so that UIs will correctly show the sound as fully-"loaded" - even if in truth, not all bytes have actually been fetched (depending on the browser and server, etc.) because of the ability to do arbitrary seeking.
    
            Updated Flash 9 onfinish() / end-of-sound behaviour: Sound objects' position property no longer resets to 0 when a sound ends (and when onfinish() fires.) This now matches both HTML5 and flash 8's existing behaviour; therefore, a sound's position will equal its duration at onfinish() in all cases now. In the event play() is called from the end of a sound at or after onfinish(), the sound's position will be set to 0 before playback begins if using flash 9.
    
            Edge case covered: if at internal SOUND_COMPLETE the SMSound.position is < its duration, flash will match position to duration and fire whileplaying() one last time so "100%" is always reached before onfinish() is called.
    
            multiShot + multiShotEvent case has been verified as working (eg. onfinish() fires 5x if play() called 5x.)
    
            soundManager.onload, soundManager.onerror and soundManager.oninitmovie have been deprecated in favour of soundManager.onready() and soundManager.ontimeout(). The deprecated methods are still present and work with this release, but you should migrate to their modern replacements.
    
        Miscellaneous
    
            Flash 8 + 9 internal whileplaying() + whileloading() polling improvements: Internal check previously looped through all sounds from onLoad(), registerOnComplete(), _load() and _setPosition(). Now only the relevant sound is checked.
    
            Improved HTML5 support debug ouput/messaging, now right up top. Better messaging and error handling when Flash isn't present, yet required case (Flash plugin either not installed or disabled, but needed in some cases) - eg., Firefox and audioFormats.mp3.required = true; ... Also, only one _detectFlash() call now made.
    
            Playable MP3 links and MP3 button demos use soundManager.preferFlash = false, so they should be able to run in 100% HTML5 mode. Some HTML5 bugs are anticipated, and these may help to reveal issues via a smaller audience.
    
            Initialization code reorganized, minor edits and clean-up, removal of some unused objects and ternary optimizations per jslint
    
            Cleaned up IE <object> code, added highPriority flash param (affects flash 10.1+, if at all.)
    
            Improved flashblock handling / compatibility (CSS layout tweaks) with newer ClickToPlugin/ClickToFlash Safari (5.0.6 / 5.1+) extensions.
    
            SM2 homepage demos try HTML5 + Flash if available, with "safe" reboot + fallback to HTML5-only mode (if supported - eg., Safari with flashBlock/ClickToFlash.)
    
            Basic MP3 player demo: Fix event JS error when manually calling things like basicMP3Player.handleClick({target:document.getElementById('foo')});
    
            Flash SWFs, debug versions: Mention right-click -> security panel options when troubleshooting security errors
  • V2.97a.20110706
    V2.97a.20110706 - improved HTML5/flash "mixed mode" via preferFlash, Safari + Snow Leopard HTML5 audio bug update, better ClickToFlash compatibility, minor demo tweaks
    
    Special note: This was V2.97a.20110705, but the latest Flex SDK (4.5.1.21328) was downloaded and used for this build, and it compiled a Flash 9 SWF that wouldn't fully-start on some Windows machines running Firefox and IE 7, possibly others - thus, SM2 would fail to start up. The Flash 9 SWFs are now compiled with an older, working SDK version 4.1.0.16076, used in previous working releases. See discussion for more details.
    
    Improved "mixed mode" HTML5/flash handling via new (experimental) preferFlash option, enabled by default. (If present, MP3/MP4 get flash for stability; HTML5 is used for other formats.) OS X 10.6.8 (finally?) fixes HTML5 audio in Safari. SoundManager 2 SWF adjusted to fall under ClickToFlash's "invisible" rules, may lower chance of blocking.
    
        Bug fixes
            ClickToFlash (Safari/Mac flashblock-style extension) compatibility improvement: Use width/height: auto on SWF instead of 100%. The latter is not recognized as being within ClickToFlash's <= 8x8px "invisible flash" rules, almost guaranteed to be blocked. (When considered "invisible", SWF is allowed to load normally if user has the invisibles option enabled.)
            Flash blocking/handling improvements: Default #sm2-container size now always 8x8px to fall under "invisible" flash rules, better chance of load being allowed. If blocked and using flashblock.css, #sm2-container reverts to 48x48px at ontimeout() for visibility (so user can see, and unblock the flash bit.)
            OS X 10.6.8 "pre-Lion release" update finally appears to have fixed the broken Safari HTML5 audio issue. Thus, audio was broken from OS X 10.6.3 to 10.6.7 and SM2 will use Flash for these known cases. Related: Testcase and Webkit bug #32159.
            HTML5 audio: Playback now does not start after a setPosition() call (if the sound was not already playing), or if it was paused - matching the existing Flash API behaviour.
            Fix ontimeout() queue incorrectly processing after onload() and successful startup.
            Debug output: extraneous "%s" fixes for onready() / ontimeout()
    
        API Updates
    
            Added experimental soundManager.preferFlash (default:true) for a more consistent MP3/MP4 playback option in certain HTML5 cases. If using soundManager.useHTML5Audio + preferFlash and flash is available, flash will be used for MP3/MP4.
    
            HTML5 is still new and relatively unstable, and bugs are yet to be found and fixed across a growing number of browsers/platforms etc. (consider that it was broken on Safari between OS X 10.6.3 and 10.6.7.) If flash is not installed or preferFlash = false, 100% HTML5 mode can still apply. In any event, HTML5 will still be used (if enabled) for all other formats.
            Moved internal html5Only to (experimental) soundManager.html5Only, for detecting "HTML5-only mode" - eg., iOS, Safari without preferFlash or other environments where SM2 is operating without the flash portion of SM2.
    
        Miscellaneous
            Improved "can play" detection (canPlayURL() + canPlayMIME()) for HTML5 + flash cases. Increased "getting impatient, waiting for flash" message to 1 second.
            360°, inline, MP3 button players: Event add/remove: use addEventListener based on typeof attachEvent === null (old IE behaviour)
            MP3 player button demo: Fix IE 6/7 display issue on button (d'oh!)
            Muxtape-style demo: Added pagePlayer.playPrevious(), to match pagePlayer.playNext() (call when a sound is currently playing.)
            Fixed 360° player basic visualization demo (missing class in HTML), clarified canvas support (no eq/spectrum) re: IE <9.
            360° UI: Old "empty element doesn't catch mouse events" bug apparently still applies to IE 9. Fix with invisible background image.
            Minor homepage stylistic updates, source code order change for API docs (CTRL-F search now hits left column first)
            Small debug output clean-up in SM2, object/embed, init etc.
  • V2.97a.20110705
    V2.97a.20110705 - improved HTML5/flash "mixed mode" via preferFlash, Safari + Snow Leopard HTML5 audio bug update, better ClickToFlash compatibility, minor demo tweaks
    
    Improved "mixed mode" HTML5/flash handling via new (experimental) preferFlash option, enabled by default. (If present, MP3/MP4 get flash for stability; HTML5 is used for other formats.) OS X 10.6.8 (finally?) fixes HTML5 audio in Safari. SoundManager 2 SWF adjusted to fall under ClickToFlash's "invisible" rules, may lower chance of blocking.
    
        Bug fixes
            ClickToFlash (Safari/Mac flashblock-style extension) compatibility improvement: Use width/height: auto on SWF instead of 100%. The latter is not recognized as being within ClickToFlash's <= 8x8px "invisible flash" rules, almost guaranteed to be blocked. (When considered "invisible", SWF is allowed to load normally if user has the invisibles option enabled.)
            Flash blocking/handling improvements: Default #sm2-container size now always 8x8px to fall under "invisible" flash rules, better chance of load being allowed. If blocked and using flashblock.css, #sm2-container reverts to 48x48px at ontimeout() for visibility (so user can see, and unblock the flash bit.)
            OS X 10.6.8 "pre-Lion release" update finally appears to have fixed the broken Safari HTML5 audio issue. Thus, audio was broken from OS X 10.6.3 to 10.6.7 and SM2 will use Flash for these known cases. Related: Testcase and Webkit bug #32159.
            HTML5 audio: Playback now does not start after a setPosition() call (if the sound was not already playing), or if it was paused - matching the existing Flash API behaviour.
            Fix ontimeout() queue incorrectly processing after onload() and successful startup.
            Debug output: extraneous "%s" fixes for onready() / ontimeout()
    
        API Updates
    
            Added experimental soundManager.preferFlash (default:true) for a more consistent MP3/MP4 playback option in certain HTML5 cases. If using soundManager.useHTML5Audio + preferFlash and flash is available, flash will be used for MP3/MP4.
    
            HTML5 is still new and relatively unstable, and bugs are yet to be found and fixed across a growing number of browsers/platforms etc. (consider that it was broken on Safari between OS X 10.6.3 and 10.6.7.) If flash is not installed or preferFlash = false, 100% HTML5 mode can still apply. In any event, HTML5 will still be used (if enabled) for all other formats.
            Moved internal html5Only to (experimental) soundManager.html5Only, for detecting "HTML5-only mode" - eg., iOS, Safari without preferFlash or other environments where SM2 is operating without the flash portion of SM2.
    
        Miscellaneous
            Improved "can play" detection (canPlayURL() + canPlayMIME()) for HTML5 + flash cases. Increased "getting impatient, waiting for flash" message to 1 second.
            360°, inline, MP3 button players: Event add/remove: use addEventListener based on typeof attachEvent === null (old IE behaviour)
            MP3 player button demo: Fix IE 6/7 display issue on button (d'oh!)
            Muxtape-style demo: Added pagePlayer.playPrevious(), to match pagePlayer.playNext() (call when a sound is currently playing.)
            Fixed 360° player basic visualization demo (missing class in HTML), clarified canvas support (no eq/spectrum) re: IE <9.
            360° UI: Old "empty element doesn't catch mouse events" bug apparently still applies to IE 9. Fix with invisible background image.
            Minor homepage stylistic updates, source code order change for API docs (CTRL-F search now hits left column first)
            Small debug output clean-up in SM2, object/embed, init etc.
  • V2.97a.20110424
    V2.97a.20110424 - Minor HTML5 tweaks, option inheritance fixes, improved build.xml file
    
    HTML5 bulletproofing, Audio(null) argument fix for iOS + Opera, load() vs. createSound() and setVolume()/setPan() options/inheritance correction
    
        Bug fixes
            HTML5: new Audio(null) fix for differences between iOS (which would try to load null) and Opera 9.64, which would throw a WRONG_ARGUMENTS_ERR if null was not passed.
            HTML5: Restrict internal volume value range to 0..1, avoid DOM exceptions.
            HTML5: load{url:x}) improvements for desktop, better old vs. new URL comparison.
            HTML5, iOS 4.2/4.3+, SM2 Muxtape/inline/link demos: onfinish()->unload()->playNext() was breaking on newer iOS versions, "play through" affected. Removing unload() for iOS fixed issue.
            Flash object/embed pluginspage/codebase attribute now uses http:// when being used from file:// (offline), and http/https-agnostic //macromedia.com syntax to avoid SSL mixed-content warnings.
            Fix setVolume() / setPan() to properly update SMSound.options (when not "instance-only"), so settings are retained for future play() calls. Bug was that original volume/pan were incorrectly restored after the first instance completed.
    
        Miscellaneous
    
            New and improved (nearly platform-independent) build.xml file, thanks to github user "dolmen". A .build.properties file is now needed, defining "mxmlc", "mtasc", and "closure-compiler.jar" paths. e.g.:
    
            <!-- .build.properties file in SM2 root -->
            mxmlc=/Applications/flexsdk/bin/mxmlc
            mtasc=/Applications/mtasc/mtasc
            closure-compiler.jar=${user.home}/compiler.jar
    
            Running ant from the SM2 root will build the no-debug and minified versions of the script, as well as the SWF files.
  • V2.97a.20110306
    V2.97a.20110306 - HTML5 audio updates, Flash/HTML5 mode detection, IE flash init tweaks, reuse and instance options fixes
    
    Bug fixes and improvements for HTML5 audio (object reuse on iOS), improved URL comparison. onfinish() -> this.play() instance option fix. IE flash wmode initialization tweak. Flash/NetStream (MP4) unpause()/resume() hack now applies to everyone. If no flash found (eg., new Mac desktops), HTML5 audio will now be tried. Make hasPriority actually work (d'oh!)
    
        Bug fixes
            HTML5: _resetProperties() when setting Audio().src, fix sound1.play() -> sound2.play() -> sound1.play() case on iOS 4.1 not correctly re-assigning original sound URL (related to global audio object.)
            HTML5 audio: If no flash, try forcing useHTML5Audio = true (eg. desktop safari on new Macs which don't come with Flash.) Related: flash detection code tweak.
            Improved _iO vs. old _iO URL comparison, rather than .src which gets translated from local paths to file:// etc.
            Correctly trash instanceOptions (and _iO) before calling onfinish(), but maintain local copy of onfinish() so it still works. Fix play({onfinish:this.play}) bug where _iO was being incorrectly remembered.
            Flash 9/movieStar: setPosition() unpause hack for everyone, not just Webkit (via 8tracks dudes, reported now in Firefox? Should not cause regressions.)
            Special wmode tweak for reports of SM2 start-up failures, may be admin/non-admin account related, IE 8-only on Windows 7 (possibly Vista, too?) as of late January, 2011.
            Apply hasPriority to object/embed, not its style. D'oh. :P
            HTML5: use new Audio(null) vs new Audio(), Opera 9.64 expects URL argument; throws WRONG_ARGUMENTS_ERR otherwise. Doesn't implement canPlayType() either, but both are fixed in future releases.
    
        Miscellaneous
            Don't actually apply new value in setPosition() if a sound has not yet loaded (and if so, hasn't errored out.)
            isNaN() check for HTML5 loading (saw one under Safari, in testing).
            Added CLSID and codebase attributes for IE <object> (same as used in SWFObject), just to be safe.
            Removed some HTML5 debug bits, unused _HTML5_states/codes block.
            Flashblock CSS: Correctly hide the SWF via left/top:-9999em when it hits .swf_loaded {}, ie., never blocked in the first place. Minor flashblock regression fixes after .swf_loaded / .swf_unblocked changes with last release.
            Ant build script parameter change, now uses .build.properties file (related pull request)