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
1 answer

Android Studio:- The Music is changing after a song is finished does not behave properly

I am aiming to make a simple music player app and I am new to android development I wanted that the app should play the next song when the current song is finished so I paste the code of next Button inside. It does not work according to what I…
1
vote
0 answers

How to set dropdown change value when selected

I tried to make the drop down have a certain amount of choice whenever the total input defined. And by that, each choices could access certain link in array list by index and apply it on the variable of "link_video" that going to pass for the…
1
vote
0 answers

Audio player delays playing next song in lock mode

**> The audio player delays playing the next song in lock mode When you press the power button, the next song will also be played when the phone is connected to Android Studio and it works without problems > Is there any solution ??** I tried…
1
vote
0 answers

Android Album Art

I am developing a sort of media player for android, want to get Album Art, and use this code. Uri sArtworkUri = Uri.parse("content://media/external/audio/albumart"); Uri uri = ContentUris.withAppendedId(sArtworkUri, album_id); …
Vahag Vardanyan
  • 301
  • 6
  • 13
1
vote
1 answer

Native crash: MediaCodec runtime error only in Redmi devices running on Android 12

I started seeing runtime exceptions in Redmi mobile running on Android 12 whenever I try to download a video from the app. It is not happening on Samsung, Motorola or Pixel devices. I re-use most of the code from Google grafika. Here is my MediaUtil…
1
vote
2 answers

MediaPlayer not playing after reopening the app

When i add mediaplayer.start in onResume i was expecting to start the audio when i reopen the the app but it dindt start it public MediaPlayer mediaPlayer; int length = 0; @Override protected void onCreate(Bundle savedInstanceState) { …
user18105926
1
vote
0 answers

AudioManager MODE_IN_COMMUNICATION decreases the sound quality and causing crackling/popping sound

Description of the problem: When the app is connected through Bluetooth headsets, I'm starting the audioManager.startBluetoothSco(). You can check the code below. The connection works well, but I have a problem with the crackling sounds that are…
1
vote
0 answers

Android 10 ContentResolver access to MP3 files on flash drive

I have Android 10 (LineageOS) running on a Raspberry Pi 3. I have a USB flash drive connected to the Raspberry Pi with a load of MP3 files. I can see the drive and files using the "Files" app but even after clearing the Media Store cache and…
1
vote
2 answers

How to play online stream in Android

I have online radio (shout cast ) in web. I want to develop android app for listen this stream. so I want to know how to play online stream in android. using URL. In Android Im not going to Stream the audio. I want listen the web stream from…
Miuranga
  • 2,463
  • 10
  • 51
  • 81
1
vote
1 answer

Android: Synchronize Chronometer with MediaPlayer

I'm using SeekBar in my application and when user seeks it should reset teh chronometer apporpriately. I wrote the code as below. chronometer.setBase(SystemClock.elapsedRealtime()); chronometer.setBase((mediaPlayer.getCurrentPosition())); but it…
Jay Mayu
  • 17,023
  • 32
  • 114
  • 148
1
vote
1 answer

Android "visibility" doesn't change if next instruction take long time

I have following situation in my fragment. @SuppressLint("ClickableViewAccessibility") override fun onCreateView( inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle? ): View? { val view =…
1
vote
3 answers

How to play and pause Spotify embed with JAVASCRIPT?

Can someone explain me how can I play and pause this spotify embed object? I have tried to find the id of the player but I couldn't. URL → https://open.spotify.com/embed-podcast/show/5iKz9gAsyuQ1xLG6MFLtQg This is the iframe code:
JaviR3TicS
  • 35
  • 5
1
vote
1 answer

How to retrieve videos from folders?

Hello I'm new in Android Studio and I really don't know how fix this problem, I really tried every thing but I can't solve this. Problem: I'm trying to retrieve videos from folders but it's not happening, you can see down below in the exampe…
1
vote
0 answers

Android Studio Media Player Issue

I am having issues with running a List through the media player function. Each variable in the list has been hardcoded to correspond to an audio URL for a specific note and I'm using a for loop to loop through the list. I am able to pass the list…
1
vote
1 answer

MediaPlayer audio not playing when setting data source from DropBox

I am making a Music Player Android application for a project and I want to stream music that I have uploaded on DropBox (I tried using Google Drive but apparently the hosting service got deprecated since 2016?). I can't see any errors in my logs but…