Merge pull request #358 from jerry924/issue349_previewseek

issue 349 - add missing code to allow preview seek
This commit is contained in:
Lucas Bickel 2017-11-16 21:07:55 +01:00 committed by GitHub
commit e6238fed16
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 4 deletions

View File

@ -70,11 +70,17 @@ class Application_Common_FileIO
ob_end_flush();
}
// NOTE: We can't use fseek here because it does not work with streams
// (a.k.a. Files stored in the cloud)
while(!feof($fm) && (connection_status() == 0)) {
//These two lines were removed from Airtime 2.5.x at some point after Libretime forked from Airtime.
//These lines allow seek to work for files.
//Issue #349
$cur = $begin;
fseek($fm,$begin,0);
while(!feof($fm) && (connection_status() == 0) && ($cur <= $end)) {
echo fread($fm, 1024 * 8);
}
fclose($fm);
}
}
}