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
28
votes
8 answers

Streaming Youtube Videos

I am writing an application to play youtube videos using streaming. First method: I am getting the RTSP URL to the video using GData APIs. Here is the code to play the RTSP url. VideoView mVideoView = new VideoView(this); …
Vinay
  • 4,743
  • 7
  • 33
  • 43
27
votes
3 answers

Android MediaPlayer takes long time to prepare and buffer

My application takes a long time to prepare and buffer an audio stream. I have read this question Why does it take so long for Android's MediaPlayer to prepare some live streams for playback?, however it just says people have experienced this issue,…
SteveEdson
  • 2,485
  • 2
  • 28
  • 46
27
votes
4 answers

Android: MediaPlayer finalized without being released

I'm using the MediaPlayer class in an app that I'm currently working on. I want to hold on to an instance of the MediaPlayer class for the lifetime of my Activity. I'm releasing the resources from the MediaPlayer class in the onPause() { } method…
magritte
  • 7,396
  • 10
  • 59
  • 79
27
votes
3 answers

Playing default android sound of button, clicking onTouch() method

In my android app I have some buttons, that should work with onTouch() method, course I need to change button's text, when finger in ACTION_DOWN position. But this buttons should to play default android sound of button clicking (like in onClick()…
diamondhands003
  • 497
  • 2
  • 6
  • 10
26
votes
5 answers

Reproducing encrypted video using ExoPlayer

I'm using ExoPlayer, in Android, and I'm trying to reproduce an encrypted video stored locally. The modularity of ExoPlayer allows to create custom components that can be injected in the ExoPlayer, and this seems the case. Indeed, after some…
GVillani82
  • 17,196
  • 30
  • 105
  • 172
26
votes
5 answers

java.lang.IllegalStateException in MediaPlayer.isplaying() method

public static MediaPlayer mp=null; public static void playGeneric(int name, final ImageButton button,final ImageButton pervious,Context context) { …
Sydroid
  • 509
  • 1
  • 8
  • 16
25
votes
6 answers

MediaPlayer setDataSource failed with status=0x80000000 for Ringtone set by filepath on 2.3.4

Title says most of it. My application has been playing ringtones pointed by uri like content://media/internal/audio/media/387 or content://media/external/audio/media/1655 (for custom ringtones on SDcard I believe) using both setDataSource(fileInfo)…
Koger
  • 1,783
  • 2
  • 23
  • 34
23
votes
1 answer

Streaming to the Android MediaPlayer

I'm trying to write a light-weight HTTP server in my app to feed dynamically generated MP3 data to the built-in Android MediaPlayer. I am not permitted to store my content on the SD card. My input data is essentially of an infinite length. I tell…
23
votes
7 answers

How do I access the MediaMetadataRetriever.setDataSource(...) status codes?

I'm getting the following error java.lang.RuntimeException: setDataSource failed: status = 0xFFFFFFEA and I'd like to know what this status is. I'm using the function MediaMetaDataRetriever.setDataSource(String filePath)
Andrew Orobator
  • 7,978
  • 3
  • 36
  • 36
23
votes
2 answers

Android MediaPlayer/VideoView error (1, -2147483648)

I've been having an inconsistent experience with setting a VideoView's video from a file path. VideoView myVideoView = findViewById(R.id.videoView); ... myVideoView.setVideoPath(videoFilename); ... myVideoView.start(); videoFilename is the absolute…
spitzanator
  • 1,877
  • 4
  • 19
  • 29
22
votes
5 answers

How should i do from notification back to activity without new intent

from Android Development, i implement a simple notification by the sample code, but in my app, i don't want to new intent and create the activity again, i just want to back to my last activity(it's a mediaplayer UI). if i use the sample code, it…
22
votes
4 answers

How to loop a sound without gaps in Android?

I want to loop a sound without gaps in android. I tried to use the code mediaplayer.setLooping(true) to loop the sound, but there is always a little pause when the first sound is over and the next sound start.
BrantYu
  • 281
  • 2
  • 6
22
votes
6 answers

Android mediaPlayer - is there an "isPrepared()" or "getStatus()" method?

I'm having issues with Android's MediaPlayer. It seems like it's missing important functionality, mainly a way to get the current status of MediaPlayer or to find out if it's prepared. I know there's the on prepared listener, but the MediaPlayer…
StackOverflowed
  • 5,854
  • 9
  • 55
  • 119
21
votes
6 answers

rtsp video performance as Browser triggered intent vs my application triggered intent

Hi I am creating an app which will play livestream.com's rtsp live channel. I am launching the player using intent within my app as following: iPlayer = new Intent(Intent.ACTION_VIEW); //iPlayer.setType("video/*"); …
user1188837
  • 311
  • 1
  • 4
21
votes
3 answers

What does MEDIA_ERROR_SERVER_DIED mean?

In the Android docs, there is a constant defined MEDIA_ERROR_SERVER_DIED which is described as: Media server died. In this case, the application must release the MediaPlayer object and instantiate a new one. This seems very vague. What does it…
yydl
  • 24,284
  • 16
  • 65
  • 104