我开发了一个应用程序。我的应用程序包括视频录制和播放。
我必须播放我从手机录制的视频。这适用于大多数设备(Samsung galaxy ace,Motorola Droid x, etc.,)
,但不适用于某些设备(Droid x2,Nexus,etc.,)
。
我用下面的代码播放视频
String temp_path=Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM)+"/MySaveCellData/dbz_115.3gp";
//Toast.makeText(this,getSaveCellPath(),Toast.LENGTH_LONG).show();
if(temp_path!=null) {
//int width = myView.getMeasuredWidth();
// int height = myView.getMeasuredHeight();
//we add 10 pixels to the current size of the video view every time you touch
//the media controller.
Display display = getWindowManager().getDefaultDisplay();
int width = display.getWidth();
int height = display.getHeight();
MediaController mediaController = new MediaController(this);
mediaController.setAnchorView(myView);
myView.setMediaController(mediaController);
myView.setKeepScreenOn(true);
//myView.setVideoAspect(width,height);
//myView.setVideo
myView.setVideoPath(temp_path);
myView.start();
myView.requestFocus();
}
else
Toast.makeText(this,"Video Path Not Found, or is set to null",Toast.LENGTH_LONG).show();
}
谁能告诉我什么是问题和解决方案。
提前致谢。
最好的祝福。