mediaplayer

Android - play sound on button click - Null pointer exception

I am trying to play a sound file on the click of a button. The sound is just 1 sec long. It plays well the first few times I click the button, but after a while it gives a NullPointerException. Here's the code: button[i].setOnClickListener(new OnClickListener() { public void onClick(View view) { mp = ...

Pause any mediaplayer on some event

Hi, I have created an application that read messages with voice. I would like to pause any running media player when a message arrives in order to make the voice more clear. Is there any intent that could achieve this aim? I have noticed that google navigator, for example, is able to pause media player (and other music app like pandora)...

Android MediaPlayer - How to get Correct Duration from Streamed File

When I stream music using the MediaPlayer, it gives me the wrong song duration. Has anyone else encountered this? Work around tips appreciated. ...

MediaPlayer on Android only plays part of my song :(

I am trying to play a file using the MediaPlay. The first time it is played, it only plays for 1 or 2 seconds then cuts out and never returns. The second time I play the song, it goes about 3 seconds. This function is in the onCreate function: checkin.setOnCheckedChangeListener(new OnCheckedChangeListener(){ public void onCheckedC...

Android MediaPlayer issue

Hi there I have followed the steps to create my media player object but I cant understand why it is not playing the music track. I used the following code: mp = new MediaPlayer(); mp.create(this, R.raw.testmed); mp.setVolume(100, 100); mp.start(); but no sound is playing through the emulator, and furthermore when i che...

Android mediaplyer, streaming mp3, occasionally getting 403 errors, any idea why?

Getting sporadic mediaplayer errors similiar to, 08-09 14:32:56.956: ERROR/HTTPDataSource(59): HTTP request failed w/ http status 403 This is usually right after a seek call (however seeking works the majority of the time, it returns these errors maybe 1 out of every 5 times). Sometimes it happens without seeking at all. I am gettin...

make media player

how can i add "using MCI;" in my c# project to make media player ?????? ...

Android: Cannot see video on HTC Hero 1.5

I am trying to play a video through my application. public class VideoScreen extends Activity { public MediaPlayer videoMediaPlayer = new MediaPlayer(); public void onCreate(final Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.videoscreen); SurfaceView demoVideo = (SurfaceView) fi...

display video in a frame in portrait mode using MPMediaPlayer

hey, i have a requirement where i need to display a video at the center of the iPhone screen inside a frame. Is there any way to do this using the basic MPMediaPlayer? I have seen that using the MPMediaPlayer causes the video to play full screen in a landscape mode... So, is there any way that this can be customized to suit my needs? Tha...

what tools to use to encode ogg files for Android 2.2 (some work in 2.1 but not 2.2 )

After the upgrade to Android 2.2 os my application Myan Calendar Countdown 2012 is broken It has been on the Android Market for 5 months and working fine. now the movie file just shows black and some sound files do not play Here are some files that no longer play http://www.roguetreasure.com/downloads/button25.ogg and http://www.roguet...

How to add another video to MPMoviePlayer?

Hello all, Is it possible to make a playlist for MPMoviePlayer? all videos are from internet. While player runs, when it comes to 1 minute position i want to play another video from URL. second video is an ads clip. after ads clip finishes, main video should continue. is it possible? i saw some ipad apps, like hulu plus. what steps sho...

A mutable MediaPlayer class that extends or uses android's MediaPlayer class

Hi all, I've been developing a cool game for android recently (http://www.androidzoom.com/android_games/cards_and_casino/the-best-card-game-everyaniv_jrbe_download.html) and I've been getting requests for a mute button. So I've implemented all the required UI stuff and I'm using the application's sharedPreferences to store the isMuted st...

Force databinding to initialize

Is there any way that one can force databindings to be initialized on controls right after they are created? My problem is that I've created a own UserControl derived control which must do some time consuming processing before it is shown. More exactly, create thumbnails of video media using the MediaPlayer component of .Net. I'm displa...

MediaPlayer.setDataSource() and prepare() not working - android

I'm having a crack at using the MediaPlayer object and not having much success. If I add a sound asset to my raw folder and call it using the int value within R, it works fine. But I want to be able to pull things off of url. According to all of the documentation I've read setDataSource() should accept a string param with a url to a f...

How to embed .wmv into html in a plugin-agnostic fashion?

Hi all, I have a follow-up to this question here: http://stackoverflow.com/questions/2185357/embedded-wmv-video-object-not-working-in-firefox-works-in-ie In response to a "Windows Media Player for Firefox Plugin" bug, I wanted to see if we could use a different plugin (e.g. VLC) to work around the problem. (The bug: WMP plugin does ...

Reusing Android's MediaPlayer

Hi! I'm using the Android's MediaPlayer class to play some remote resources. I would like the user to be able to reuse the MediaPlayer to open some content and then change it to play another one without having to recreate the MediaPlayer. So, I wrote a method to open a resource which, first of all, resets the MediaPlayer so that I can s...

Android mediaplayer error playing mp3 stream after a long pause

Devices: Android 1.5 on HTC Hero, and emulator 1.5 I am using Mediaplayer to play a stream...this works fine however when it is paused for a while and then resumes it periodically has an error. Searching for the error codes on the internet yield very few results. 08-22 12:18:47.461: ERROR/MediaPlayer(4406): error (1, -18) 08-22 12:18...

How to play multiple .wav files simultaneously in delphi

I wish to multiple .wav files simultaneously in delphi. When I open and plat the first things are fine. However the second one causes a error when it tries to open. It would appear that i can only use one media player at a time.... is there any way around this what do i do? ...

Android MediaPlayer Streaming from a PHP Redirect does not work-out!

Hi, The company I work for is developing an Android App that plays a video file from a URL on web. The video URL is a parameter for a PHP script that encode it properly and redirects to the encoded video as shown below: header('Content-Type: video/'.$format); header('Location:'.$output_video); Where $output_video is the URL to the en...

Android 2.1 camera preview error

hi! I have a problem with using the camera of an Android 2.1 phone (HTC Desire), maybe you can help me. After calling camera.open() DDMS in Eclipse shows the following errors: ERROR/MediaPlayerService(30): error: -2 ERROR/MediaPlayer(30): Unable to to create media player ERROR/CameraService(30): Failed to load CameraService sounds. ...