上傳視頻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");
//暫時創(chuàng)建一個沒有內(nèi)容的視頻截圖路口
bitmap2File(getVideoThumb(file.getPath()),f);
//創(chuàng)建截圖
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());
}
最后還有上傳視頻信息就不寫上來了 ...
四個地址都不一樣的,方法一樣而已,不明白為什么上傳視頻后會卡死,然后再重新打開會發(fā)現(xiàn)截圖不顯示,頭像也不顯示了
- 1 回答
- 0 關(guān)注
- 1640 瀏覽
添加回答
舉報
0/150
提交
取消