Playing video with VideoView causes MediaPlayer(1873): error (1, -2147483648)
When I try and play a 3GP video with VideoView the following error occurs:
MediaPlayer(1873): error (1, -2147483648)
My source code is:
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.videoplayer);
mVideoView = (VideoView) findViewById(R.id.surface_view);
mVideoView.setOnErrorListener(this);
mVideoView.setOnCompletionListener(this);
mVideoView.setOnPreparedListener(this);
mVideoView.requestFocus();
/*
* MediaController mc=new MediaController(VideoPlayer.this); mc.show(0);
* mc.setEnabled(true); mVideoView.setMediaController(mc);
*/
Intent intent = getIntent();
if (intent == null) {
System.out.println("intent is null");
return;
}
Util.showToast(R.string.play_video, VideoPlayer.this);
String mUri = intent.getStringExtra("path");
mVideoView.setVideoPath(mUri);
mVideoView.start();
System.out.println("path: " + mUri);
}
The error information is:
01-01 00:19:04.000: INFO/ActivityManager(1456): Starting: Intent { cmp=com.android.cameradiag/.VideoPlayer (has extras) } from pid 1873
01-01 00:19:04.015: VERBOSE/videocamera(1873): stopVideoRecording
01-01 00:19:04.015: VERBOSE/videocamera(1873): Releasing media recorder.
01-01 00:19:04.015: VERBOSE/videocamera(1873): closeCamera
01-01 00:19:04.015: ERROR/CameraHal(1387): hardware/ti/omap3/camera-omap4/src/BaseCameraAdapter.cpp:248 disableMsgType - Message type 0x200 subscription no supported yet!
01-01 00:19:04.015: ERROR/OMXCameraAdapter(1387): hardware/ti/omap3/camera-omap4/src/OMXCameraAdapter/OMXCameraAdapter.cpp:3458 stopPreview - Average framerate: 25.296116
01-01 00:19:04.023: ERROR/CameraHal(1387): hardware/ti/omap3/camera-omap4/src/BaseCameraAdapter.cpp:248 disableMsgType - Message type 0x200 subscription no supported yet!
01-01 00:19:04.023: INFO/TIOverlay(1456): Destroying overlay/fd=194/obj=45c97000
01-01 00:19:04.023: DEBUG/TIOverlay(1456): mZorderUsage[0] = 0 should be removed
01-01 00:19:04.023: ERROR/CameraHal(1387): hardware/ti/omap3/camera-omap4/src/AppCallbackNotifier.cpp:1473 stop - AppCallbackNotifier already in stopped state
01-01 00:19:04.195: WARN/ASFDummyExtractor(1387): ASF parser is not available
01-01 00:19:04.195: INFO/StagefrightPlayer(1387): setDataSource('/mnt/media/Video/VID_20000101_001843.3gp')
01-01 00:19:04.195: DEBUG/AwesomePlayer(1387): setDataSource_l(/mnt/media/Video/VID_20000101_001843.3gp)
01-01 00:19:04.203: ERROR/MediaPlayer(1873): error (1, -2147483648)
01-01 00:19:04.257: E开发者_如何学GoRROR/MediaPlayer(1873): Error (1,-2147483648)
01-01 00:19:04.257: DEBUG/VideoView(1873): Error: 1,-2147483648
01-01 00:19:04.296: DEBUG/dalvikvm(1873): GC_EXTERNAL_ALLOC freed 852K, 54% free 2894K/6215K, external 1889K/2137K, paused 32ms
01-01 00:19:04.554: INFO/ActivityManager(1456): Displayed com.android.cameradiag/.VideoPlayer: +447ms
01-01 00:19:07.156: ERROR/Omap4ALSA(1387): called drain&close
01-01 00:19:09.429: ERROR/OMXCameraAdapter(1387): hardware/ti/omap3/camera-omap4/src/OMXCameraAdapter/OMXCameraAdapter.cpp:7229 Handler - Exiting command handler
How do I fix this?
I found root cause: there is no permission for my application to access /mnt/media/Video/VID_20000101_001843.3gp.
精彩评论