Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
3.9.0
-
None
-
iPhone 4S with iOS 9.2.1
latest X-Code and SDK Version
Cordova 3.9.2
cordova-plugin-media 2.2.0
Description
After updating to the cordova-plugin-media 2.2.0 it is no longer possible to play any wav or mp3 files. It comes to a crash in the Objectiv-C code.
To recreate the error:
Play sound file 1
Stop soundfile 1
Play sound file 2
Stop soundfile 2
etc.
crash ...
With version 2.1.0, it works fine.
2016-03-11 11:49:25.961 FAMANICE[376:54395] Playing audio sample 'resources/sounds/sendingChatMessage.mp3'
2016-03-11 11:49:25.964 FAMANICE[376:54395] Playing stream with AVPlayer & custom rate
2016-03-11 11:49:25.988 FAMANICE[376:54256] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'AVPlayerItem cannot service a seek request with a completion handler until its status is AVPlayerItemStatusReadyToPlay.'
First throw call stack:
(0x20db010b 0x20556e17 0x2627116f 0x2625eac1 0x1791d3 0x19b263 0x19ab5f 0x215bd7bd 0x20d73e1f 0x20d73a51 0x20d7189d 0x20cc4bf9 0x20cc49e5 0x21f10ac9 0x24f54ba1 0x104683 0x20973873)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
Attachments
Issue Links
- links to
Activity
Can you try using master and see if this issue still reproduces ?
https://github.com/apache/cordova-plugin-media
It might not crash and instead send back an error result.
Let me know.
The error only occurs if Cordova Lib 3.9.2 is used in combination with cordova-plugin-media 2.2.0.
With the current Cordova Lib 4.0.1 and the cordova-plugin-media 2.2.0 it works fine.
I'll update the Cordova Lib in my project and I think the issue can be closed.
I also experience difficulties playing sound on iOS when using latest commit from 2.2.0 (https://github.com/apache/cordova-plugin-media#46c9542dec736f93d5f547c7dfdce1a8123d7c06). No errors are fired: I even get the MEDIA_RUNNING status. platform is ios@4.1.0
I also get an error.
To reproduce:
1) Start playing audio file
2) Media.release(), load and play another audio file.
3) Crash.
Sometimes it happens after first file, sometimes I can play 10 files, it seems to be random.
Here's the error from XCode:
----------------------------------------------
playing audio sample 'http://a200.phobos.apple.com/us/r1000/137/Music69/v4/ab/01/99/ab01995b-4c87-fc07-8c85-7d461b2cdfc6/mzaf_9166296509688222028.plus.aac.p.m4a'
2016-04-18 21:53:39.682 PortalShopApp[1484:842445] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'AVPlayerItem cannot service a seek request with a completion handler until its status is AVPlayerItemStatusReadyToPlay.'
-
-
- First throw call stack:
(0x183216e38 0x18287bf80 0x1898d7820 0x1898c3f48 0x100127888 0x10013ee88 0x10013e734 0x183bde628 0x1831cd81c 0x1831cd4c0 0x1831cabd4 0x1830f4d10 0x1849dc088 0x1883c9f70 0x1000fbd7c 0x182c928b8)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
- First throw call stack:
-
I tried with cordova-plugin-media master branch.
Cordova CLI version: 6.1.1
Cordova iOS: 4.1.1
Do you need anything else from me?
I also add my version infos as I was also unable to play any sounds on iOS:
Installed platforms:
ios 4.1.0
cordova-plugin-media 2.2.0 "Media"
I downgraded to 2.1.0 and it works.
GitHub user alsorokin opened a pull request:
https://github.com/apache/cordova-plugin-media/pull/108
CB-10849 (ios) Fixed a crash when playing soundfiles consecutively
<!--
Please make sure the checklist boxes are all checked before submitting the PR. The checklist
is intended as a quick reference, for complete details please see our Contributor Guidelines:
http://cordova.apache.org/contribute/contribute_guidelines.html
Thanks!
-->
-
-
- Platforms affected
iOS
- Platforms affected
-
-
-
- What does this PR do?
Fixes a crash by ensuring that the avPlayer is in correct state before invoking seekTo.
- What does this PR do?
-
-
-
- What testing has been done on this change?
Bug reproduced and fix tested by running automatic tests on iPad 2 with iOS 8.1
- What testing has been done on this change?
-
-
-
- Checklist
-
- [x] [ICLA](http://www.apache.org/licenses/icla.txt) has been signed and submitted to secretary@apache.org.
- [x] [Reported an issue](http://cordova.apache.org/contribute/issues.html) in the JIRA database
- [x] Commit message follows the format: "CB-3232: (android) Fix bug with resolving file paths", where CB-xxxx is the JIRA ID & "android" is the platform affected.
- [x] Added automated test coverage as appropriate for this change (already covered)
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/alsorokin/cordova-plugin-media CB-10849
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/cordova-plugin-media/pull/108.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #108
commit f1528f4e0ab477086165479e9d7086608fbf760f
Author: Alexander Sorokin <alexander.sorokin@akvelon.com>
Date: 2016-08-22T13:43:20Z
CB-10849 (ios) Fixed a crash when playing soundfiles consecutively
Github user cordova-qa commented on the issue:
https://github.com/apache/cordova-plugin-media/pull/108
Cordova CI Build has completed successfully.
*Commit* - [Link](https://github.com/apache/cordova-plugin-media/pull/108/commits/f1528f4e0ab477086165479e9d7086608fbf760f)
*Dashboard* - [Link](http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-media-pr/60/)
Github user vladimir-kotikov commented on the issue:
https://github.com/apache/cordova-plugin-media/pull/108
LGTM
Github user cordova-qa commented on the issue:
https://github.com/apache/cordova-plugin-media/pull/108
Cordova CI Build has completed successfully.
*Commit* - [Link](https://github.com/apache/cordova-plugin-media/pull/108/commits/948fe35979e9985cc0df3039eb51fae108a8605f)
*Dashboard* - [Link](http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-media-pr/69/)
Commit 948fe35979e9985cc0df3039eb51fae108a8605f in cordova-plugin-media's branch refs/heads/master from alsorokin
[ https://git-wip-us.apache.org/repos/asf?p=cordova-plugin-media.git;h=948fe35 ]
CB-10849 (ios) Fixed a crash when playing soundfiles consecutively
This issue is due to recent regressions introduced after the introduction of a feature whose goal is the handling of streaming soundfiles from remote sources.