[r186.2] Audio crash on iOS-ejecta (with fix)

Bugs will be moved here once resolved.

Post » Thu Nov 13, 2014 9:33 am

Problem Description
When you minimize the C2-ejecta application and go back to it, you get a javascript error about a null context

This change fixed it:

in the Audio plugin:
Code: Select all
+++ ...\exporters\html5\plugins\audio\runtime.js
@@ -2726,7 +2726,7 @@
             return;
         
         // upon resume: first resume the whole context
-        if (!s && context["resume"])
+        if (!s && context && context["resume"])
             context["resume"]();
         
         var i, len;
@@ -2734,7 +2734,7 @@
             audioInstances[i].setSuspended(s);
         
         // after suspend: also suspend the whole context
-        if (s && context["suspend"])
+        if (s && context && context["suspend"])
             context["suspend"]();
     };


For some unknown reasons, context might probably be null during a few frames and then the audio kicks in back.

Operating System and Service Pack
iOS

Construct 2 Version ID
r186.2
B
68
S
22
G
14
Posts: 1,485
Reputation: 16,561

Post » Thu Nov 13, 2014 2:20 pm

This change was already made in r187!
Scirra Founder
B
402
S
238
G
89
Posts: 24,613
Reputation: 195,993

Post » Thu Nov 13, 2014 11:11 pm

Ah! my bad (: I didn't update 'cause in 187 there's a potential breaking change and well... I don't have time to deal with it at work =), anyway that's neat, thanks.
B
68
S
22
G
14
Posts: 1,485
Reputation: 16,561


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 1 guest