Recent Chrome update seems to have broken my SM2 audio player?

  • Problem
  • Updated 3 years ago
  • In Progress
My SM2 implementation stopped working Since Chrome updated to Version 25.0.1364.99. It worked great prior to this relase, and continues to work in all other modern browsers I've tested.

The player in question is on http://seadramas.com. When a song finishes playing, the expected behavior is for the next song to play. With debugging turned on (locally), SM2 reports that the next sound is playing, and the UI updates as desired, but no audible sound comes out or error is logged.
Photo of Dwayne Anderson

Dwayne Anderson

  • 2 Posts
  • 0 Reply Likes

Posted 3 years ago

  • 9
Photo of Scott

Scott, Official Rep

  • 3824 Posts
  • 247 Reply Likes
Official Response
OK, I think I found the cause, and have a fix for it.

Issue summary (applies to SM2 V2.97a.20130101)

* SoundManager 2 defaults to using Flash 8 sound API (SWF is under 3 KB, simpler code vs. Flash 9-based one of 9 KB etc.)

* With Flash player 11.6.602.171 release, "chained playback" (playlists, etc.) via createSound().play() -> onfinish() -> createSound().play() would break, where the second sound would not load or play.

* Using Flash 9-based sound API via soundManager.setup({ flashVersion: 9}), issue is not seen with current SM2 release (V2.97a.20130101)

Fix/workaround

I suspect there is a race condition, and some sort of invalid position value sneaking in at the end of sound playback in Flash 8.

For current users, you can try soundManager.setup({ flashVersion: 9 }) if your current SM2 install is affected, and see if that fixes things.

The patch I'm making for the next release:

1) SM2 now wraps its onfinish() callback in a setTimeout() with a delay of 0, to yield before making the callback when using Flash 8. (Flash 9 and HTML5 are unaffected.)

2) The internal Flash call has tighter checking on both the position parameter (for null and NaN), and "stream" values.

See relevant commit on Github.

For those interested, you can grab the latest (including this patch) from the V2.97a.20130101+DEV branch. This change will be included in the next release, which I may push sooner than later in order to get this fix out.

Please test and let me know if you run into any issues, and thanks for the detailed reports!