上传视频Map<String, String> param = new HashMap<>();
param.put("file","videofile");
Pair<String, File> pair = new Pair(key, file);
OkHttpProxy
.upload()
.url(url)
.file(pair)
.setParams(param)
.setWriteTimeOut(20)
.start(new UploadListener() {
@Override
public void onFailure(Call call, IOException e) {
Log.e("错误", e.toString());
}
上传截图_videoid=js.getString("_id");
url="http://trying-video.herokuapp.com/user/videophoto/"+js.getString("_id")+"?token="+user.token;
loadvideopng(js.getString("_id"));
//开始上传截图
final File file = new File(path);//Environment.getExternalStorageDirectory(), "jiandan02.jpg");
//视频地址
key="vidphotofile";
File f=new File("/sdcard/RoundVideo/RoundImage1.png");
//暂时创建一个没有内容的视频截图路口
bitmap2File(getVideoThumb(file.getPath()),f);
//创建截图
if (!file.exists()) {
// Toast.makeText(con.this, "File not exits!", Toast.LENGTH_SHORT).show();
return;
}
Map<String, String> param = new HashMap<>();
param.put("file","videofile");
Pair<String, File> pair = new Pair(key, f);
OkHttpProxy
.upload()
.url(url)
.file(pair)
.setParams(param)
.setWriteTimeOut(20)
.start(new UploadListener() {
@Override
public void onFailure(Call call, IOException e) {
Log.e("错误", e.toString());
}
最后还有上传视频信息就不写上来了 ...
四个地址都不一样的,方法一样而已,不明白为什么上传视频后会卡死,然后再重新打开会发现截图不显示,头像也不显示了
- 1 回答
- 0 关注
- 1602 浏览
添加回答
举报
0/150
提交
取消