|
|
|
@ -227,15 +227,6 @@ public class ProVideoActivity extends AppCompatActivity {
|
|
|
|
|
super.onDestroy();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// @Override
|
|
|
|
|
// public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
|
|
|
|
|
// super.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
|
|
|
|
// if (REQUEST_WRITE_STORAGE == requestCode){
|
|
|
|
|
// if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
|
|
|
|
|
// doTakePicture();
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void onConfigurationChanged(Configuration newConfig) {
|
|
|
|
@ -282,51 +273,4 @@ public class ProVideoActivity extends AppCompatActivity {
|
|
|
|
|
mMode = mVideoView.toggleAspectRatio();
|
|
|
|
|
Log.i(TAG, "画面模式:" + mMode);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// /*
|
|
|
|
|
// * 截图
|
|
|
|
|
// * */
|
|
|
|
|
// public void onTakePicture(View view) {
|
|
|
|
|
// if (mVideoView.isInPlaybackState()) {
|
|
|
|
|
// if (ActivityCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED){
|
|
|
|
|
// ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, REQUEST_WRITE_STORAGE);
|
|
|
|
|
// } else {
|
|
|
|
|
// doTakePicture();
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// private void doTakePicture() {
|
|
|
|
|
// File file = new File(FileUtil.getPicturePath());
|
|
|
|
|
// file.mkdirs();
|
|
|
|
|
//
|
|
|
|
|
// file = new File(file, "pic_" + new SimpleDateFormat("yyyyMMddHHmmss").format(new Date()) + ".jpg");
|
|
|
|
|
// final String picture = mVideoView.takePicture(file.getPath());
|
|
|
|
|
//
|
|
|
|
|
// if (!TextUtils.isEmpty(picture)) {
|
|
|
|
|
// Toast.makeText(ProVideoActivity.this,"图片已保存", Toast.LENGTH_SHORT).show();
|
|
|
|
|
//
|
|
|
|
|
// if (mScanner == null) {
|
|
|
|
|
// MediaScannerConnection connection = new MediaScannerConnection(ProVideoActivity.this, new MediaScannerConnection.MediaScannerConnectionClient() {
|
|
|
|
|
// public void onMediaScannerConnected() {
|
|
|
|
|
// mScanner.scanFile(picture, "image/jpeg");
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// public void onScanCompleted(String path1, Uri uri) {
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
// });
|
|
|
|
|
//
|
|
|
|
|
// try {
|
|
|
|
|
// connection.connect();
|
|
|
|
|
// } catch (Exception e) {
|
|
|
|
|
// e.printStackTrace();
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// mScanner = connection;
|
|
|
|
|
// } else {
|
|
|
|
|
// mScanner.scanFile(picture, "image/jpeg");
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|