m3u8点播文件下载实现
This commit is contained in:
@@ -41,7 +41,7 @@ public class M3U8Delegate<TARGET extends AbsTarget> extends BaseDelegate<TARGET>
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置文件长度,由于m3u8协议的特殊性,你需要设置文件长度才能获取到正确的下载进度百分比
|
* 设置文件长度,由于m3u8协议的特殊性质,你需要设置文件长度才能获取到正确的下载进度百分比
|
||||||
*
|
*
|
||||||
* @param fileSize 文件长度
|
* @param fileSize 文件长度
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -70,6 +70,7 @@ public class M3U8FileInfoThread implements Runnable {
|
|||||||
ConnectionHelp.setConnectParam(mTaskDelegate, conn);
|
ConnectionHelp.setConnectParam(mTaskDelegate, conn);
|
||||||
conn.setConnectTimeout(mConnectTimeOut);
|
conn.setConnectTimeout(mConnectTimeOut);
|
||||||
conn.connect();
|
conn.connect();
|
||||||
|
Map<String, List<String>> head = conn.getHeaderFields();
|
||||||
handleConnect(conn);
|
handleConnect(conn);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|||||||
@@ -256,7 +256,7 @@ public class SingleTaskActivity extends BaseActivity<ActivitySingleBinding> {
|
|||||||
Toast.LENGTH_SHORT).show();
|
Toast.LENGTH_SHORT).show();
|
||||||
getBinding().setStateStr(getString(R.string.re_start));
|
getBinding().setStateStr(getString(R.string.re_start));
|
||||||
getBinding().setSpeed("");
|
getBinding().setSpeed("");
|
||||||
ALog.d(TAG, "md5: " + CommonUtil.getFileMD5(new File(task.getDownloadPath())));
|
ALog.d(TAG, "md5: " + CommonUtil.getFileMD5(new File(task.getFilePath())));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user