use of com.lansosdk.videoeditor.VideoEditor in project LanSoEditor_common by LanSoSdk.
the class OnlyTestCmdActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.video_edit_demo_layout);
TextView tvHint = (TextView) findViewById(R.id.id_video_editor_demo_hint);
tvHint.setText(R.string.video_editor_demo_hint);
findViewById(R.id.id_video_edit_testaudio).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
isTestAudio = true;
CopyDefaultVideoAsyncTask.copyFile(getApplicationContext(), "niusanjin.mp3");
CopyDefaultVideoAsyncTask.copyFile(getApplicationContext(), "aac20s.aac");
startVideoEditorTask();
}
});
findViewById(R.id.id_video_edit_btn).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// videoPath= CopyDefaultVideoAsyncTask.copyFile(getApplicationContext(),"ping20s.mp4");
// mInfo=new MediaInfo(videoPath,true);
// mInfo.prepare();
// Log.i(TAG,"info true:"+mInfo.toString());
isTestAudio = false;
startVideoEditorTask();
// ------------------
}
});
findViewById(R.id.id_video_play_btn).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
if (isTestAudio) {
playAudio(dstAAC);
} else {
if (SDKFileUtils.fileExist(dstMP4)) {
Intent intent = new Intent(OnlyTestCmdActivity.this, VideoPlayerActivity.class);
intent.putExtra("videopath", dstMP4);
startActivity(intent);
} else {
Toast.makeText(OnlyTestCmdActivity.this, R.string.file_not_exist, Toast.LENGTH_SHORT).show();
}
}
}
});
mEditor.setOnProgessListener(new onVideoEditorProgressListener() {
@Override
public void onProgress(VideoEditor v, int percent) {
// TODO Auto-generated method stub
Log.i(TAG, "current percent is:" + percent);
if (mProgressDialog != null)
mProgressDialog.setMessage("正在处理中..." + String.valueOf(percent) + "%");
}
});
mEditor.setOnProgessListener(new onVideoEditorProgressListener() {
@Override
public void onProgress(VideoEditor v, int percent) {
// TODO Auto-generated method stub
Log.i(TAG, "current percent is:" + percent);
if (mProgressDialog != null)
mProgressDialog.setMessage("正在处理中..." + String.valueOf(percent) + "%");
}
});
isTestAudio = false;
// 删除之前的, 保证这个是唯一的.
if (SDKFileUtils.fileExist(dstMP4)) {
SDKFileUtils.deleteFile(dstMP4);
}
}
Aggregations