All Questions
Tagged with android-service android-mediaplayer
126 questions
0
votes
1
answer
78
views
onPause alternative in android service?
I have a android project that requires music to be played in the background. I believe using a service would be the right thing for this so I set one up in the following way:
internal class Song : ...
1
vote
1
answer
30
views
I'm trying to playmusic using service but it's not working
from here i started the service
Intent intent=new Intent(getActivity(),MyService.class);
s=sn;
u=ur;
intent.putExtra("uri",u);
ServiceConnection ...
0
votes
0
answers
282
views
Media Buttons Reciever not working properly in Android Kotlin
I have a music service class in my media player app that also shows notifications and handle media buttons from the headphone. But when I enable the next and previous media buttons, It does not ...
2
votes
1
answer
371
views
How to start a MediaBrowserServiceCompat in Automotive OS?
I am sending a notification from a worker that has an action which should open the media app. In other words, I want to start the MediaBrowserServiceCompat when the action is clicked. I tried this ...
1
vote
3
answers
415
views
audio player service stops when phone sleeps [duplicate]
I am running audio player service but If I put my phone on sleep the player stops or the background service I don't know what's the problem.
this is my music service class :
public class MusicService ...
0
votes
2
answers
54
views
Cannot create MediaPlayer inside thread
I have a Service that starts a thread, where I need to create a MediaPlayer:
Inside onStartCommand I call the main function that runs a thread.
public int onStartCommand(Context context, Intent intent,...
1
vote
2
answers
1k
views
Android MediaPlayer stops after playing 1 minute in background
I am playing an audio stream from mediaPlayer using a service but it stops playing the song after approx one minute of being in the background or the screen turned off. While on the other hand it ...
1
vote
0
answers
26
views
Service, setVolume and Seekbar
I have a service with MediaPlayer in it. I would like to change the volume in activity through seekbar. However, I can't invoke my function typed in service in activity. It returns for a null object. ...
0
votes
0
answers
147
views
Android: MediaPlayer onPrepared Not Working
So I'm attempting to have an audio stream play via the MediaPlayer Class. I was able to play the stream when only it in a Activity. Now I'm trying to have it work via a Service. I added comments to ...
3
votes
1
answer
635
views
Android MVVM - Where to bind to a Mediaplayer bound service?
I have a permanent bound service with a Mediaplayer and a MediaSession.
I am refactoring my app to an MVVM architecture with HILT .
I'd like to know where I should bind to the service and where to ...
3
votes
2
answers
961
views
ProtocolException in MediaPlayer streaming Service (MediaHTTPConnection: readAt 20709376 / 32768 => java.net.ProtocolException)
I've made an Android app that main feature is to play audio stream from my server. But for some reason music stops playing after about 20 minutes and the app is throwing ProtocolException (logs from ...
1
vote
1
answer
288
views
Can't work out how to start() media playing from a fragment
Sorry for the true noob question, but I've got a mental block over it...
I have media player in a service and a fragment with a play button that I want to control the media player...
Here's the ...
0
votes
1
answer
556
views
How can I stop MediaPlayer when I leave my application, but not when I move to another Activity (Android Studio)
I am trying to make an game on android studio where background music plays continuously even when you switch activities, but I want the music to stop when the user leaves the application. I searched ...
1
vote
1
answer
5k
views
Android: How to host media player as a service?
I have an app with a playlist and a media player UI.
The issue I am having is when I am playing music, and I re-enter the activity (using a menu), it restarts the media file (because it is calling ...
1
vote
1
answer
348
views
Implement Background Service on a Media Player
I'm trying to implement the background service on a media player that runs a web radio. But I'm a beginner in programming with java/Android and I'm not able to implement the codes I've seen as ...