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 0E99618C98 for ; Thu, 14 Jan 2016 23:52:40 +0000 (UTC) Received: (qmail 91072 invoked by uid 500); 14 Jan 2016 23:52:40 -0000 Delivered-To: apmail-cordova-issues-archive@cordova.apache.org Received: (qmail 91048 invoked by uid 500); 14 Jan 2016 23:52:40 -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 91036 invoked by uid 99); 14 Jan 2016 23:52:39 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Jan 2016 23:52:39 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id C40A52C14F7 for ; Thu, 14 Jan 2016 23:52:39 +0000 (UTC) Date: Thu, 14 Jan 2016 23:52:39 +0000 (UTC) From: "Joe Bowser (JIRA)" 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 ] 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: https://issues.apache.org/jira/browse/CB-8020 > Project: Apache Cordova > Issue Type: Bug > Components: Plugin Media > Reporter: Aaron Ru=C3=9F > 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 t= he LogCat console, complaining about a failed attempt to rename the tempora= ry file (that is used for recording audio). > {panel:title=3DExample 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/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: > In addition to manually testing, that the proposed changes (see GitHub li= nk above) did not brake recording, I also did run the unit tests from plugi= n {{org.apache.cordova.media.tests}} successfully > (on a Samsung Note 10 device with Android 4.4.2) > NOTE 2: > this is the same issue as described in [CB-3800|https://issues.apache.org= /jira/browse/CB-3800] and [CB-3835|https://issues.apache.org/jira/browse/CB= -3835]=20 > ...in 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 p= lanned or had been implemented at some point and then was changed (for what= ever reason). > See for example methods {{destroy()}}, {{stopRecording()}}, and {{getDura= tion()}}: in these methods it is assumed, that the {{recorder}} field is nu= ll, if the AudioPlayer objec _is not_ used for recording (and is not null i= f it _is_ used for recording). -- 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