|
@@ -961,7 +961,7 @@ public class HtmlActivity extends BaseActivity<ActivityHtml1Binding> implements
|
|
|
JSONObject contentJson = jsonObject.optJSONObject("content");
|
|
|
if (contentJson != null) {
|
|
|
String videoUrl = contentJson.optString("url");
|
|
|
- if(!TextUtils.isEmpty(videoUrl)){
|
|
|
+ if (!TextUtils.isEmpty(videoUrl)) {
|
|
|
ARouter.getInstance().build(RouterPath.MusicTuner.MUSIC_SELECT_VIDEO_FRAME)
|
|
|
.withString("videoFilePath", videoUrl)
|
|
|
.withBoolean("isLocalFile", false)
|
|
@@ -1039,10 +1039,10 @@ public class HtmlActivity extends BaseActivity<ActivityHtml1Binding> implements
|
|
|
if (isVideo) {
|
|
|
ToastUtil.getInstance().showShort("视频已保存到相册");
|
|
|
FileUtils.saveVideoToGallery(HtmlActivity.this, filePath);
|
|
|
- }else{
|
|
|
- FileUtils.saveAudioToMusic(HtmlActivity.this,filePath);
|
|
|
+ } else {
|
|
|
+ FileUtils.saveAudioToMusic(HtmlActivity.this, filePath);
|
|
|
String fileName = FileUtils.getFileName(filePath);
|
|
|
- ToastUtil.getInstance().showShort("保存成功,文件存储路径: 手机存储/Music/yyszkt/"+fileName);
|
|
|
+ ToastUtil.getInstance().showShort("保存成功,文件存储路径: 手机存储/Music/yyszkt/" + fileName);
|
|
|
}
|
|
|
}
|
|
|
});
|
|
@@ -1288,6 +1288,20 @@ public class HtmlActivity extends BaseActivity<ActivityHtml1Binding> implements
|
|
|
} catch (JSONException e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
+ } else if (requestCode == PictureConfig.CHOOSE_REQUEST && mUploadCallbackAboveL != null) {
|
|
|
+ // 图片、视频、音频选择结果回调
|
|
|
+ List<LocalMedia> selectList = PictureSelector.obtainMultipleResult(data);
|
|
|
+ String avatar = null;
|
|
|
+ if (selectList != null && selectList.size() > 0) {
|
|
|
+ avatar = selectList.get(0).getCompressPath();
|
|
|
+ }
|
|
|
+ LOG.i("pq", "avatar:" + avatar);
|
|
|
+ if (avatar != null) {
|
|
|
+ mUploadCallbackAboveL.onReceiveValue(new Uri[]{PictureFileUtils.parUri(getApplicationContext(), new File(avatar))});
|
|
|
+ } else {
|
|
|
+ mUploadCallbackAboveL.onReceiveValue(new Uri[]{});
|
|
|
+ }
|
|
|
+ mUploadCallbackAboveL = null;
|
|
|
} else if (requestCode == 1000) {
|
|
|
if (data != null) {
|
|
|
try {
|
|
@@ -1307,25 +1321,6 @@ public class HtmlActivity extends BaseActivity<ActivityHtml1Binding> implements
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
}
|
|
|
- if (requestCode == PictureConfig.CHOOSE_REQUEST && mUploadCallbackAboveL != null) {
|
|
|
- // 图片、视频、音频选择结果回调
|
|
|
- List<LocalMedia> selectList = PictureSelector.obtainMultipleResult(data);
|
|
|
- String avatar = null;
|
|
|
- if (selectList != null && selectList.size() > 0) {
|
|
|
- avatar = selectList.get(0).getCompressPath();
|
|
|
- }
|
|
|
- LOG.i("pq","avatar:"+avatar);
|
|
|
- if (avatar != null) {
|
|
|
- mUploadCallbackAboveL.onReceiveValue(new Uri[]{PictureFileUtils.parUri(getApplicationContext(), new File(avatar))});
|
|
|
- } else {
|
|
|
- mUploadCallbackAboveL.onReceiveValue(new Uri[]{});
|
|
|
- }
|
|
|
- mUploadCallbackAboveL = null;
|
|
|
-
|
|
|
- } else {
|
|
|
- if (mUploadCallbackAboveL != null)
|
|
|
- mUploadCallbackAboveL.onReceiveValue(new Uri[]{});
|
|
|
- }
|
|
|
} else if (requestCode == REQUEST_CODE_FILE_CHOOSER) {
|
|
|
Uri result = data == null || resultCode != RESULT_OK ? null : data.getData();
|
|
|
if (result == null) {
|
|
@@ -1386,7 +1381,7 @@ public class HtmlActivity extends BaseActivity<ActivityHtml1Binding> implements
|
|
|
}
|
|
|
clearUploadMessage();
|
|
|
return;
|
|
|
- } else if(requestCode == REQUEST_CODE_VIDEO_COVER){
|
|
|
+ } else if (requestCode == REQUEST_CODE_VIDEO_COVER) {
|
|
|
if (data != null) {
|
|
|
String videoPath = data.getStringExtra(Constants.COMMON_EXTRA_KEY);
|
|
|
uploadVideoCoverFile(videoPath);
|
|
@@ -1398,16 +1393,16 @@ public class HtmlActivity extends BaseActivity<ActivityHtml1Binding> implements
|
|
|
}
|
|
|
String selectAddress = data.getStringExtra("selectAddress");
|
|
|
selectAddress(selectAddress);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
if (mUploadCallbackAboveL != null)
|
|
|
mUploadCallbackAboveL.onReceiveValue(new Uri[]{});
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
- private void uploadVideoCoverFile(String filePath){
|
|
|
- File file =new File(filePath);
|
|
|
- if(!file.exists()){
|
|
|
+ private void uploadVideoCoverFile(String filePath) {
|
|
|
+ File file = new File(filePath);
|
|
|
+ if (!file.exists()) {
|
|
|
return;
|
|
|
}
|
|
|
UploadHelper uploadHelper = new UploadHelper(HtmlActivity.this, UploadConstants.UPLOAD_TYPE_OTHER);
|