当我尝试使用VideoView播放3GP视频时,会发生以下错误:
MediaPlayer(1873):错误(1,-2147483648)
我的源代码是:
@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);
}
错误信息是:
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: ERROR/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
我该如何解决这个问题?
答案 0 :(得分:0)
我找到了根本原因:我的应用程序无权访问/mnt/media/Video/VID_20000101_001843.3gp。