[
https://issues.apache.org/jira/browse/CB-12157?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15879579#comment-15879579
]
ASF GitHub Bot commented on CB-12157:
-------------------------------------
Github user ghenry22 commented on the issue:
https://github.com/apache/cordova-plugin-media/pull/122
@shazron thanks, sorry to bug you just figured you were kind of the
gatekeeper here.
@infil00p I have been running with this PR (and the other null point PR
that was recently added) for a few days in all my apps testing and all works
well. This has resolved the issue where another app taking audio focus just as
a create/release of media was happening would cause the media plugin to throw a
null pointer. I have not seen any ill effects and I can no longer reproduce
the issue.
Have tested on Android 5/6 on a 3 different devices and all good so far.
> audio.startPlaying(null) causes NullPointerException
> ----------------------------------------------------
>
> Key: CB-12157
> URL: https://issues.apache.org/jira/browse/CB-12157
> Project: Apache Cordova
> Issue Type: Bug
> Components: Plugin Media
> Affects Versions: Master
> Environment: android
> Reporter: Frank Koenigstein
> Labels: Android
> Fix For: Master
>
>
> When AudioHandler.resumeAllGainedFocus is called it calls each AudioPlayer
> with startPlaying(null). That causes a NullPointerException:
> {code}
> 11-16 16:13:11.071 E/AndroidRuntime(30650): FATAL EXCEPTION: JavaBridge
> 11-16 16:13:11.071 E/AndroidRuntime(30650): java.lang.NullPointerException
> 11-16 16:13:11.071 E/AndroidRuntime(30650): at
> org.apache.cordova.media.AudioPlayer.readyPlayer(AudioPlayer.java:583)
> 11-16 16:13:11.071 E/AndroidRuntime(30650): at
> org.apache.cordova.media.AudioPlayer.startPlaying(AudioPlayer.java:299)
> 11-16 16:13:11.071 E/AndroidRuntime(30650): at
> org.apache.cordova.media.AudioHandler.resumeAllGainedFocus(AudioHandler.java:414)
> 11-16 16:13:11.071 E/AndroidRuntime(30650): at
> org.apache.cordova.media.AudioHandler$1.onAudioFocusChange(AudioHandler.java:431)
> 11-16 16:13:11.071 E/AndroidRuntime(30650): at
> android.media.AudioManager$FocusEventHandlerDelegate$1.handleMessage(AudioManager.java:2044)
> 11-16 16:13:11.071 E/AndroidRuntime(30650): at
> android.os.Handler.dispatchMessage(Handler.java:102)
> 11-16 16:13:11.071 E/AndroidRuntime(30650): at
> android.os.Looper.loop(Looper.java:136)
> 11-16 16:13:11.071 E/AndroidRuntime(30650): at
> android.os.HandlerThread.run(HandlerThread.java:61)
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]