cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joe Bowser (JIRA)" <>
Subject [jira] [Updated] (CB-8020) avoid error message in console for failed renaming of recording-file (if Media object was only used for playing)
Date Thu, 14 Jan 2016 23:52:39 GMT


Joe Bowser updated CB-8020:
         Labels: Android  (was: )
    Component/s:     (was: Android)

> avoid error message in console for failed renaming of recording-file (if Media object
was only used for playing)
> ----------------------------------------------------------------------------------------------------------------
>                 Key: CB-8020
>                 URL:
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Plugin Media
>            Reporter: Aaron Ruß
>            Priority: Minor
>              Labels: Android
>   Original Estimate: 10m
>  Remaining Estimate: 10m
> On Android, if a Media object is only used for playing a sound, i.e. not for recording,
then, on releasing the media object, an error is logged to the LogCat console, complaining
about a failed attempt to rename the temporary file (that is used for recording audio).
> {panel:title=Example LogCat output (after releasing the Media object):}
> 11-14 13:57:14.138: V/MediaPlayer(29175): destructor
> 11-14 13:57:14.138: V/MediaPlayer(29175): disconnect
> 11-14 13:57:14.138: D/AudioPlayer(29175): renaming /storage/emulated/0/tmprecording.3gp
to /android_asset/www/audio/beep-notification.mp3
> {color:red}11-14 13:57:14.138: E/AudioPlayer(29175): FAILED renaming /storage/emulated/0/tmprecording.3gp
to /android_asset/www/audio/beep-notification.mp3{color}
> {panel}
> Solution:
> in the AudioPlayer class, do not create the MediaRecorder (for audio recording) on object
creation (i.e. in the AudioPlayer's constructor), but instead create it lazily, only if/when
the AudioPlayer is used for recording audio (i.e. in method {{startRecording(String)}}).
> Example solution see:
> In addition to manually testing, that the proposed changes (see GitHub link above) did
not brake recording, I also did run the unit tests from plugin {{}}
> (on a Samsung Note 10 device with Android 4.4.2)
> NOTE 2:
> this is the same issue as described in [CB-3800|]
and [CB-3835|] 
> CB-3835 David Mihalcik already provided the solution ... but it was not accepted
... yet (??)
> NOTE 3:
> the code in AudioPlayer suggests, that lazy-loading of the recorder was planned or had
been implemented at some point and then was changed (for whatever reason).
> See for example methods {{destroy()}}, {{stopRecording()}}, and {{getDuration()}}: in
these methods it is assumed, that the {{recorder}} field is null, if the AudioPlayer objec
_is not_ used for recording (and is not null if it _is_ used for recording).

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message