-
V2.97a.20111220fa9c78c8 · ·
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.201110308d9213ea · ·
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.2011091826c566fb · ·
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.2011080119d86a7c · ·
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.201107063a21105d · ·
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.2011070543e5ae43 · ·
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.20110424b65c9d09 · ·
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.20110306054b4ed0 · ·
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)
-
V2.97a.201101238bc4fc45 · ·
V2.97a.20110123 - HTML5 audio improvements for desktop + mobile (iOS), 360° UI demo tweaks Tweaks to HTML5 features, "mixed-mode" HTML5 + flash cases, desktop and iOS tweaks. Improved sound re-use and "play-through" on iOS (believed previously working, may have regressed with iOS 4.2.1.) Code clean-up and shuffling of homepage, 360° demo (jslinted and improved functionality), load({options}) fix, better handling of broken Safari/Snow Leopard audio case. * Bug fixes o Fix for soundManager.load({options}) / SMSound.load({options})-specific case (regular load() sans-parameters was fine), where load({onload:...}) would fail if a URL parameter was not specified. load({url:...,onload:...}) was OK. If unspecified, load now takes URL from SMSound.url. o Fixed unload/replay case on iOS: play sound #1, interrupt it by starting sound #2, then play sound #1 again - previously, #1 would fail on replay due to interrupted state since iOS only allows one sound at a time. Should now restart OK. (This applies to the new soundManager.useGlobalHTML5Audio stuff.) Playlist auto-advance looks to be OK as well. * API Updates o New (experimental) soundManager.useGlobalHTML5Audio property - if true (default for iOS/mobile), reuses a single Audio() object for loading sound. Helps make playlist / onfinish()->play() work on iOS without user interaction. o New (experimental) soundManager.requireFlash property (default: false.) If true, prevents HTML5-only mode on devices with both HTML5 and Flash. May be useful when HTML5 is enabled (and can play MP3), but Flash is desired to play RTMP content etc. As of this version, will only use Flash for RTMP. o HTML5: Fix for type:'audio/mp3' returning false on canPlay(). Timer update-while-paused tweak. o HTML5: More event listeners, ignore events on destroyed sounds, improved event clean-up, "seek before load" fix * Miscellaneous o Improved broken Safari/Snow Leopard HTML5 audio situation: HTML5 mode is no longer disabled - and if available, Flash is used to play MP3/MP4 content to work around known playback issues with native HTML5 audio. o (Finally) report "true" position of MovieStar (MPEG4/AAC) content while scrubbing a playing/paused sound. Previously did not fire updates while scrubbing. Imperfect on resume due to buffer, but should be negligible and an improvement vs. old behaviour. o 360° player refresh, works with multiple types (eg. small 48x48 square vs. large 256x256 square w/spectrum + EQ visualizations) on the same page now. Can play and seek simultaneously, as well. More configurable. Removed old empty.gif + imageRoot junk. Core JS now appeases the jslint gods. o Code clean-up, removed undocumented/experimental playOnSeek and related methods from a prior fork. o Fresh homepage demo design/layout, should be nicer for new users.
-
V2.97a.20110101f87d0d2e · ·
V2.97a.20110101 - Simplified onready() behaviour (see potential onready() regression note), new ontimeout() handler, Webkit + MovieStar 30-second-pause fix onready() is now called only for SM2 init success (makes default case easier, no need for "supported" check) - new ontimeout() is called only for failure case, ie., flash blocked/missing. Special Webkit/MovieStar won't-resume-after-30-seconds-paused fix. soundManager.supported() renamed to soundManager.ok() (old method aliased for the time being.) Bug fixes Special bad case, Webkit/Flash+MovieStar (AAC/MPEG4/RTMP-only, not MP3): sounds don't resume after being paused for 30+ seconds(?), but setPosition() with current position gets things going again after a resume() attempt. Reported via 8tracks dudes. API Updates In previous releases, the soundManager.onready() queue would be processed for both OK and failure cases. The onready() queue is now processed only if successful initialisation occurs, making old "supported" checks within the onready() handlers redundant. Potential regression note: Old error case handling within onready() will never execute as a result of this change. Update your code to use the new explicit soundManager.ontimeout() handler instead. Old onready() method soundManager.onready(function(){ if (soundManager.supported()) { // OK, play sound etc. } else { // SM2 could not start; message user? } }); New onready() / ontimeout() method soundManager.onready(function(){ // OK, play sound etc. }); soundManager.ontimeout(function(){ // SM2 could not start; message user? }); New soundManager.ontimeout(myFunction) method, for asynchronous queueing of init failure handlers. Fired only when SoundManager 2 is unable to initialise (usually due to blocked/missing flash, or flash security error.) Queue behaviour is the same style as onready(). Miscellaneous Code cleanup: Took the unsupported "jsAMP" demo (2007 prototype) out back and shot it. 360° UI demo: New "allowMultiple" config option, let 2+ sounds play at once etc. (Default: false, one at a time.) 360° UI, canvas visualization demo: Minor layout, UI, code tweaks API/docs/demos reference and use updated onready()/ontimeout() methods.
-
V2.97a.2010122119841a19 · ·
V2.97a.20101221 - HTML5 loading/progress and RTMP tweaks, onready() double-firing fix, hasPriority for mobile flash, Muxtape-style player now AJAX-friendly Improved HTML5 whileloading() / whileplaying(), unload and event handling. hasPriority for off-screen SWF loading on mobile, replaces old mobileFlash positioning tricks. Effectively re-wrote page player (Muxtape-style) demo to use event delegation + read live DOM, so should not break in AJAX cases. RTMP onplay() / play() / buffering fixes, setPosition() regression fix. Side reading: "Probably, Maybe, No": The State of HTML5 Audio, an article written for 24ways.org touching on some of the current issues and future promise of audio in HTML. Bug fixes Double onready()-firing bug (HTML5 and non-flashblock case) fixed. HTML5: Don't request null/about:blank URL with unload(), may hang/JS error in Chrome and IE 9 preview 7. RTMP: Ensure onplay() is called for auto-loading streams when resumed. Don't call play() until connected. play() sets flash pauseOnBufferFull = false (fix for reported "RTMP not playing audio" issue.) overHTTP was likely returning incorrect values previously - now fixed. unload() tweak: Ensure position is reset to 0 if unload() fails Flash audio: Log metaDataHandler info if debug enabled, possible duration metaData fix No HTML5 audio for any Safari on OS X Snow Leopard 10.6.[3|4|5] due to underlying bugs causing intermittent audio playback failure; ongoing Apple issue, on their radar. Amusingly, Safari on Windows appears to be fine. API Updates Revised HTML5 Audio() events, improved whileloading() / whileplaying() / onload() for Webkit and Firefox 4. Progress/onload are still a bit quirky as HTML5 audio is more about "non-linear" loading including range and partial requests, where supported. See related discussion. New soundManager.ok() method, nicer alias for soundManager.supported(). Took soundmanager.loadFromXML() (SM1 legacy method) out back and shot it. Last tweak was in 2008, nobody uses it. Miscellaneous Flash <object> / <embed>: hasPriority attribute, enables off-screen SWF loading with Flash 10.1+. Removed mobileFlash positioning/repositioning tricks in lieu of this. Effectively re-wrote page-player (Muxtape-style) demo, now traverses live DOM for next item(s). Should be more AJAX-friendly. Event delegation now handles any links added at any time. Externalised experimental features, too. HTML5: If URL lacks type attribute and extension such as .mp3 (worst-case scenario, you shouldn't be doing this anyway) just try dumbly loading it - imitating Flash behaviour. Improved dataerror (wave/spectrum) exception handling, should result in lowered CPU use if playback continues with access exceptions (eg. YouTube video going in another tab.) Start-up debug output/messaging clean-up (no movieStar in flash 8, minimal output in HTML5-only mode, etc.) Add window unload handler if Flash being used, so back button will cause a page refresh (vs. the browser showing "previous state") to reinstate Flash in good browsers. Previously, the "previous state" was be shown but Flash audio would be broken. ipod (ipod touch) gets HTML5 now, too. Microsoft have added Audio() to Internet Explorer 9 as of "Platform Preview 7" - previous pre-releases of IE 9 only implemented <audio>, which SM2 does not use.
-
V2.97a.20101010e128a569 · ·
V2.97a.20101010 - Code cleanup, HTML5 audio tweaks, merged RTMP fork, removal of experimental video, optional usePolicyFile crossdomain.xml feature Shuffling of SoundManager 2 core, approximately 5% shaved off full debug-enabled file size after bug fixes, additional comments, new features and so on. Internal event handling code cleaned up. .SWF builds optimized, Flash 9 non-debug version now under 10 KB. Debug version now flash debugger-enabled. Merged GitHub user kjvarga's RTMP fork including improvements for Red5 + Flash Media Server streaming cases - buffering, event and state handling. Experimental video feature is toast, createVideo() no longer implemented. iPhone + iPad touch events on page player + 360° player UI demos; tap and drag to seek, etc. Bug fixes No HTML5 audio for *any* Safari on OS X Snow Leopard 10.6.[3|4] due to underlying bugs causing intermittent audio playback failure; ongoing Apple issue, on their radar. (See related GitHub commit) Don't unload() at onfinish() for HTML5 audio (was originally done to be conservative, but results in additional HTTP requests despite caching expectations?) onload() for HTML5 now using proper boolean values Fix NetStream-specific autoLoad/autoPlay/volume createSound() call, specific null flash sound object error scenario. (Related changes on GitHub.) Fix for "onbufferchange(1) followed immediately by onbufferchange(0)" case when audio was actually still buffering. Removed setPosition() within unload(), cleaner exit when destroying a sound Merged: RTMP Fork Merged GitHub user kjvarga's RTMP fork of SoundManager 2, including buffering, event and state handling fixes and improvements. For more RTMP documentation/features, see the readme on GitHub, or view locally. API Updates Removed experimental video feature (originally added late 2008, never developed further.) createVideo(), allowFullScreen and related video methods are now gone. Other dedicated HTML5/flash video player projects have since solved this problem. New SMSound option: usePolicyFile - (boolean, default: false) - enables Flash to request /crossdomain.xml file for content on third-party domains, if access to ID3/metadata such as wave/peak/spectrum is needed. Will automagically enable if onid3() or peak/wave/spectrum features are being used. console.warn()-style messaging (instead of throwing exceptions) if createSound() etc. are called before SM2 init has fired. Now calls similar warning and exits if called after a failed, unsuccessful startup (ie., timeout or not-supported case.) Miscellaneous SoundManager 2 core code cleanup, ~5% shaved off soundmanager2.js code size after new features, bug fixes and comments etc. Internal event handling (DOM-related events for init, IE 6 vs. everybody else) improved. Flash builds optimized; Flash 9 SWF build now under 10 KB. Debug-enabled Flash 9 SWF now hooks into Flash debug player/IDE debugging tools (compiled with -debug=true) Attempt to detect RTL documents, position Flash accordingly if so to avoid long horizontal scrollbar issue (related discussion) iPhone + iPad touchmove() and related events added to page player + 360° player UI demos; tap and drag to seek should now work.
-
-
V2.96a.201008228c128fe8 · ·
V2.96a.20100822 - HTML5 audio support no longer "alpha", Safari 5.0.1/SL HTML5 audio issues continue, iPad/iPhone "play through", Flash tweak for Android useHTML5Audio feature now considered beta-worthy, though disabled by default to be safe (with the exception of iPhone + iPad.) iPhone/iPad will now play a sequence of sounds, user interaction only required to start first one. Flash on-screen positioning tweak for Android devices that run Flash. Safari 5.0.1 on Snow Leopard exhibits same buggy HTML5 audio issue, disabled by default; Apple have been notified. IE 9 "Platform Preview 4" has <audio> but no Audio() support (yet?) See bug #586311 (may require connect.microsoft.com / Windows Live ID, login first etc.) * Bug fixes o HTML5 Audio() still broken in Safari 5.0.1 on Snow Leopard (10.6.3, 10.6.4), where sounds intermittently fail to load and play. Apple are aware of the regression. Related bug: #32519. Include sm2-ignorebadua in URL on SM2 pages to ignore this check and verify broken behaviour, etc. o Tweaks for experimental RTMP feature re: handling of paused state, tracking of position and onfinish() firing early. o Bumped SWF z-index to 5000 for Safari 5, SoundCloud-reported bug-and-fix for Safari 5-specific bad redraw issues, and occasional crash case referencing WebCore::RenderLayer::paintLayer * API Updates o iPhone/iOS 4 and iPad can now play a sequence of sounds (once the user starts sound initially), provided onfinish() is used to create/play the next sound. Example: Muxtape-style UI on homepage will play through list without further interaction once a user plays something in the list. * Miscellaneous o Special case for getting SM2 working more reliably on HTC Android + Flash 10.1, where flash does not load until on-screen (ie., in view.) If off-screen, Flash is repositioned at left/top 0px in order to load (including scroll/resize if needed), then events released and movie is repositioned off-screen. If movie is in the DOM already eg. as in useFlashBlock cases, flashLoadTimeout is set to 0 to allow infinite wait (eg., SM2 will not timeout with an error, and will simply load when the flash is scrolled into view.) o Documentation: Clarified createSound() behaviour if an existing sound ID is given (returns sound object "as-is", ignores any options passed.) o Page-player demo updated to use canPlayLink() instead of canPlayURL, more flexible link/type handling. o Homepage and documentation UI/layout and language tweaks, a few new "as seen on the internets" icons etc.
-
V2.96a.20100624e5f14630 · ·
V2.96a.20100624 - Safari 5/Snow Leopard 10.6.3/10.6.4 HTML5 Audio() issue, X-domain SWF build fixes Disabling HTML5 Audio for Safari 5 on Snow Leopard 10.6.3 + 10.6.4 (current release) only, as it is broken similar to Safari 4.x (also on Snow Leopard only.) Related bug: #32519. Also, version info in SWFs and fixed X-domain SWF build. * Bug fixes HTML5 Audio() still broken in Safari 5 on Snow Leopard (10.6.3, 10.6.4) - disabling for now, falling back to Flash as with Safari 4.x on Snow Leopard. Include sm2-ignorebadua in URL to ignore this check and verify broken behaviour, etc. Fixed X-domain SWF builds to actually work cross-domain. * Miscellaneous Added version info string to SWFs in Flash right-click / context menu, helpful when troubleshooting SWFs.
-
V2.96a.20100606f505b4cc · ·
V2.96a.20100606: Added experimental RTMP support via kjvarga's fork at http://github.com/kjvarga/SoundManager2/ while maintaining existing NetStream-based behaviour for non-RTMP MPEG4 audio, etc. Uses new serverUrl: parameter for FMS (I used Red5 for dev/testing,) eg. soundManager.createSound({id:'rtmpTest',serverUrl:'rtmp://localhost/oflaDemo',url:'oh-alberta.mp3'}).play(); New SMSound option for createSound(), load(), play(): 'type', for specifying MIME type alongside URL to help with detecting playability. eg. soundManager.createSound({id:'foo', url:'/player.php?stream=1', type:'audio/mp3'}).play(); and so on. Hat tip: sylvinus.org New SMSound.onposition() for time-based events Removed Base64 HTML5 Audio() tests, redundant as numerous MIME (audio/mpeg, audio/mp3 etc.) checks seem to cover it. Updated MPC (drum machine) demo from 2006-era design, modernizing the CSS a bit. soundManager.html5.usingFlash reflecting _needsFlash property nullURL = 'about:blank' tweak for unloading (flash 8.) May have finally fixed that dumb stream closing error on unload/destroy. Set soundManager.didFlashBlock *before* firing onready()/onerror() listeners
-
V2.96a.20100520f38d9d6d · ·
SoundManager V2.96a.20100520: Experimental HTML5 support, lots of code shuffling and performance tweaks. API Updates o New soundManager.useHTML5Audio (disabled by default except for iPad, Palm Pre) - adds experimental HTML5 Audio support, with Flash fallback for MP3/MP4 formats as needed. o Sound looping now works in Flash! eg. mySound.play({loops:3}); - for an example + discussion of how to get near-seamless looping, see Seamless Looping MP3s in Flash (demo video) on Flickr. Bug fixes o beginDelayedInit() is always used in lazy loading case (eg. via dynamic script tag/XHR etc.,) as some cases where SM2 won't auto-start eg. document.readyState empty for Firefox 3.5.5 (seen on Win32) with an HTML5 DOCTYPE. o SWF is now 8x8 pixels by default, vs. 6x6 pixels (odd fix for HTML5 Doctype on Firefox 3.6/win32) o Fixed dumb IE undefined ID bug Miscellaneous o soundmanager2.swf and soundmanager2_flash9.swf are now "non-debug" versions; with debugMode enabled, soundmanager2_debug.swf and soundmanager2_flash9_debug.swf are loaded instead. o New build script for JS + SWFs, see file size table. JS compression now done via Google Closure compiler; new soundmanager-jsmin.js build, debug-enabled but compressed, in addition to build-script-optimized, no-debug, compressed JS (~9 KB with gzip vs. ~90 KB for raw, commented, debug-enabled version.) o Null check fix for unavailable eq/waveform data o Experimental video (flash 9-only) change: Use stage width/height instead of 0/0 when lacking metadata o Page player whileloading() calls now being throttled o Better page player click handling for IE 7
-
V2.95b.201003238508620f · ·
V2.95b.20100323: useFlashBlock, better handling of time-out/errors (CSS-based SWF repositioning options for unblocking on time-out), "play MP3 button" demo, canPlayLink(), canPlayMIME(), eqData + waveformData for AAC/H.264 (movieStar) content, missing documentation and miscellaneous bug fixes.
-
V2.95b.2010010178faffd3 · ·
V2.95b.20100101: New shiny: debugFlash for flash movie debug output, SMSound.eqData has left/right channels, code tidying and debug output clean-up. Bugs: stream=true play()/readyState==0 case fix, soundManager.reboot() forces recreation of object/embed. Canvas-based VU meter favicon on homepage demos (works in Firefox/Opera), Fx 3.6 removing XBM image support
-
V2.95a.2009071768c9a8a9 · ·
V2.95a.20090717: New soundManager.onready(), oninitmovie(), useFastPolling, SMSound.multiShotEvents, createSound() warning with numeric IDs, flashblock handling demo, cross-domain-enabled SWF (in .zip)