[ 
https://issues.apache.org/jira/browse/CB-7684?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15324133#comment-15324133
 ] 

ASF GitHub Bot commented on CB-7684:
------------------------------------

Github user tbrebant commented on the issue:

    https://github.com/apache/cordova-plugin-media/pull/33
  
    _(same comment as on Jira's CB-7684 ticket)_
    
    We arrived to the same conclusion as Nathan Stryker on Jira and 
@ionut-movila in this PR.
    
    The problem for us is not only that when a media is finished it's stopping 
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:
    ```
    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.
    ```
    We found that `AVAudioSession` is a singleton for the whole app (cf. 
https://developer.apple.com/library/ios/documentation/AVFoundation/Reference/AVAudioSession_ClassReference/).
    
    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.
    
    (cf. 
https://developer.apple.com/library/ios/documentation/Audio/Conceptual/AudioSessionProgrammingGuide/ConfiguringanAudioSession/ConfiguringanAudioSession.html)
    
    In our project we don't use the recording capacities. We removed all 
`avSession setActive:NO` (as in this PR) and it's is working pretty well.
    
    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.
    ```
    
    If I am sending a PR, would anyone be able to test the recording feature?


> [Media] CDVSound Kills any and all playing sound files when a single file 
> finishes
> ----------------------------------------------------------------------------------
>
>                 Key: CB-7684
>                 URL: https://issues.apache.org/jira/browse/CB-7684
>             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
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org

Reply via email to