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
30
votes
3 answers

How do I use Android ProgressBar in determinate mode?

I am writing a media player and i would like to have a progress bar showing the progress of the song. I found the ProgressBar class, but all i can get on the screen is a circular spinning icon. what im looking for is an actual bar. How do i change…
mtmurdock
  • 12,756
  • 21
  • 65
  • 108
30
votes
4 answers

JavaFX: "Toolkit" not initialized when trying to play an mp3 file through MediaPlayer class

I'm trying to make a simple mp3 play in the background of my program using the following: Media med = new Media(getClass().getResource("intro.mp3").toExternalForm()); MediaPlayer mPlayer = new MediaPlayer(med); mPlayer.play(); The intro.mp3 file is…
Dimitris Sfounis
  • 2,400
  • 4
  • 31
  • 46
29
votes
4 answers

OnCompletion listener with MediaPlayer

How do i use the OnCompletion listener for some music? I would like to press a button to go to another activity that plays some music and then goes back when the music playback is finished. I allready coded the other stuff. I just cant figure out…
SnoX
  • 303
  • 1
  • 4
  • 9
28
votes
7 answers

How to determine video width and height on Android

I have a video file and I want to get width and height of video. I don't want to play it, just to get size. I've tried to use MediaPlayer: MediaPlayer mp = new MediaPlayer(); mp.setDataSource(uriString); mp.prepare(); int width =…
mao
  • 1,364
  • 3
  • 14
  • 26
28
votes
3 answers

How do I play an mp3 in the res/raw folder of my android app?

I have a small (200kb) mp3 in the res/raw folder of my android app. I am trying to run it in an emulator from Eclipse. It is recognized as a resource in the R file but when I try to prepare/start, my activity crashes! Was there something else I…
damonkashu
  • 1,813
  • 5
  • 19
  • 25
27
votes
9 answers

Android Media Player play/pause Button

In my project, I am playing music file in android media player by using the following code MediaPlayer mPlayer = MediaPlayer.create(MyActivity.this, R.raw.myfile); mPlayer.start(); the above is coded in the onclick of the play button. I want to…
Dray
  • 1,904
  • 5
  • 27
  • 42
27
votes
1 answer

java.io.IOException: setDataSource failed.: status=0x80000000

I am trying to play url using media player in activity using: mediaPlayer = MediaPlayer.create(getApplicationContext(), Uri.parse("http://www.pocketjourney.com/downloads/pj/video/famous.3gp"), holder); It's working fine. Same code I use to set it…
CoDe
  • 11,056
  • 14
  • 90
  • 197
26
votes
5 answers

How to set WPF window position in secondary display

I have two displays. I want to make a media player and I want to play video full screen on my secondary display. So I’m trying to make a media player using WPF Here is the code so far I wrote Screen[] _screens =…
A N M Bazlur Rahman
  • 2,280
  • 6
  • 38
  • 51
26
votes
9 answers

Android Stop Background Music

EDIT - FOUND A EASY 5-10 LINE SOLUTION!!! See MY OWN ANSWER BELOW!!! YAY!!!!!!!!! I've searched for 5 hours, dozens of SO posts, no answers, and this seems like the most simple obvious freaking thing!!! EDIT- btw, this is NOT a music player app,…
Mike
  • 489
  • 1
  • 4
  • 11
26
votes
7 answers

Android: MediaPlayer gapless or seamless Video Playing

I can play the videos fine back to back by implementing the OnCompletionListener to set the data source to a different file. No problems there. I call reset() and prepare() just fine. What I haven't been able to figure out, is how to get rid of the…
John Wang
  • 6,136
  • 2
  • 28
  • 23
26
votes
5 answers

"binary was not built with debug information " warning meaning in mfc application?

I am getting the following Warning when i run my Windows Application(MFC) in Windows 7. 'XXX.exe': Loaded 'C:\2010\Debug\bin\plugins\control\libhotkeys_plugin.dll', Binary was not built with debug information. Please Help Me out.Thank You
vasanth kumar
  • 522
  • 1
  • 5
  • 18
25
votes
2 answers

Accuracy of MediaPlayer.seekTo(int msecs)

Why is MediaPlayer.seekTo(int msec) so inaccurate? It's sometimes 30 seconds early (with mp3's of both variable and constant bitrates)! Is seeking with audio inherently problematic or is this method broken? Is it to do with buffering or what? I've…
karnok
  • 1,202
  • 1
  • 12
  • 17
25
votes
7 answers

Problems with MediaPlayer, raw resources, stop and start

I'm new to Android development and I have a question/problem. I'm playing around with the MediaPlayer class to reproduce some sounds/music. I am playing raw resources (res/raw) and it looks kind of easy. To play a raw resource, the MediaPlayer has…
arakn0
  • 499
  • 5
  • 11
  • 15
24
votes
6 answers

Set Notification Sound from Assets folder

I am attaching the sound files in the assets folder for play sound in the notification but I am not able to play sound from the assets folder. I have setting page from which user can set the sound for the notification and also user can play sound.…
24
votes
2 answers

java.lang.IllegalStateException what does it mean?

I'm developing a video application. After 1st video playback done, in the "OnCopletion" I'm trying to start a new one. But it just stops (not crashes) and do nothing. In the log: 10-19 09:44:49.056: ERROR/MediaPlayer(4654): setDataSource called in…
SentineL
  • 4,682
  • 5
  • 19
  • 38