[
https://issues.apache.org/jira/browse/CB-7599?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14374824#comment-14374824
]
Ari Najarian edited comment on CB-7599 at 3/22/15 7:16 AM:
-----------------------------------------------------------
For anybody else who needs a workaround for a similar issue, here's what I
ended up doing out of expediency:
Rather than allow any of the short clips to terminate on their own (by calling
.play() and letting them run their course), I stop the clips shortly before
they would terminate using a combination of .play and setTimeout. Here's a
generalized example:
{code}
setTimeout( function(){ clip.stop(); }, ( clip.getDuration() * 1000 - 100) );
clip.play();
{code}
This prevents the audio session from being deactivated, so that cryptic XCode
error is never triggered. It hurts to look at, but it works. Basically, avoid
letting the audio clip stop on its own (keep it running hot).
I would welcome a better solution, but I'll leave this one here for other
non-Objective-C-minded developers.
was (Author: stickbyatlas):
For anybody else who needs a workaround for a similar issue, here's what I
ended up doing out of expediency:
Rather than allow any of the short clips to terminate on their own (by calling
.play() and letting them run their course), I stop the clips shortly before
they would terminate using a combination of .play and setTimeout. Here's a
generalized example:
setTimeout( function(){ clip.stop(); }, ( clip.getDuration() * 1000 - 100) );
clip.play();
This prevents the audio session from being deactivated, so that cryptic XCode
error is never triggered. It hurts to look at, but it works. Basically, avoid
letting the audio clip stop on its own (keep it running hot).
I would welcome a better solution, but I'll leave this one here for other
non-Objective-C-minded developers.
> [Media][iOS 8] Audio exceptions generated when playing audio files
> ------------------------------------------------------------------
>
> Key: CB-7599
> URL: https://issues.apache.org/jira/browse/CB-7599
> Project: Apache Cordova
> Issue Type: Sub-task
> Components: Plugin Media
> Affects Versions: 3.5.0
> Environment: iOS
> Reporter: Dooms
> Attachments: index.js
>
>
> In iOS8, several users have noticed that applications with audio that
> previously worked in iOS7, are generating exceptions in iOS8.
> In my app, it is when pausing one audio, and after a short timeout, playing
> another audio. The exception:
> AVAudioSession.mm:646: -[AVAudioSession setActive:withOptions:error:]:
> Deactivating an audio session that has running I/O. All I/O should be stopped
> or paused prior to deactivating the audio session.
> In another case (Paul's comment below), it was when scrubbing through a
> single audio file. The error:
> ERROR: [0x109894000] 79: AudioQueuePrime posting message to kill mediaserverd
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]