mirror of
https://github.com/R0m1k3/xtremobile.git
synced 2026-10-19 05:09:42 +02:00
feat: Add native video player screen using media_kit for IPTV playback with extensive performance and audio optimizations.
This commit is contained in:
1 parent
915f75661f
commit
d79d130126
4 files changed
+341
-567
No files matched your search
File diff suppressed because it is too large.
Load diff
@@ -196,15 +196,15 @@ class _NativePlayerScreenState extends ConsumerState<NativePlayerScreen>
|
||||
(_player.platform as dynamic)
|
||||
?.setProperty('http-header-fields', 'User-Agent: XtremFlow/1.0');
|
||||
|
||||
// Live Stream optimizations - aggressive reconnection
|
||||
// Live Stream optimizations - reconnection only
|
||||
(_player.platform as dynamic)?.setProperty(
|
||||
'stream-lavf-o',
|
||||
'reconnect=1,reconnect_streamed=1,reconnect_on_network_error=1,reconnect_delay_max=10,reconnect_on_http_error=4xx,5xx',
|
||||
'reconnect=1,reconnect_streamed=1,reconnect_on_network_error=1,reconnect_delay_max=5',
|
||||
);
|
||||
(_player.platform as dynamic)?.setProperty('force-seekable', 'yes');
|
||||
// Removed: force-seekable and live_start_index=-1 which caused rollbacks
|
||||
(_player.platform as dynamic)?.setProperty(
|
||||
'demuxer-lavf-o',
|
||||
'live_start_index=-1,analyzeduration=10000000,probesize=5000000',
|
||||
'analyzeduration=5000000,probesize=2000000',
|
||||
);
|
||||
|
||||
// Optimized for performance and stability on progressive & interlaced streams
|
||||
@@ -384,6 +384,15 @@ class _NativePlayerScreenState extends ConsumerState<NativePlayerScreen>
|
||||
super.deactivate();
|
||||
}
|
||||
|
||||
@override
|
||||
void didChangeAppLifecycleState(AppLifecycleState state) {
|
||||
if (state == AppLifecycleState.paused ||
|
||||
state == AppLifecycleState.inactive ||
|
||||
state == AppLifecycleState.detached) {
|
||||
_player.pause();
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
// Remove lifecycle observer
|
||||
|
||||
Reference in new issue
Block a user