Skip to main content
The 2024 Developer Survey results are live! See the results

Questions tagged [android-mediaplayer]

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

android-mediaplayer
0 votes
2 answers
83 views

Android MediaPlayer SurfaceView video restarts on resume

Following is my code to play a video from an url import androidx.appcompat.app.AppCompatActivity; import android.media.MediaPlayer; import android.os.Bundle; import android.view.SurfaceHolder; import ...
amodkanthe's user avatar
  • 4,462
-2 votes
0 answers
11 views

How to Upload songs in python/django MYsql or Sqlite .? [closed]

I want to upload a Media like Song , Video , and other media file on my music player app how can store in my django project file called "model.py" what data type should i give to store that ...
supercool_5's user avatar
0 votes
0 answers
18 views

How do I detect if media3 item transition has been triggered from next or previous seek?

I have implemented media3 with MediaSessionService or my song player service and I am using MediaController for my UI side. In my service I also have implemented MediaSession.Callback(). val ...
Debayan Ghosh Dastider's user avatar
0 votes
0 answers
23 views

Accessing Media3 MediaController in multiple fragments

I have created a PlayerService that inherits MediaSessionService and also has a MediaSession.Callback() as suggested by Android Media3 documentation. Now in order to update the UI based on the ...
Debayan Ghosh Dastider's user avatar
0 votes
0 answers
19 views

Unable to Play any Audio File from Cached File - Media/Exo Player

I am trying to record the audio using MediaRecorder API of android and save the audio file in the cache directory of the app. The audio file gets saved perfectly into the cache dir and is working fine ...
coDeR's user avatar
  • 11
0 votes
1 answer
52 views

Play small duration sound with MediaPlayer or SoundPool on button click

I have an android application written in Kotlin & jetpack compose. The application is running on a device with physical keyboard. My goal is to play a sound every time I click a button. Ideally, I ...
Nontas Papadopoulos's user avatar
1 vote
0 answers
17 views

How to highlight the currently playing song in a RecyclerView after returning from another Activity in Android?

I am working on an Android app using Java, and I have a RecyclerView displaying a list of songs. When a song is selected, it starts playing, and the app navigates to a player Activity. After returning ...
HaxOfficial's user avatar
0 votes
0 answers
16 views

How to Identify Media Type such as if the media playing now is of type Music, AudioBook, Podcast etc

I am playing different media content from different sources. Following are the logs. Podcast browseItem = BrowseItem(mediaId=spotify:episode:67hGvhkaKGjuZ9ZlIkgxoU?contextUri=spotify%3Auser%...
Sajid Khan's user avatar
0 votes
0 answers
103 views

Unable to style Cue in default SubtitleView Media3 ExoPlayer

I am trying to style captions that come into my DASH segment as .vtt files. Scouted the internet for how to do that, and found a suggestion from the ExoPlayer devs here Moving further with the ...
gtxtreme's user avatar
  • 2,885
0 votes
0 answers
28 views

Playing MP3 from res/raw on Vehicle's System in Android Auto App

I'm developing an Android Auto app and trying to play an MP3 file stored in res/raw through the vehicle's audio system. However, the sound is played on the mobile device instead. Library-managed ...
SAMMY's user avatar
  • 1
0 votes
2 answers
32 views

How to get AMPLITUDE in Opus player android by using AudioManager or AudioTrack in Android

I'm using OpusPlayer to play an audio where I need to get the Amplitude. we can get Amplitude if using MediaRecorder by mediaRecorder.getMaxAmplitude() but in OpusPlayer I'm only using audioManager ...
AMAN SINGH's user avatar
  • 3,561
0 votes
1 answer
208 views

In Pixel 7 facing issue like cropping video with exoplayer when opening initially in portrait

In Android Jetpack Compose when using Exoplayer when an app is defaulted in portrait the time of opening the media player shows media with cropping. But the issue was resolved after switching to ...
Anusha C's user avatar
0 votes
2 answers
32 views

How to run music using R.raw.music1 in another thread or background?

I want to run music in background or another thread not on main thread. when i continuedly click on button and call music method then start music without any delay and without freezing main Thread. ...
Human's user avatar
  • 1
0 votes
0 answers
15 views

How to completely destroy Media Player on back pressed in an activity?

My problem is that I have used the MediaPlayer class in an activity to play music. The music is played online from a link, and I have used the prepareAsync method for audio. At the first time, the ...
Javad Moeini Hadizadeh's user avatar
0 votes
0 answers
28 views

Occasional IllegalStateException in Android mediaPlayer.prepare or mediaPlayer.setDataSource

I contribute to an open source Android app for mobile data collection. One of the things it can do is autoplay audio prompts for questions. We are recently seeing crashes from forms that have many ...
Hélène Martin's user avatar

15 30 50 per page
1
2 3 4 5
321