mirror of
https://github.com/R0m1k3/xtremflow.git
synced 2026-10-12 01:36:20 +02:00
feat: Introduce backend server with live TV proxy, VOD HLS transcoding, and IPTV streaming settings UI.
This commit is contained in:
1 parent
f290f5a7fc
commit
3dc9a8def2
8 files changed
+32
-43
No files matched your search
@@ -34,13 +34,19 @@ PlaylistConfig? _getCurrentPlaylist(Request request) {
|
||||
Handler createLiveStreamHandler(Future<PlaylistConfig?> Function(Request) getPlaylist) {
|
||||
final router = Router();
|
||||
|
||||
// Route: /api/live/{streamId}.ts
|
||||
router.get('/<streamId>.ts', (Request request, String streamId) async {
|
||||
final playlist = await getPlaylist(request);
|
||||
if (playlist == null) {
|
||||
return Response.internalServerError(body: 'No playlist configured');
|
||||
// Route: /api/live/{streamId} (Catch all pattern to debug)
|
||||
router.get('/<streamId|.*>', (Request request, String streamId) async {
|
||||
print('[Live] Incoming request for streamId: $streamId');
|
||||
|
||||
// Remove .ts extension if present
|
||||
if (streamId.endsWith('.ts')) {
|
||||
streamId = streamId.substring(0, streamId.length - 3);
|
||||
}
|
||||
|
||||
final playlist = await getPlaylist(request);
|
||||
|
||||
// ... existing logic ...
|
||||
|
||||
final targetUrl = Uri.parse('${playlist.dns}/live/${playlist.username}/${playlist.password}/$streamId.ts');
|
||||
print('[Live] Proxying: $targetUrl');
|
||||
|
||||
|
||||
Reference in new issue
Block a user