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 A07001882A for ; Thu, 3 Mar 2016 11:12:18 +0000 (UTC) Received: (qmail 73869 invoked by uid 500); 3 Mar 2016 11:12:18 -0000 Delivered-To: apmail-cordova-issues-archive@cordova.apache.org Received: (qmail 73816 invoked by uid 500); 3 Mar 2016 11:12:18 -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 73729 invoked by uid 99); 3 Mar 2016 11:12:18 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Mar 2016 11:12:18 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 2BDD72C1F69 for ; Thu, 3 Mar 2016 11:12:18 +0000 (UTC) Date: Thu, 3 Mar 2016 11:12:18 +0000 (UTC) From: "Johnny Dong (JIRA)" To: issues@cordova.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Comment Edited] (CB-10723) iOS9.2 no audio 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-10723?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15177674#comment-15177674 ] Johnny Dong edited comment on CB-10723 at 3/3/16 11:12 AM: ----------------------------------------------------------- yes notice that from your original PR which you checked in back in Jul 29, 2015 that contains the streaming: https://github.com/apache/cordova-plugin-media/commit/00ddb9372bf4c9b96ccea0dbd285499df1809277 For context, In my ionicFramework app, folder structure is: {noformat} root +- www +- app +-app.js + +-content | +- 001 | +- some-audio-file.m4a + +-home +- home.module.js +- home.controller.js {noformat} angularJS controller home.controller.js sets up the cordova-plugin-media object like so: {code:title=home.controller.js|borderStyle=solid} var src = "app/content/001/some-audio-file.m4a"; var media = $cordovaMedia.newMedia(src); {code} as you can see i don't prefix with @"cdvfile://", and it's using relative paths from the from where app.js starts. With the structure above in mind, lets wind back a bit in CDVSound.m ln228 - 239 (void)create:(CDVInvokedUrlCommand*)command, where the player is allocated: {code:title=CDVSound.m ln228-239|borderStyle=solid} if (![resourceUrl isFileURL] && ![resourcePath hasPrefix:CDVFILE_PREFIX]) { // First create an AVPlayerItem AVPlayerItem* playerItem = [AVPlayerItem playerItemWithURL:resourceUrl]; .. .. .. // Pass the AVPlayerItem to a new player avPlayer = [[AVPlayer alloc] initWithPlayerItem:playerItem]; {code} Is this where the start of the problem? possibly the IF statement not recognising resourcePath? NOTE, i've actually tried passing cdvfile://" at some point during the investigation (hence the hack on ln 355). was (Author: spudmashmedia): yes notice that from your original PR which you checked in back in Jul 29, 2015 that contains the streaming: https://github.com/apache/cordova-plugin-media/commit/00ddb9372bf4c9b96ccea0dbd285499df1809277 For context, In my ionicFramework app, folder structure is: {noformat} root +- www +- app +-app.js + +-content | +- 001 | +- some-audio-file.m4a + +-home +- home.module.js +- home.controller.js {noformat} angularJS controller home.controller.js sets up the cordova-plugin-media object like so: {code:title=home.controller.js|borderStyle=solid} var src = "app/content/001/some-audio-file.m4a"; var media = $cordovaMedia.newMedia(src); {code} as you can see i don't prefix with @"cdvfile://", and it's using relative paths from the from where app.js starts. With the structure above in me, lets wind back a bit in CDVSound.m ln228 - 239 (void)create:(CDVInvokedUrlCommand*)command, where the player is allocated: {code:title=CDVSound.m ln228-239|borderStyle=solid} if (![resourceUrl isFileURL] && ![resourcePath hasPrefix:CDVFILE_PREFIX]) { // First create an AVPlayerItem AVPlayerItem* playerItem = [AVPlayerItem playerItemWithURL:resourceUrl]; .. .. .. // Pass the AVPlayerItem to a new player avPlayer = [[AVPlayer alloc] initWithPlayerItem:playerItem]; {code} Is this where the start of the problem? possibly the IF statement not recognising resourcePath? NOTE, i've actually tried passing cdvfile://" at some point during the investigation (hence the hack on ln 355). > iOS9.2 no audio > --------------- > > Key: CB-10723 > URL: https://issues.apache.org/jira/browse/CB-10723 > Project: Apache Cordova > Issue Type: Bug > Components: Plugin Media > Affects Versions: 2.2.0 > Environment: IonicFramework | ngCordova | cordova-plugin-media > Reporter: Johnny Dong > Assignee: Omar Mefire > Labels: easyfix, iOS, pendingPR, triaged > Original Estimate: 0.5h > Remaining Estimate: 0.5h > > Found an issue with the latest cordova.plugin.media whilst i was putting together a IonicFramework app for iOS 9.2.1 (iPhone 6s) to play an M4A file. > The iOS logs would show: > - Found resource '[path].m4a' in the web folder. > Playing audio sample '[path].m4a' > - Playing stream with AVPlayer & custom rate > but no sound (both simulator + device) > Debugging in Xcode, ./cordova-plugin-media/src/ios/CDVSound.m,ln 352 + 355 appears to be the culprit. > Instead of using "avPlayer" which doesn't appear to have a handle to the sound resource, switching to "audioFile.player" appears to resolve the sound issue. > *** ./cordova-plugin-media/src/ios/CDVSound.m,ln 352 > from: > [avPlayer setRate:customRate]; > to: > [audioFile.player setRate:customRate]; > *** ./cordova-plugin-media/src/ios/CDVSound.m,ln 355 > from: > [avPlayer play]; > to: > [audioFile.player play]; > NOTE: I've yet to create a PR as I have not signed the Apache ICLA, however i've committed a code in my personal fork and happy for somebody to have a look at it and submit on my behalf: > https://github.com/spudmashmedia/cordova-plugin-media/commit/946ffcf569cbaa22241e8ec00f11b4a52a0c6809 -- 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