Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

not working when I implement initial fullscreen #6

Open
geek-aryan opened this issue Nov 6, 2023 · 0 comments
Open

not working when I implement initial fullscreen #6

geek-aryan opened this issue Nov 6, 2023 · 0 comments

Comments

@geek-aryan
Copy link

geek-aryan commented Nov 6, 2023

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 ...
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant