apache/cordova-plugin-media — pull request #6 by feinerfug (2013-11-07 14:38:44+00:00)
Title: Android: avoid creating new AudioPlayer on create, if it already exists

Implementation of AudioPlayer creates the internal player, if play or
startRecording is called. This shouldn't happen since the constructor
of the JS-Media object calls the native create action, but due to
threading issues it might happen that the play action gets called
before the create action gets called. In this case create overwrites
the existing audio player object. In the result the reference to the
audio gets lost and it is not possible to control it anymore. This can
be avoided by checking if a AudioPlayer in the players map exists and
skipping the creation if this is the case.