feat: add Dart server for API, Xtream proxy, and FFmpeg streaming, updating Dockerfile for ffmpeg support.

This commit is contained in:
Michael committed 2025-12-06 11:49:39 +01:00
1 parent 0ed1d19ea0
commit 39dabfa7b5
4 files changed
+297 -55

No files matched your search

+10 -5
View File
@@ -52,15 +52,20 @@ class XtreamService {
_currentPlaylist = playlist;
}
/// Generate stream URL for live TV
/// Generate stream URL for live TV via FFmpeg transcoding
///
/// Uses .m3u8 format for HLS streaming (compatible with hls.js player)
/// Returns the start URL for FFmpeg transcoding endpoint.
/// The endpoint will start FFmpeg and return the local HLS URL.
String getLiveStreamUrl(String streamId) {
if (_currentPlaylist == null) throw Exception('No playlist configured');
// Use .m3u8 format for HLS streaming - the player.html handles this via hls.js
final url = '${_currentPlaylist!.dns}/live/${_currentPlaylist!.username}/${_currentPlaylist!.password}/$streamId.m3u8';
return _wrapWithProxy(url);
// Use .ts format for direct MPEG-TS streaming (FFmpeg handles this better)
final iptvUrl = '${_currentPlaylist!.dns}/live/${_currentPlaylist!.username}/${_currentPlaylist!.password}/$streamId.ts';
// Use FFmpeg transcoding endpoint
final baseUrl = html.window.location.origin;
final encodedUrl = Uri.encodeComponent(iptvUrl);
return '$baseUrl/api/stream/$streamId?url=$encodedUrl';
}
/// Generate stream URL for VOD (movies)