feat: Implement a web-based IPTV player with HLS/MPEG-TS support and Flutter communication.

This commit is contained in:
Michael committed 2025-12-17 23:45:56 +01:00
1 parent 2ca92d8425
commit 55acbbc135
28 files changed
+2075 -1448

No files matched your search

+7 -10
View File
@@ -1,5 +1,4 @@
import 'package:flutter/material.dart';
import 'package:flutter/foundation.dart' show kIsWeb;
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:hive_flutter/hive_flutter.dart';
import 'package:media_kit/media_kit.dart';
@@ -13,25 +12,24 @@ import 'core/models/playlist_config.dart';
/// No authentication - direct access to playlist selection
void main() async {
WidgetsFlutterBinding.ensureInitialized();
// Initialize MediaKit (required for video playback)
MediaKit.ensureInitialized();
// Initialize Hive for local storage
await Hive.initFlutter();
// CLEAR CACHE ON STARTUP (Requested by User)
try {
// Clear API/EPG Cache (using default box name 'dio_cache')
await Hive.deleteBoxFromDisk('dio_cache');
debugPrint('XtremFlow: API Cache cleared');
// Clear Image Cache (if using cached_network_image)
// Note: flutter_cache_manager needs to be imported if used explicitly,
// Note: flutter_cache_manager needs to be imported if used explicitly,
// but typically it manages itself. If we want to force clear:
// await DefaultCacheManager().emptyCache();
// await DefaultCacheManager().emptyCache();
// Since we didn't add the import yet, we'll stick to Hive for now as that handles EPG/API.
} catch (e) {
debugPrint('XtremFlow: Failed to clear cache: $e');
}
@@ -40,7 +38,7 @@ void main() async {
if (!Hive.isAdapterRegistered(1)) {
Hive.registerAdapter(PlaylistConfigAdapter());
}
runApp(const ProviderScope(child: MobileApp()));
}
@@ -74,4 +72,3 @@ class MobileApp extends ConsumerWidget {
);
}
}