solid-software / flutter_vlc_player

📺 Flutter VLC powered video player.
522 stars 253 forks source link

Flutter RTSP Streaming Works on Emulator but Fails on Physical Devices #473

Open gabtassspintel opened 8 months ago

gabtassspintel commented 8 months ago

Hello,

I'm currently working on a Flutter project where I've implemented a video player component using VlcPlayerController to stream RTSP video feeds. While everything seems to work perfectly on both iOS and Android emulators, I'm encountering issues when testing on physical devices, with different behaviors observed on iOS and Android:

iOS Devices: The page containing the video player loads, but the player itself never appears, leaving me with just the blank space where the player should be. Android Devices: The app crashes abruptly before even reaching the page with the video player. I've ensured that there are no error messages in the console that could provide hints as to what might be going wrong. This has left me quite puzzled as to why this discrepancy between emulator and physical device behavior exists.

Given that the component works as expected on emulators, I'm leaning towards thinking this might be related to hardware acceleration, permissions, or perhaps some sort of network security policy that's only enforced on physical devices.

Has anyone else encountered similar issues with VlcPlayerController or RTSP streaming in Flutter on physical devices? Any insights into potential causes or suggestions for troubleshooting steps would be greatly appreciated.

Here's a simplified version of my code for reference:

` class RTSPVideoPlayer extends StatefulWidget { @override _RTSPVideoPlayerState createState() => _RTSPVideoPlayerState(); }

class _RTSPVideoPlayerState extends State { late VlcPlayerController _vlcPlayerController;

@override void initState() { super.initState(); _vlcPlayerController = VlcPlayerController.network( 'rtsp://example.com/stream', autoPlay: true, options: VlcPlayerOptions(), ); }

@override Widget build(BuildContext context) { return Scaffold( body: VlcPlayer( controller: _vlcPlayerController, aspectRatio: 16 / 9, placeholder: Center(child: CircularProgressIndicator()), ), ); }

@override void dispose() { _vlcPlayerController.dispose(); super.dispose(); } } `

thank you in advance!

abhinovpankaj commented 2 days ago

I am facing the same issue on iOS device, on emulator it works just fine.