Open Gurvinder963 opened 3 years ago
Same issue, follow
In another similar issue, the problem is fixed by wrapping the Scaffold in a YoutubePlayerBuilder
@Lootwig have u own tried it?
I solve the problem rendering only VideoPlayer when isFullScreen mode
....
@override
Widget build(BuildContext context) {
if (isFullScreen) {
return _buildPlayer();
}
return Scaffold(
appBar: AppBar(
elevation: 2,
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
title: Text(widget.video.title, style: TextStyle(color: Colors.black87)),
leading: IconButton(
icon: Icon(
Icons.close,
color: Colors.black87,
),
onPressed: () {
Navigator.pop(context);
},
),
),
body: Container(
child: Column(
children: [_buildPlayer(), _buildControls(), _buildDetails()],
),
),
);
}
...
Widget _buildPlayer() {
return YoutubePlayerBuilder(
onEnterFullScreen: () {
setState(() {
isFullScreen = true;
});
},
onExitFullScreen: () {
setState(() {
isFullScreen = false;
});
},
player: YoutubePlayer(
controller: _controller,
),
builder: (context, player) {
return player;
});
}
I am using youtube player iframe . its working well on tapping full screen button . but when i rotate the device video screen overflow , its cuts from bottom and top .