Questions tagged [android-mediaplayer]

MediaPlayer class can be used to control playback of audio/video files and streams in Android devices

MediaPlayer class can be used to control playback of audio/video files and streams.

4792 questions
1
vote
0 answers

Surface View Appears Black while the associated audio is playing in the background(android)

I am basically running a set of video tracks using a custom media player. Every thing works fine until I press home button or go to any other screen, then on after returning to the video play screen I can only hear the audio track as the videos play…
1
vote
1 answer

Exoplayer(SimpleExoPlayer) 's addTextOutput is Deprecated?

I'm implementing about some Media Player, and this player have a many contents from many country, and almost stream has a text track about subtitle. I'm already check this point. @Override public void onCaption() { TrackGroupArray trackGroups =…
asdf9797
  • 21
  • 4
1
vote
2 answers

Android 13 playbackstate callback not called ( from notification buttons)

For mediaplayer, ACTION_SKIP_TO_NEXT and ACTION_SKIP_TO_PREVIOUS both are working fine from notification buttons for android 12 and below. it seems that android 13 has a different behavior according to this. to be clear, below buttons in the…
1
vote
1 answer

How do I know when an audio track has ended in MediaPlayer?

I want to know when my audio track is ended to perform some actions. I faced the problem that OnCompletionListener is not working even if I set mediaPlayer.setLooping(false) Btw, MediaPlayer is working... mediaPlayer.setOnCompletionListener(mp -> { …
nnn
  • 23
  • 4
1
vote
0 answers

Android Media3 Session & Controller - Playback with merging media source

I'm trying to use a media session in my app to make background playback and notifications and all that work. The problem is that the documentation isn't very good and there's missing features. The main feature which was causing me issues is not…
1
vote
1 answer

How Can I Utilize full Features Of media Player In Jetpack compose

Iam Using media Player for audio In my app But Iam not able to play audio smoothly in my app emulator sometimes some unwanted voices are coming is this normal or should I need to do SomeThing and where can I learn more about media Player In JetPack…
1
vote
1 answer

Is it possible to record calls both sides(mic,speaker) in android?

i'm trying to develop an application to record calls bothside(mic and speaker). I've seen there is one app vrecorder providing this vrecorder for android 1.6. Now i want to do this for android 2.2 and above. Can i know is this possible with …
1
vote
1 answer

How to destroy the a media player from a fragment?

I am a solo developer so I am still learning. I am trying to use Fragments for a game's menu. In the menu there is an option to preview and set background music. So in the MusicFragment I have this code: public class MusicFragment extends Fragment…
1
vote
0 answers

Android background sound not played on all devices

I'm developing an android app that is mostly run in the background and uses Firebase Realtime Database for data syncing. I want the app to play a 10 second sound when new data is received from Firebase and I've successfully managed to implement…
Bravo
  • 1,944
  • 4
  • 29
  • 53
1
vote
2 answers

media player onclick listener on fragment

I am trying to configure an app to play sounds corresponding to word in a recyclerview on a fragment, however I am having trouble creating the onclick part of it. I get the below error messages on the Adapter: " None of the following functions can…
1
vote
0 answers

How to find whether audio recording is empty or not?

I want to add validation of the save button i.e., check if edit text or recorded audio (one among these two) has been entered by the user or not if both are not entered then the user gets notified that either enter text or record your audio. I have…
1
vote
0 answers

Android mediaPlayer -19 error caused by a AudioFlinger init -12 error with android 12

I rarely ask questions since there is always a post somewhere explaining my issue but in this case I am running into a rabbit hole from where I am not able to get out alone. I had a tough time trying to understand what's happening with my app. I am…
1
vote
2 answers

How to update SeekBar after android rotation?

I use this media player but when I rotate the emulator (Ctrl+F11) the startPlayProgressUpdater() doesn't work properly. How can I update seekbar after rotation?
Milad Khajavi
  • 2,769
  • 9
  • 41
  • 66
1
vote
0 answers

my app crashes when i change the android theme

i have a music player app, and when i pause the current playing song, return to the MainActivity and change the android theme, it crashes. i can solve the problem by adding android:configChanges="uiMode" in the manifest, but it's not the behavior…
tavinho
  • 15
  • 3
1
vote
0 answers

how to get Android MediaPlayer to recognize audio/aacp correctly?

I have the following problem: if I hand over an uri with the Content Type audio/aacp to the MediaPlayer for Android, the MediaPlayer won't recognize the content type as it should and throws an exception. How can I change it so the MediaPlayer…