I have .mp4 file. If I placed it in the memory card, android's default video player can play it normally. But If I upload it to the web server and try to play it through the web browser of Android, it is giving mag saying, "Sorry, the video is not valid for seaming to this device."
The same is happening is I want to play it through my App. I used the following code:
private SurfaceHolder holder;
mPreview = (SurfaceView) findViewById(R.id.surface);
holder = mPreview.getHolder();
holder.addCallback(this);
holder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
mMediaPlayer = new MediaPlayer();
mMediaPlayer.setDataSource("http://www.languagehostess.com/videos/aka1.mp4");
mMediaPlayer.setDisplay(holder);
mMediaPlayer.prepare();
mMediaPlayer.setOnBufferingUpdateListener(this);
mMediaPlayer.setOnCompletionListener(this);
mMediaPlayer.setOnPreparedListener(this);
mMediaPlayer.setOnVideoSizeChangedListener(this);
mMediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
It is giving the follwing error:
Command PLAYER_INIT completed with an error or info PVMFFailure
What is the problem related the that video or code?