-
Notifications
You must be signed in to change notification settings - Fork 53
single_file_import
chriszeng87 edited this page Aug 17, 2017
·
3 revisions
单个文件的导入
- mp4/mov/3gp的文件可以直接导入,编辑模块可以直接处理。
- m3u8格式文件的导入
m3u8格式的文件,可以使用KSYRemuxKit转为mp4文件,再交给编辑模块编辑,示例代码为:
KSYRemuxKit ksyRemuxKit = new KSYRemuxKit();
ksyRemuxKit.setOnInfoListener(new KSYRemuxKit.OnInfoListener() {
@Override
public void onInfo(KSYRemuxKit ksyRemuxKit, int type, String msg) {
if (type == KSYRemuxKit.INFO_PUBLISHER_STOPPED) {
//成功转为mp4格式的文件,进入编辑页
ksyRemuxKit.release();
dialog.dismiss();
EditActivity.startActivity(ConfigActivity.this, Environment
.getExternalStorageDirectory() + "/newRemux" +".mp4");
}
}
});
ksyRemuxKit.setOnErrorListener(new KSYRemuxKit.OnErrorListener() {
@Override
public void onError(KSYRemuxKit ksyRemuxKit, int type, long msg) {
//格式转换失败
ksyRemuxKit.release();
dialog.dismiss();
Toast.makeText(ConfigActivity.this, "Remux m3u8 " +
"failed", Toast.LENGTH_SHORT).show();
}
});
//开始格式转换
ksyRemuxKit.start(path, Environment.getExternalStorageDirectory() + "/newRemux" +
".mp4");