Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Implement playing audio in background #231

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

adriano-di-giovanni
Copy link
Contributor

Platforms affected

  • Android
  • iOS

On iOS, I only added a startPlayingAudioInBackground that's a proxy tostartPlayingAudio because the latter already plays the audio in a background thread.

Motivation and Context

Playing audio in a separate thread on Android greatly improved the performance of our apps.

Description

I added Media.prototype.playInBackground to the javascript interface.
I added the method startPlayingAudioInBackground to both Android and iOS native interfaces.

Testing

The changes are pretty minimal. I installed the plugin in a new cordova project and tested it manually.

@janpio
Copy link
Member

janpio commented Jun 19, 2019

Can you please add some documentation in README.md about this @adriano-di-giovanni? Thanks.

@adriano-di-giovanni
Copy link
Contributor Author

@janpio, done. Thanks.

@janpio janpio changed the title implement playing audio in background Implement playing audio in background Jun 20, 2019
@janpio janpio changed the title Implement playing audio in background feat: Implement playing audio in background Jul 4, 2019
@janpio janpio closed this Jul 4, 2019
@janpio
Copy link
Member

janpio commented Jul 4, 2019

CI, please rerun the tests with current configuration.

@janpio janpio reopened this Jul 4, 2019
@ghenry22
Copy link
Contributor

As iOS already runs the play command in a background thread anyway, why not just update Android to have the same behaviour by default? No need to introduce any new functions then and the change is backward compatible with any existing implementation of the plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants