Possible bug when HTML5 audio tag is reused ( 20120527 release )

  • 3
  • Problem
  • Updated 5 years ago
  • In Progress
Under conditions where the HTML5 audio tag gets reused, SM2 bombs out with 'null' is not an object errors. I tracked this down to line 2603:


_resetProperties((_oldIO.url ? _iO.url === _oldIO.url : (_lastURL ? _lastURL === _iO.url : false)));


_oldIO is null. Perhaps it should read (?):


_resetProperties((_oldIO && _oldIO.url ? _iO.url === _oldIO.url : (_lastURL ? _lastURL === _iO.url : false)));


Incidentally, this is not related to my other question -- we don't have the latest release in production yet.
Photo of Phil Mitchell

Phil Mitchell

  • 16 Posts
  • 0 Reply Likes

Posted 5 years ago

  • 3
Photo of Scott

Scott, Official Rep

  • 3873 Posts
  • 253 Reply Likes
Ah-ha, good find. Thanks. Any idea as to what method you're calling when this happens? play(), load() or a related method?

Just checked this change in on the V2.97a.20120527+DEV branch.
Photo of Shiro

Shiro

  • 3 Posts
  • 0 Reply Likes
I just dealt with this issue today, and it was when I was calling togglePause() after reusing an audio tag with a newly loaded sound.
Photo of Phil Mitchell

Phil Mitchell

  • 16 Posts
  • 0 Reply Likes
I am calling play(). Specifically, I play one sound and then attempt to play a second sound. It doesn't matter whether the first sound completes or I stop the first sound and then play the second. It may also be relevant that I call destruct() on every sound when it completes or gets stopped.

However, looking at it more closely, the conditions to reproduce are a bit more complicated. I tried to look at this in the Chrome debugger this morning and even when I force HTML5 audio in Chrome that code never seems to get hit. I've only seen this bug when testing on iOS.

Let me know if you want me to narrow this down further.
Photo of Scott

Scott, Official Rep

  • 3873 Posts
  • 253 Reply Likes
I pushed an update recently on the dev branch (see above), which should fix the error. Let me know if you are still seeing the error, or related weirdness.