[
https://issues.apache.org/jira/browse/CB-5890?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13882345#comment-13882345
]
John M. Wargo commented on CB-5890:
-----------------------------------
I did a search on the OSStatus error message and found out that the issue is
with the file format. Somehow my file, although it will play on Android, won't
play on iOS.
I rerecorded my sample media file on the iOS voice recorder and the file will
play on both devices.
There's still a bug here that the error message is blank, but there seems to
also be a problem with the interface to the media player as I know the file
was...good.
> Media won't play local file on iOS
> ----------------------------------
>
> Key: CB-5890
> URL: https://issues.apache.org/jira/browse/CB-5890
> Project: Apache Cordova
> Issue Type: Bug
> Components: iOS, Plugin Media
> Affects Versions: 3.3.0
> Environment: Mac OSX
> Reporter: John M. Wargo
>
> I have an application that will play a media file on Android, but not on iOS.
> When I try to play the file, the console indicates that it can find the file,
> but fails on opening it:
> Failed to initialize AVAudioPlayer
> Here's some console entries:
> 2014-01-24 08:49:51.374 Ex141[386:60b] Entering doPlay
> 2014-01-24 08:49:51.376 Ex141[386:60b] Found resource
> '/var/mobile/Applications/C557863E-BB8C-4384-8188-9C36B5B603C4/Ex141.app/www/sample.mp3'
> in the web folder.
> 2014-01-24 08:49:51.391 Ex141[386:60b] Failed to initialize AVAudioPlayer:
> The operation couldn’t be completed. (OSStatus error 1685348671.)
> 2014-01-24 08:49:51.394 Ex141[386:60b] THREAD WARNING: ['Media'] took
> '18.647949' ms. Plugin should use a background thread.
> 2014-01-24 08:49:51.396 Ex141[386:60b] Leaving doPlay
> 2014-01-24 08:49:51.397 Ex141[386:60b] ERROR: Entering mediaError
> 2014-01-24 08:49:51.398 Ex141[386:60b] ERROR: {"message":"","code":4}
> Notice that the message string is blank.
> This is my code:
> theFile = 'sample.mp3';
> theMedia = new Media(theFile, mediaSuccess, mediaError, mediaStatus);
> theMedia.play();
--
This message was sent by Atlassian JIRA
(v6.1.5#6160)