cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thibaut Brebant (JIRA)" <>
Subject [jira] [Commented] (CB-7684) [Media] CDVSound Kills any and all playing sound files when a single file finishes
Date Fri, 10 Jun 2016 09:15:21 GMT


Thibaut Brebant commented on CB-7684:

We arrived to the same conclusion as [~Stryker908] and GitHub's user ionut-movila in his PR:

The problem for us is not only that when a media is finished it's stopping all the others,
but also that *.release()* is killing all sounds running, even if they were played by another
plugin (or by WebView's default webaudio system), triggering a descriptive:
{code} -[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.

We found that *AVAudioSession* is a singleton for the whole app (cf.

Apple says:
Most apps never need to deactivate their audio session explicitly. Important exceptions include
VoIP (Voice over Internet Protocol) apps, turn-by-turn navigation apps, and, in some cases,
recording apps.


In our project we don't use the recording capacities. We removing all:
avSession setActive:NO
and it's is working pretty well (as in PR

Additionally it may be worth to update the comment:
*// returns whether or not audioSession is available - creates it if necessary*
to something like:
*// returns whether or not audioSession is available - retrieve the instance (app singleton)
if necessary*.

> [Media] CDVSound Kills any and all playing sound files when a single file finishes
> ----------------------------------------------------------------------------------
>                 Key: CB-7684
>                 URL:
>             Project: Apache Cordova
>          Issue Type: Sub-task
>          Components: Plugin Media
>    Affects Versions: 3.5.0
>         Environment: iOS
>            Reporter: Nathan Stryker
> The CDVSound file will kill all playing media files when ever a single file completes
playing. The issue is around like 691 in the method "AudioDidFinishPlaying", with the code:
>     if (self.avSession) {
>         [self.avSession setActive:NO error:nil];
> }
> The reason I think this is a bug is that if a user as Music file A playing in a loop
and Music file B plays, when B completes the "setActive:NO" will kill the avSession of both
A and B. 

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message