media-player

Android Stop Background Music

冷暖自知 提交于 2019-11-27 07:06:31
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, just an app to view pics and text, opens multiple activities like menu and about, view diff types of pictures etc. I just want to play some simple background music while looking thru the pics and text, why is that so difficult? another EDIT - it seems the main question really is: "WHY DOES PRESSING THE HOME BUTTON NOT CALL onPause or onStop ???" -so I

Media player playing multiple files at the same time

蓝咒 提交于 2019-11-27 07:03:50
问题 I am having a problem where once the user clicks on a sound to play from my ListView, then while that sound is playing they click on another sound, the 2 sounds they clicked play at the same time. I would like to have the sound that was currently playing, finish, then start the new sound that they most recently clicked. If someone could help me, that would be much appreciated! CODE: ListView BoardList = (ListView) findViewById(R.id.BoardList); String List[] = { "Audio1", "Audio2", "Audio3",

How to resume the mediaplayer?

耗尽温柔 提交于 2019-11-27 06:54:38
I am using a media player. I have the option for starting ,stopping and pausing the player. The problem I have is that I cannot find the option to resume the song from the point that it previously was paused.. Any help provide would be really helpful. Prateek Raj Thank you for your attention but I've got it myself for pausing the Mediaplayer I used: Mediaplayer.pause(); length=Mediaplayer.getCurrentPosition(); and for resuming the player from the position where it stopped lately is done by: Mediaplayer.seekTo(length); Mediaplayer.start(); I think you should go through the documentation found

“First-chance exception” meaning in MFC Application?

泪湿孤枕 提交于 2019-11-27 06:30:45
问题 When I run my Windows Application(MFC) I get two Warnings. First-chance exception at 0x01046a44 in XXX.exe: 0xC0000005: Access violation reading location 0x00000048. First-chance exception at 0x75fdb9bc (KernelBase.dll) in XXX.exe: 0x000006BA: The RPC server is unavailable. May I know what they mean? 回答1: What is a first chance exception? When an application is being debugged, the debugger gets notified whenever an exception is encountered. At this point, the application is suspended and the

iPhone SDK:How do you play video inside a view? Rather than fullscreen

試著忘記壹切 提交于 2019-11-27 06:02:14
I am trying to play video inside a UIView , so my first step was to add a class for that view and start playing a movie in it using this code: - (IBAction)movie:(id)sender{ NSBundle *bundle = [NSBundle mainBundle]; NSString *moviePath = [bundle pathForResource:@"Movie" ofType:@"m4v"]; NSURL *movieURL = [[NSURL fileURLWithPath:moviePath] retain]; MPMoviePlayerController *theMovie = [[MPMoviePlayerController alloc] initWithContentURL:movieURL]; theMovie.scalingMode = MPMovieScalingModeAspectFill; [theMovie play]; } But this just crashes the app when using this method inside it's own class, but

How do I correctly display the position/duration of a MediaPlayer?

情到浓时终转凉″ 提交于 2019-11-27 05:59:04
问题 Hi I want to display player position and player duration in simple date format. that is. 00:00:01/00:00:06 . The first part is current position of the player and the second part is the duration. I have used SimpleDateFormat to try display the duration and position in this format, but it is showing me the output as 05:30:00/05:30:06 . Here is the code I am using: time1 = new SimpleDateFormat("HH:mm:ss"); currentTime.setText("" + time1.format(player.getCurrentPosition()); How do I print out the

Clear video frame from surfaceview on video complete

£可爱£侵袭症+ 提交于 2019-11-27 05:56:02
问题 I have created a media player which plays video on the surface view. After completion of video the last frame of the video remains on the surface. I want to remove the video frame from the surface because after some delay another video starts. The flow of the video is: NOW : Video on surface -> last video frame on surface -> another video on surface. But the required flow is: REQUIRED: Video on surface -> clear surface (black) -> another video on surface. can anyone help to solve this problem

How to Play Streaming Audio/Video from a url?

大城市里の小女人 提交于 2019-11-27 05:23:10
问题 I am new in Android. I am using android os 2.2. I am trying to play streaming audio and video from url. I don't know what to do for that. after 3 days og googling i come to know that I have to use mediaPlayer and MediaController classes. I had use different differend combination of codes found on internet but not succeed. Can anybody guide me what to do for streaming audio/video playing. What about the UI if we use MediaPlayer or Controller class. is there any thing to related these in xml

Streaming to the Android MediaPlayer

拜拜、爱过 提交于 2019-11-27 05:08:44
问题 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 MediaPlayer that its data source should basically be something like "http://localhost/myfile.mp3" . I've a simple server set up that waits for MediaPlayer to make this request. However, MediaPlayer isn't very cooperative. At first, it makes an HTTP

How to get a list of installed media players

≡放荡痞女 提交于 2019-11-27 04:39:06
问题 In my app I have a menu item that I want to open up the user's preferred media player, only interested in audio. Ideally the first time the user chooses this item it would choose the only media player on the phone if they only have one installed, or present them with a list if they have more than one. I would then save off their choice so next time it would open that one. As I understand it, Android has no default media player. I have the original Droid and it has a media player, but I