mabeijianxi / small-video-record

利用FFmpeg视频录制微信小视频与其压缩处理
Apache License 2.0
3.46k stars 729 forks source link

当前版本,需要做如下修改,才好用 #376

Open liuyi opened 5 years ago

liuyi commented 5 years ago

1、MediaRecorderActivity.java 修改这个方法,为结束返回结果到上一个: @Override public void onEncodeComplete() { hideProgress(); Intent intent = new Intent(); intent.putExtra(MediaRecorderActivity.OUTPUT_DIRECTORY, mMediaObject.getOutputDirectory()); intent.putExtra(MediaRecorderActivity.VIDEO_URI, mMediaObject.getOutputTempTranscodingVideoPath()); intent.putExtra(MediaRecorderActivity.VIDEO_SCREENSHOT, mMediaObject.getOutputVideoThumbPath()); intent.putExtra("go_home", GO_HOME);

    setResult(RESULT_OK, intent);
    finish();
}

2、MediaRecorderActivity.java 添加CANCEL动作,修复奇怪的问题。

加在 case MotionEvent.ACTION_UP: 下面:

case MotionEvent.ACTION_CANCEL: // startState = false;//added by liuyi mMediaRecorder.setRecordState(false); if (mMediaObject.getDuration() >= RECORD_TIME_MAX) { mTitleNext.performClick(); } else { mMediaRecorder.setStopDate(); setStopUI(); }

                break;

3、SmallVideoLib2的 build.gradle 去掉bintray插件依赖

4、SmallVideoLib2的 build.gradle里的complie 修改为

dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) }