feat: Add initial IPTV player with HLS.js and mpegts.js support, including UI and parent communication.

This commit is contained in:
Michael committed 2025-12-14 16:05:30 +01:00
1 parent 0c087e0b34
commit 41c4ab05aa
6 files changed
+127 -49

No files matched your search

+6 -3
View File
@@ -102,20 +102,23 @@ class _PlayerScreenState extends ConsumerState<PlayerScreen> {
final service = ref.read(xtreamServiceProvider(widget.playlist));
String streamUrl = '';
// Get settings for VOD transcoding preference
final playerSettings = ref.read(iptvSettingsProvider);
final forceTranscoding = playerSettings.forceVodTranscoding;
// Generate Stream URL based on type
if (widget.streamType == StreamType.live) {
streamUrl = service.getLiveStreamUrl(currentStreamId);
} else if (widget.streamType == StreamType.vod) {
streamUrl = service.getVodStreamUrl(currentStreamId, widget.containerExtension);
streamUrl = service.getVodStreamUrl(currentStreamId, widget.containerExtension, forceTranscoding: forceTranscoding);
} else if (widget.streamType == StreamType.series) {
streamUrl = service.getSeriesStreamUrl(currentStreamId, widget.containerExtension);
streamUrl = service.getSeriesStreamUrl(currentStreamId, widget.containerExtension, forceTranscoding: forceTranscoding);
}
// Store URL for Lite Player
_currentStreamUrl = streamUrl;
final encodedUrl = Uri.encodeComponent(streamUrl);
final playerSettings = ref.read(iptvSettingsProvider);
final streamTypeParam = widget.streamType == StreamType.live ? 'live' : 'vod';
var playerSrc = playerSettings.playerType == PlayerType.lite
? 'player_lite.html?url=$encodedUrl&type=$streamTypeParam'