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 9D9021016F for ; Fri, 31 Jan 2014 10:52:15 +0000 (UTC) Received: (qmail 89583 invoked by uid 500); 31 Jan 2014 10:52:15 -0000 Delivered-To: apmail-cordova-issues-archive@cordova.apache.org Received: (qmail 89461 invoked by uid 500); 31 Jan 2014 10:52:13 -0000 Mailing-List: contact issues-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cordova.apache.org Delivered-To: mailing list issues@cordova.apache.org Received: (qmail 89333 invoked by uid 99); 31 Jan 2014 10:52:08 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 31 Jan 2014 10:52:08 +0000 Date: Fri, 31 Jan 2014 10:52:08 +0000 (UTC) From: "Stephen Bartholomew (JIRA)" To: issues@cordova.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CB-5953) 'startPlayingAudio' causes audio file to be restarted; unable to resume from paused position MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CB-5953?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13887631#comment-13887631 ] Stephen Bartholomew commented on CB-5953: ----------------------------------------- Scratch this ticket - I was *completely* mistaken. The audio *is* cached: https://git-wip-us.apache.org/repos/asf?p=cordova-plugin-media.git;a=blob;f=src/ios/CDVSound.m;h=14b2fc24387cbf91e8e1aad15c3717af63b26ecd;hb=HEAD#l166 > 'startPlayingAudio' causes audio file to be restarted; unable to resume from paused position > -------------------------------------------------------------------------------------------- > > Key: CB-5953 > URL: https://issues.apache.org/jira/browse/CB-5953 > Project: Apache Cordova > Issue Type: Bug > Components: Plugin Media > Affects Versions: 3.3.0 > Environment: iOS > Reporter: Stephen Bartholomew > Labels: audio, ios, media > > OVERVIEW > The Media plugin uses 'startPlayingAudio' when Media#play() is called (https://git-wip-us.apache.org/repos/asf?p=cordova-plugin-media.git;a=blob;f=www/Media.js;h=083af3623a56fded9fd25505a94d19bd901c5e6a;hb=HEAD#l75). > The comment states that this will "play or resume" audio but every time, the audio starts from the beginning. > I've only tested on iOS and my cause/solultions only cover this. I'm not familiar enough with the other platforms right now to make a judgement. > CAUSE > CDVAudioFile is initialised from scratched each time startPlayingAudio is called, rather than reusing the current playing instance: https://git-wip-us.apache.org/repos/asf?p=cordova-plugin-media.git;a=blob;f=src/ios/CDVSound.m;h=14b2fc24387cbf91e8e1aad15c3717af63b26ecd;hb=HEAD#l297 > POSSIBLE SOLUTIONS > 1. Store the current playing instance and reuse the resource path is unchanged > 2. Add a 'resume' method to use instead of using play > I'm happy to look into either of these but I'd like confirmation of my assessment of the problem and some kind of consensus on the solution. > WORKAROUNDS > I'm now attempting to store the audio position at the time of pausing then doing a seek after play to put the audio in the correct place via the JS - not ideal. -- This message was sent by Atlassian JIRA (v6.1.5#6160)