diff --git a/lib/features/iptv/services/xtream_service.dart b/lib/features/iptv/services/xtream_service.dart index 4795083..6e04c0e 100644 --- a/lib/features/iptv/services/xtream_service.dart +++ b/lib/features/iptv/services/xtream_service.dart @@ -54,13 +54,12 @@ class XtreamService { /// Generate stream URL for live TV /// - /// Uses .ts format for direct continuous streaming (avoids HLS segment 403 issues) + /// Uses .m3u8 format for HLS streaming (compatible with hls.js player) String getLiveStreamUrl(String streamId) { if (_currentPlaylist == null) throw Exception('No playlist configured'); - // Use .ts format instead of .m3u8 for direct streaming - // This avoids the need toseparate segment requests which may be blocked by CORS or 403 - final url = '${_currentPlaylist!.dns}/live/${_currentPlaylist!.username}/${_currentPlaylist!.password}/$streamId.ts'; + // 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); } diff --git a/web/player.html b/web/player.html index a5748ff..9aa00a1 100644 --- a/web/player.html +++ b/web/player.html @@ -56,6 +56,7 @@ left: 50%; transform: translate(-50%, -50%); color: #fff; + text-align: center; } .spinner { @@ -65,6 +66,7 @@ border-top-color: transparent; border-radius: 50%; animation: spin 1s linear infinite; + margin: 0 auto 16px; } @keyframes spin { @@ -72,6 +74,20 @@ transform: rotate(360deg); } } + + #debug { + position: absolute; + bottom: 10px; + left: 10px; + color: #0f0; + font-size: 12px; + font-family: monospace; + background: rgba(0, 0, 0, 0.7); + padding: 8px; + border-radius: 4px; + max-width: 80%; + word-break: break-all; + } @@ -80,26 +96,38 @@