mirror of
https://github.com/R0m1k3/xtremflow.git
synced 2026-10-11 17:30:00 +02:00
feat: introduce core server with API, media streaming, Xtream proxy, and player UI
This commit is contained in:
1 parent
7372f51b19
commit
b244f1f807
2 files changed
+15
-5
No files matched your search
+13
-3
@@ -279,10 +279,17 @@ Future<Response> _streamVideoFile(Uri targetUrl, String? rangeHeader) async {
|
||||
|
||||
// Forward the Range header for seeking support
|
||||
if (rangeHeader != null && rangeHeader.isNotEmpty) {
|
||||
req.headers.set('Range', rangeHeader);
|
||||
// Ensure we request bytes
|
||||
if (!rangeHeader.startsWith('bytes=')) {
|
||||
rangeHeader = 'bytes=$rangeHeader';
|
||||
}
|
||||
req.headers.set(HttpHeaders.rangeHeader, rangeHeader);
|
||||
print('Video streaming with Range: $rangeHeader');
|
||||
}
|
||||
|
||||
// Disable auto-decompression to strictly proxy the stream
|
||||
client.autoUncompress = false;
|
||||
|
||||
final response = await req.close();
|
||||
|
||||
// Get content type from response
|
||||
@@ -303,11 +310,14 @@ Future<Response> _streamVideoFile(Uri targetUrl, String? rangeHeader) async {
|
||||
}
|
||||
|
||||
// Add Content-Range if this is a partial response (206)
|
||||
final contentRange = response.headers.value('content-range');
|
||||
final contentRange = response.headers.value(HttpHeaders.contentRangeHeader);
|
||||
if (contentRange != null) {
|
||||
responseHeaders['content-range'] = contentRange;
|
||||
responseHeaders[HttpHeaders.contentRangeHeader] = contentRange;
|
||||
}
|
||||
|
||||
// Propagate Accept-Ranges
|
||||
responseHeaders[HttpHeaders.acceptRangesHeader] = 'bytes';
|
||||
|
||||
// Return appropriate status code (200 for full, 206 for partial)
|
||||
return Response(
|
||||
response.statusCode,
|
||||
|
||||
Reference in new issue
Block a user