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

Filip Maj commented on CB-12714:
--------------------------------

I did a bit of testing with the demo code you shared, [~shazron], to see about 
background audio support on Android.

First, the AmplitudeJS demo site works fine and plays in the background just 
great on Chrome for Android 59 on a Google Pixel running Android 7.1.0 and 
7.1.2 (tested on both).

I also then tweaked the demo code and put it into a cordova-compatible form. 
It's available on my repo here: https://github.com/filmaj/cordova-amplitudejs

This cordova app form of the amplitudejs demo works great on the browser 
platform (as expected) as well background audio worked great on Android 7.1.0 
and 7.1.2 (Google Pixel once more) using cordova-android 6.2.2 - opened the app 
up, hit the play button, then hit the home button, and things continued to play 
as expected.

I think that makes this pretty promising!

To [[email protected]]'s point, worth noting that if you run this in 
Chrome for Android and run in the background, you _will_ get a "sticky" 
notification in the notification bar showing you that something is playing (and 
giving you the control to pause what's currently playing). _However_, in the 
cordova-android-wrapped version of the app, this notification was not there. 
FYI.

I will do a bit more testing on emulators with earlier versions of Android to 
see where support for built-in JS {{Audio}} object (which is what AmplitudeJS 
uses) starts to fall apart.

> Media - SUNSET
> --------------
>
>                 Key: CB-12714
>                 URL: https://issues.apache.org/jira/browse/CB-12714
>             Project: Apache Cordova
>          Issue Type: Sub-task
>          Components: cordova-plugin-media
>            Reporter: Shazron Abdullah
>
> See parent issue.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to