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

Windows background execution #374

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

Conversation

YoSarin
Copy link

@YoSarin YoSarin commented Apr 8, 2018

Difference from original repository

This repository is trying to solve issues with Windows compatibility of original plugin (mainly by finding workarounds for issue #222).

Changes

  1. Plugin hook to add windows capability backgroundMediaPlayback into windows *.appxmanifest files
  2. Usage of Windows.ApplicationModel.ExtendedExecution functionality to keep app running when minimized
  3. Starting audio playback automatically (to keep application running; quiet, but playing) - might have performance & battery impact

Upsides

  1. Plugin works for Windows applications (Desktop windows tested, haven't tested @mobile)
  2. You can pause application background tasks by clicking pause button under application hover-preview in taskbar (side effect of being "media-app")

Downsides

  1. Windows target is not buildable by [ionic] cordova build|run windows with package cordova-windows in version lower than 6.0
  2. When you're removing plugin, capability of backgroundMediaPlayback is kept in *.appxmanifest files, which means, that app is still not buildable by Cordova CLI (cordova-windows lower than 6.0; to fix it, remove/readd windows platform to project after plugin removal)
  3. Possible severe performance issues/battery drains, because of continuous unstopped playback

@nowrap
Copy link

nowrap commented Jun 18, 2018

I tried to get this to work in an ionic 3 app.

First i removed the background-mode plugin:
ionic cordova plugin rm cordova-plugin-background-mode

Afterwards i added YoSarins branch:
ionic cordova plugin add https://github.com/YoSarin/cordova-plugin-background-mode.git#windows_background_execution

But still my app is paused and audio playback is stopped, when minimizing it.

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

Successfully merging this pull request may close these issues.

None yet

3 participants