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

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

GitHub user fafaman opened a pull request:

    https://github.com/apache/cordova-plugin-media/pull/88

    Request audio focus when playing, pause when focus lost…

    This solves https://issues.apache.org/jira/browse/CB-10951
    
    Request audio focus when playing.
    Pause audio when audio focus is lost.
    Resume playing when audio focus is granted again.
    
    In my opinion, this is closer to the developers expected behaviour and less 
intrusive to the user. Also this is closer to the iOS behavior of 
cordova-plugin-media. Maybe this should depend on a config.xml setting to 
accommodate developers using cordova-plugin-media for sound effects.
    
    Thanks for considering this pull request,  I would be happy to enhance the 
patch if needed.
    
    Regards,
    Fabrice.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/fafaman/cordova-plugin-media 
android-handle-audio-focus

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/cordova-plugin-media/pull/88.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 #88
    
----
commit 01e80d70fc97cda1c16ad58ddb62ee0f4427effb
Author: Fabrice Lebas <fabrice.le...@gmail.com>
Date:   2016-03-24T12:28:20Z

    Request audio focus when playing; Pause audio when audio focus is lost; 
resume playing when audio focus is granted again.

----


> Android audio focus should be respected
> ---------------------------------------
>
>                 Key: CB-10951
>                 URL: https://issues.apache.org/jira/browse/CB-10951
>             Project: Apache Cordova
>          Issue Type: Improvement
>          Components: Android, Plugin Media
>    Affects Versions: Master
>         Environment: Android
>            Reporter: Fabrice Lebas
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> Playing a media will not stop other applications that are already playing a 
> media. Other applications playing a media will not cause cordova to stop 
> playing its media. This is because the audio focus logic is not implemented.  
> This results in both applications playing audio at the same time. Although 
> this behaviour is valid (sound effects, notifications) this is not the 
> expected behavior for most applications playing a media.



--
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