Skip to content
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