We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I can not play cached video offline.
From this code:
private String newResponseHeaders(GetRequest request) throws IOException, ProxyCacheException { String mime = source.getMime(); boolean mimeKnown = !TextUtils.isEmpty(mime); int length = cache.isCompleted() ? cache.available() : source.available(); boolean lengthKnown = length >= 0; long contentLength = request.partial ? length - request.rangeOffset : length; boolean addRange = lengthKnown && request.partial; return new StringBuilder() .append(request.partial ? "HTTP/1.1 206 PARTIAL CONTENT\n" : "HTTP/1.1 200 OK\n") .append("Accept-Ranges: bytes\n") .append(lengthKnown ? String.format("Content-Length: %d\n", contentLength) : "") .append(addRange ? String.format("Content-Range: bytes %d-%d/%d\n", request.rangeOffset, length, length) : "") .append(mimeKnown ? String.format("Content-Type: %s\n", mime) : "") .append("\n") // headers end .toString(); }
HttpProxyCache will always get mime from Internet, and throw Exception if no network. Changed like this can work well:
private String newResponseHeaders(GetRequest request) throws IOException, ProxyCacheException { int length; String mime = null; if (cache.isCompleted()) { length = cache.available(); } else { length = source.available(); mime = source.getMime(); } boolean mimeKnown = !TextUtils.isEmpty(mime); boolean lengthKnown = length >= 0; long contentLength = request.partial ? length - request.rangeOffset : length; boolean addRange = lengthKnown && request.partial; return new StringBuilder().append( request.partial ? "HTTP/1.1 206 PARTIAL CONTENT\n" : "HTTP/1.1 200 OK\n") .append("Accept-Ranges: bytes\n") .append(lengthKnown ? String.format("Content-Length: %d\n", contentLength) : "") .append(addRange ? String.format("Content-Range: bytes %d-%d/%d\n", request.rangeOffset, length, length) : "") .append(mimeKnown ? String.format("Content-Type: %s\n", mime) : "").append( "\n") // headers end .toString(); }
The text was updated successfully, but these errors were encountered:
fix offline work
63ee20f
Fixed in 2.1.2
Sorry, something went wrong.
@ongakuer thanks for reporting about problem
No branches or pull requests
I can not play cached video offline.
From this code:
HttpProxyCache will always get mime from Internet, and throw Exception if no network.
Changed like this can work well:
The text was updated successfully, but these errors were encountered: