Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
6.1.1
-
None
-
Mac OS X 10.11.5, Cordova 6.1.1, Cordova android 5.1.1, Nexus 5X running Android 6.0.1
Description
When changing views, the AudioHandler receives onAudioFocusChange and adds all running media to a pausedForFocus list. With Angular, a controller's life cycle might not exactly match what Android is seeing for this event (I'm a bit unclear on how the focus change events are fired). So if that media object is later released, it needs to be removed from those lists in AudioHandler.release:
pausedForFocus.remove(audio);
pausedForPhone.remove(audio);
If this does not happen, the AudioHandler receives another onAudioFocusChange event and calls resumeAllGainedFocus which calls AudioPlayer.startPlaying with a null file, in turn calling readyPlayer(null), causing a NullPointerException and crash at the line:
if (this.audioFile.compareTo(file) == 0)
There might be a root cause here that I am missing, but this displays the symptom I am seeing.
Attachments
Issue Links
- is related to
-
CB-12157 audio.startPlaying(null) causes NullPointerException
- Open