当你按下youtube播放器的全屏按钮时,它会进入横向模式,当你再次按下它时,它会回到纵向模式,但状态栏会永久隐藏在整个应用程序中。
如果有人知道**如何在纵向模式下显示状态栏。**请让我知道。谢谢!
代码如下:
import 'package:flutter/material.dart';
import 'package:youtube_player_flutter/youtube_player_flutter.dart';
/// Creates list of video players
class VideoList extends StatefulWidget {
@override
_VideoListState createState() => _VideoListState();
}
class _VideoListState extends State<VideoList> {
final List<YoutubePlayerController> _controllers = [
'K4TOrB7at0Y',
]
.map<YoutubePlayerController>(
(videoId) => YoutubePlayerController(
initialVideoId: videoId,
flags: const YoutubePlayerFlags(
autoPlay: false,
),
),
)
.toList();
@override
Widget build(BuildContext context) {
return YoutubePlayerBuilder(
player: YoutubePlayer(controller: _controllers.first),
builder: (p0, p1) {
return Scaffold(
appBar: AppBar(
title: Text('Video Player'),
),
body: Column(children: [
p1,
]),
);
},
);
}
}
输出:https://drive.google.com/file/d/1TkuDkLVflFGBNv90Tywh6CuCN3BK0EG_/view?usp=sharing x1c 0d1x谢谢!
2条答案
按热度按时间ogq8wdun1#
我认为你应该把脚手架包在Youtube播放器构建器外面。
thtygnil2#
只需将
SystemUiOverlay.top
添加到YoutubePlayerBuilder
的onEnterFullScreen
回调中,即可按照以下方式持久显示状态栏。构建方法