Questions tagged [media-player]

Software or hardware device designed to play audio/video files.

Media player is a term typically used to describe computer software for playing back multimedia files. While many media players can play both audio and video, others focus only on one media type or the other. Such players are known as either audio players or video players and often have a user interface tailored for the specific media type.

Used in two main senses:

  1. A program that enables your computer to record, store and play back audio and video recordings.
  2. A device such as the portable iPod media player that is also used to record, store and play back recordings.
3940 questions
24
votes
4 answers

IllegalStateException calling MediaPlayer.reset()

The documentation for the Android MediaPlayer shows that there are no invalid states for the reset() call: http://developer.android.com/reference/android/media/MediaPlayer.html#Valid_and_Invalid_States (the invalid states are listed as {}, or…
skyler
  • 8,010
  • 15
  • 46
  • 69
24
votes
4 answers

Stream live video from phone to phone using socket fd

I am new to android programming and have found myself stuck I have been researching various ways to stream live video from phone to phone and seem to have it mostly functional, except of course the most important part: playing the stream. It…
24
votes
2 answers

MediaController with MediaPlayer

I want media controls such as play/pause for streaming audio that I am playing in my app. I am using MediaPlayer to stream and play the audio. Can someone provide a code snippet on how to use MediaController with MediaPlayer? Thanks Chris
Chris
  • 545
  • 1
  • 10
  • 17
24
votes
5 answers

Android Media Player: Start called in state 4 error(-38,0)

This is the code am using to fetch a file name(.mp3) dynamically from some other class as am having many mp3 files in my assets folder: playAudioButton.setOnClickListener(new OnClickListener() { @Override public void…
D'yer Mak'er
  • 1,632
  • 5
  • 24
  • 47
23
votes
2 answers

MediaPlayer error -2147483648 when playing file on internal storage

I'm using the Audio Capture sample on android.com to record and play back audio on actual devices. (Motorola touch pad, and Samsung Galaxy S). When I define the audio file path as mFile =…
Thunder Rabbit
  • 5,405
  • 8
  • 44
  • 82
23
votes
4 answers

Android MediaPlayer bug when using reset() and release() calls

The bug I'm seeing is on the calls to reset() and release() never returning thus leaving my application in an indefinitely stopping state. It doesn't matter if I call stop() before reset() or release() the hang can always be reproduced. Anyone…
Jona
  • 13,325
  • 15
  • 86
  • 129
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…
22
votes
6 answers

Android SeekBar to control MediaPlayer progress

I have a SeekBar, it displays correctly MediaPlayer progress. However, I have troubles with seeking - if I seek scroll box somewhere it just returns on the position where audio file is playing. public class EntityPageActivity extends Activity…
Ilya Blokh
  • 11,923
  • 11
  • 52
  • 84
22
votes
1 answer

In h264 NAL units means frame.?

I am working on a h264 video codec. I want to know: Is a single NAL unit in H264 equivalent to one video frame?
Jeegar Patel
  • 26,264
  • 51
  • 149
  • 222
22
votes
3 answers

Send media action on android

I'm looking for a way to send global media action (Play/pause, Next, Previous) to the phone, much like it can take it froma bluetooth paired radio/speaker. I have found the MediaController class…
Remy Grandin
  • 1,638
  • 1
  • 14
  • 34
22
votes
3 answers

Android Media Player: Download to File and Stream From File

I'm using Android's MediaPlayer to play MP3 files that are simultaneously downloaded from the internet using the DownloadManager. I'm aware of the MediaPlayer's capability to stream directly, but I don't want to use that: The obvious advantage you…
Hinton
  • 2,320
  • 4
  • 26
  • 32
22
votes
3 answers

android media player - how to disable range request? (broken audio streaming on Nexus 7)

I have a audio streaming app, which runs a local proxy server. The local proxy server makes a http connection to a internet streaming source, gets and buffers locally the streaming data. Then, inside in the app, I use MediaPlayer to connect to the…
user1512464
  • 341
  • 2
  • 6
21
votes
2 answers

android ANR in MediaPlayer reset

I've got a simple activity which plays video through VideoView public class AVideo extends Activity { private VideoView mVideoView; private MediaController mc; @Override public void onCreate(Bundle savedInstanceState) { …
k4dima
  • 6,070
  • 5
  • 41
  • 39
21
votes
3 answers

MediaPlayer stop playing after about 5 seconds

I'm currently developing a simple game and now it's time to add music and sound effect. I tried using MediaPlayer, just like described here: Android media player bug However I have another problem, the MediaPlayer stop playing the music after about…
Den
  • 255
  • 1
  • 3
  • 8
21
votes
5 answers

Audio stream buffering

I need to play live audio stream, actually it is radio. The problem is that I also need to manage 20 minute buffer for streaming. As far as I understand it's not easy to implement with android. Firstly I checked MediaPlayer, but it doesn't provide…
Eugenious
  • 291
  • 1
  • 2
  • 5