mirror of
https://github.com/R0m1k3/xtremobile.git
synced 2026-10-11 17:29:26 +02:00
Merge pull request #48 from R0m1k3/antigravity
feat: Implement core backend server with API, Xtream proxy, and strea…
This commit is contained in:
commit
e320f5ca36
2 files changed
+6
-7
No files matched your search
+3
-4
@@ -433,9 +433,8 @@ Handler _createStreamHandler() {
|
|||||||
|
|
||||||
'-i', iptvUrl,
|
'-i', iptvUrl,
|
||||||
|
|
||||||
// Output format: fragmented MP4 (fMP4) for streaming
|
// Output format: MPEG-TS for streaming (compatible with mpegts.js)
|
||||||
'-f', 'mp4',
|
'-f', 'mpegts',
|
||||||
'-movflags', 'frag_keyframe+empty_moov+default_base_moof',
|
|
||||||
|
|
||||||
// Video: Copy is BEST for performance (0% CPU)
|
// Video: Copy is BEST for performance (0% CPU)
|
||||||
// Browsers support H.264 well.
|
// Browsers support H.264 well.
|
||||||
@@ -495,7 +494,7 @@ Handler _createStreamHandler() {
|
|||||||
return Response.ok(
|
return Response.ok(
|
||||||
controller.stream,
|
controller.stream,
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'video/mp4',
|
'Content-Type': 'video/MP2T',
|
||||||
'Access-Control-Allow-Origin': '*',
|
'Access-Control-Allow-Origin': '*',
|
||||||
'Cache-Control': 'no-cache, no-store',
|
'Cache-Control': 'no-cache, no-store',
|
||||||
'Connection': 'keep-alive',
|
'Connection': 'keep-alive',
|
||||||
|
|||||||
@@ -136,9 +136,9 @@ class _PlayerScreenState extends ConsumerState<PlayerScreen> {
|
|||||||
};
|
};
|
||||||
final modeParam = settings.modeString; // direct, transcode, or auto
|
final modeParam = settings.modeString; // direct, transcode, or auto
|
||||||
|
|
||||||
// Construct the stream URL directly using fMP4 format
|
// Construct the stream URL directly using MPEG-TS format
|
||||||
// We add &ext=.mp4 to force the web player to use Direct Play instead of HLS/MPEGTS
|
// We add &ext=.ts to force the web player to use mpegts.js which is perfect for low-latency live streams
|
||||||
final streamEndpoint = '$baseUrl/api/stream/${widget.streamId}?url=$encodedUrl&quality=$qualityParam&buffer=$bufferParam&timeout=$timeoutParam&mode=$modeParam&ext=.mp4';
|
final streamEndpoint = '$baseUrl/api/stream/${widget.streamId}?url=$encodedUrl&quality=$qualityParam&buffer=$bufferParam&timeout=$timeoutParam&mode=$modeParam&ext=.ts';
|
||||||
|
|
||||||
debugPrint('PlayerScreen: Starting Direct Stream: $streamEndpoint');
|
debugPrint('PlayerScreen: Starting Direct Stream: $streamEndpoint');
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user