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

stops playing in android when screen gets locked #82

Closed
mohamedzaher88 opened this issue Jan 4, 2017 · 7 comments
Closed

stops playing in android when screen gets locked #82

mohamedzaher88 opened this issue Jan 4, 2017 · 7 comments

Comments

@mohamedzaher88
Copy link

stops playing in android when screen gets locked

@yascasa
Copy link

yascasa commented Apr 20, 2017

i have the same problem
audio streaming have no sens if is stoping after locked screen or application on sleep

@alexhackney
Copy link

Have you tried using the background mode plugin?
https://ionicframework.com/docs/native/background-mode/

@christianwico
Copy link

@alexhackney It doesn't work even with the background-mode plugin. Still stops when you press HOME, switch applications, and/or you put the device on standby.

import { StreamingMedia, StreamingAudioOptions } from '@ionic-native/streaming-media';
import { BackgroundMode } from '@ionic-native/background-mode';

[...]

let options: StreamingAudioOptions = {
   bgColor: '#008A99',
   bgImage: image,
   successCallback: () => { this.background.disable(); }
};
    
this.background.enable();
this.streamingMedia.playAudio(
  `${ EnvironmentProvider.PODCAST_AUDIO_ENDPOINT }${ id }/audio`,
  options
);

@alexhackney
Copy link

Works here.

@christianwico
Copy link

@alexhackney Welp. Really doesn't work. I resorted to using HTML5 <audio> tags instead. Not the most "native" way to do it, but at least it works.

@oghanbari
Copy link

i have the same problem , playVideo is ok but playAudio has this problem and playback stopped on screen lock

@shamilovtim
Copy link
Collaborator

I can probably provide a PR in the future if necessary

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

No branches or pull requests

6 participants