video_player 按键监听
This commit is contained in:
parent
a88c9d6298
commit
1d621444fb
@ -114,11 +114,18 @@ class _CustomVideoPlayerState extends State<CustomVideoPlayer> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
toolbarHeight: 35,
|
||||
),
|
||||
// appBar: AppBar(
|
||||
// toolbarHeight: 35,
|
||||
// ),
|
||||
body: player == null
|
||||
? Center(
|
||||
? PopScope(
|
||||
onPopInvoked: (val) {
|
||||
if (!val) {
|
||||
return;
|
||||
}
|
||||
_controller!.pause();
|
||||
},
|
||||
child: Center(
|
||||
child: _controller!.value.isInitialized
|
||||
? AspectRatio(
|
||||
aspectRatio: _controller!.value.aspectRatio,
|
||||
@ -130,6 +137,7 @@ class _CustomVideoPlayerState extends State<CustomVideoPlayer> {
|
||||
),
|
||||
)
|
||||
: Container(),
|
||||
),
|
||||
)
|
||||
: Container(
|
||||
alignment: Alignment.center,
|
||||
@ -152,11 +160,9 @@ class _CustomVideoPlayerState extends State<CustomVideoPlayer> {
|
||||
}
|
||||
this.player?.exitFullScreen();
|
||||
},
|
||||
child: Stack(
|
||||
children: [
|
||||
child: Stack(children: [
|
||||
defaultFijkPanelBuilder(
|
||||
player, data, context, viewSize, texturePos),
|
||||
|
||||
]),
|
||||
));
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user