1
我開發了一個應用程序。我的應用程序包括視頻錄製和播放。應用程序未在某些設備上工作
我必須播放我錄製的視頻。這在大多數設備(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();
}
誰能告訴我是什麼問題和解決方案也。
在此先感謝。
最好的問候。
定義「不工作」。 –
視頻未在某些手機中播放 – Ramakrishna
這些設備上的logcat中是否有任何堆棧跟蹤或其他異常輸出? –