Fix the error of incomplete data loading on the Android emulator.
This commit is contained in:
parent
bba4ba97b6
commit
f75767ea2a
|
@ -117,11 +117,11 @@ class YoutubeHttpClient extends http.BaseClient {
|
|||
int errorCount = 0}) async* {
|
||||
var url = streamInfo.url;
|
||||
var bytesCount = start;
|
||||
for (var i = start; i < streamInfo.size.totalBytes; i += 9898989) {
|
||||
while (bytesCount != streamInfo.size.totalBytes) {
|
||||
try {
|
||||
final response = await retry(() {
|
||||
final request = http.Request('get', url);
|
||||
request.headers['range'] = 'bytes=$i-${i + 9898989 - 1}';
|
||||
request.headers['range'] = 'bytes=$bytesCount-${bytesCount + 9898989 - 1}';
|
||||
return send(request);
|
||||
});
|
||||
if (validate) {
|
||||
|
|
Loading…
Reference in New Issue