mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
For #1105, http server support mp4 range.
This commit is contained in:
parent
7584c47aaf
commit
b9d720c927
3 changed files with 12 additions and 2 deletions
|
@ -486,6 +486,15 @@ srs_error_t SrsHttpFileServer::serve_mp4_file(ISrsHttpResponseWriter* w, ISrsHtt
|
|||
if (range.empty()) {
|
||||
range = r->query_get("bytes");
|
||||
}
|
||||
|
||||
// Fetch range from header.
|
||||
SrsHttpHeader* h = r->header();
|
||||
if (range.empty() && h) {
|
||||
range = h->get("Range");
|
||||
if (range.find("bytes=") == 0) {
|
||||
range = range.substr(6);
|
||||
}
|
||||
}
|
||||
|
||||
// rollback to serve whole file.
|
||||
size_t pos = string::npos;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue