I am working on a video player application, I want to play .mp4
video in the native video view. I am not able to play video using a URL. I am getting the error "Sorry this video cannot be played" and I am also not able to play downloaded video in the native video view either.
My code for playing video in the video view:
String mUrl = "http://www.servername.com/projects/projectname/videos/1361439400.mp4"; VideoView mVideoView = (VideoView)findViewById(R.id.videoview) videoMediaController = new MediaController(this); mVideoView.setVideoPath(mUrl); videoMediaController.setMediaPlayer(mVideoView); mVideoView.setMediaController(videoMediaController); mVideoView.requestFocus(); mVideoView.start();
Aside from movies and music videos available commercially on UMD, the PSP can also play video files from the Memory Stick. These files must be in MP4 or AVI format. Use a free video file converter if you need to convert a video to a format playable on the PSP.
Reason 1: The media player you are using is not compatible with the format. Reason 2: There could be a codec issue. Reason 3: The MP4 file that you have downloaded could be broken. These are the most common reasons why you may end up looking for how to fix corrupt video files MP4 solutions.
Why won't my video play? The most likely reason you see a “can't open file,” “unsupported audio codec,” or “unsupported video format" error is because your current media player doesn't support the codec of your video file. Another possible reason is that the audio codec is unsupported.
Finally it works for me.
private VideoView videoView; videoView = (VideoView) findViewById(R.id.videoView); Uri video = Uri.parse("http://www.servername.com/projects/projectname/videos/1361439400.mp4"); videoView.setVideoURI(video); videoView.setOnPreparedListener(new MediaPlayer.OnPreparedListener() { @Override public void onPrepared(MediaPlayer mp) { mp.setLooping(true); videoView.start(); } });
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With