Return-Path: X-Original-To: apmail-cordova-issues-archive@minotaur.apache.org Delivered-To: apmail-cordova-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1BF22F6CE for ; Fri, 14 Nov 2014 17:39:34 +0000 (UTC) Received: (qmail 47126 invoked by uid 500); 14 Nov 2014 17:39:34 -0000 Delivered-To: apmail-cordova-issues-archive@cordova.apache.org Received: (qmail 47101 invoked by uid 500); 14 Nov 2014 17:39:34 -0000 Mailing-List: contact issues-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@cordova.apache.org Received: (qmail 46875 invoked by uid 99); 14 Nov 2014 17:39:33 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Nov 2014 17:39:33 +0000 Date: Fri, 14 Nov 2014 17:39:33 +0000 (UTC) From: =?utf-8?Q?Aaron_Ru=C3=9F_=28JIRA=29?= To: issues@cordova.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (CB-8020) avoid error message in console for failed renaming of recording-file (if Media object was only used for playing) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CB-8020?page=3Dcom.atlassian.j= ira.plugin.system.issuetabpanels:all-tabpanel ] Aaron Ru=C3=9F updated CB-8020: -------------------------- Description:=20 On Android, if a Media object is only used for playing a sound, i.e. not fo= r 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). Example LogCat output (after releasing the Media object): {panel} 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/tmpr= ecording.3gp to /android_asset/www/audio/beep-notification.mp3 {color:red}11-14 13:57:14.138: E/AudioPlayer(29175): FAILED renaming /stora= ge/emulated/0/tmprecording.3gp to /android_asset/www/audio/beep-notificatio= n.mp3{color} {panel} Solution: in the AudioPlayer class, do not create the MediaRecorder (for audio record= ing) on object creation (i.e. in the AudioPlayer's constructor), but instea= d create it lazily, only if/when the AudioPlayer is used for recording audi= o (i.e. in method {{startRecording(String)}}). Example solution see: https://github.com/mmig/cordova-plugin-media/commit/66ac88689cb092179cdc3ed= a3bd64b1d8616077e NOTE: I did run the unit tests from plugin {{org.apache.cordova.media.tests}} suc= cessfully with the changes as linked above to the GitHub repository (on a Samsung Note 10 device with Android 4.4.2) was: On Android, if a Media object is only used for playing a sound, i.e. not fo= r 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). 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/tmpr= ecording.3gp to /android_asset/www/audio/beep-notification.mp3 {color:red}11-14 13:57:14.138: E/AudioPlayer(29175): FAILED renaming /stora= ge/emulated/0/tmprecording.3gp to /android_asset/www/audio/beep-notificatio= n.mp3{color} Solution: in the AudioPlayer class, do not create the MediaRecorder (for audio record= ing) on object creation (i.e. in the AudioPlayer's constructor), but instea= d create it lazily, only if/when the AudioPlayer is used for recording audi= o (i.e. in method {{startRecording(String)}}). Example solution see: https://github.com/mmig/cordova-plugin-media/commit/66ac88689cb092179cdc3ed= a3bd64b1d8616077e NOTE: I did run the unit tests from plugin {{org.apache.cordova.media.tests}} suc= cessfully with the changes as linked above to the GitHub repository (on a Samsung Note 10 device with Android 4.4.2) > avoid error message in console for failed renaming of recording-file (if = Media object was only used for playing) > -------------------------------------------------------------------------= --------------------------------------- > > Key: CB-8020 > URL: https://issues.apache.org/jira/browse/CB-8020 > Project: Apache Cordova > Issue Type: Bug > Components: Android, Plugin Media > Reporter: Aaron Ru=C3=9F > Priority: Minor > 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 t= he LogCat console, complaining about a failed attempt to rename the tempora= ry file (that is used for recording audio). > Example LogCat output (after releasing the Media object): > {panel} > 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/tm= precording.3gp to /android_asset/www/audio/beep-notification.mp3 > {color:red}11-14 13:57:14.138: E/AudioPlayer(29175): FAILED renaming /sto= rage/emulated/0/tmprecording.3gp to /android_asset/www/audio/beep-notificat= ion.mp3{color} > {panel} > Solution: > in the AudioPlayer class, do not create the MediaRecorder (for audio reco= rding) on object creation (i.e. in the AudioPlayer's constructor), but inst= ead create it lazily, only if/when the AudioPlayer is used for recording au= dio (i.e. in method {{startRecording(String)}}). > Example solution see: > https://github.com/mmig/cordova-plugin-media/commit/66ac88689cb092179cdc3= eda3bd64b1d8616077e > NOTE: > I did run the unit tests from plugin {{org.apache.cordova.media.tests}} s= uccessfully with the changes as linked above to the GitHub repository > (on a Samsung Note 10 device with Android 4.4.2) -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org For additional commands, e-mail: issues-help@cordova.apache.org