VdoCipher / sample_flutter_app

Sample Flutter application with VdoCipher flutter plugin integration
4 stars 2 forks source link

not working when I implement initial fullscreen #6

Open geek-aryan opened 10 months ago

geek-aryan commented 10 months ago

class _VdoPlaybackViewState extends State { VdoPlayerController? _controller; final double aspectRatio = 16 / 9; ValueNotifier _isFullScreen = ValueNotifier(true); // Set to true initially

@OverRide void initState() { super.initState(); _isFullScreen.value = true; }

// ... rest of your code ...

@OverRide Widget build(BuildContext context) { return Scaffold( body: Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ Flexible( child: Container( child: VdoPlayer( embedInfo: SAMPLE_1, onPlayerCreated: (controller) => _onPlayerCreated(controller), onFullscreenChange: _onFullscreenChange, onError: _onVdoError, controls: true, // optional, set false to disable player controls ), width: MediaQuery.of(context).size.width, height: _isFullScreen.value ? MediaQuery.of(context).size.height : _getHeightForWidth(MediaQuery.of(context).size.width), ), ), ValueListenableBuilder( valueListenable: _isFullScreen, builder: (context, dynamic value, child) { return value ? SizedBox.shrink() : _nonFullScreenContent(); }, ), ], ), ); }

// ... rest of your code ... }