提交 e311c644 authored 作者: jungleiOS's avatar jungleiOS

清晰度侧边栏溢出裁剪

上级 82eec7f9
...@@ -12,6 +12,7 @@ import 'package:gz_video_player/video_style.dart'; ...@@ -12,6 +12,7 @@ import 'package:gz_video_player/video_style.dart';
import 'package:gz_video_player/video_subtitles.dart'; import 'package:gz_video_player/video_subtitles.dart';
import 'package:gz_video_player/video_top_bar_style.dart'; import 'package:gz_video_player/video_top_bar_style.dart';
import 'package:gz_video_player_example/other_test_page.dart'; import 'package:gz_video_player_example/other_test_page.dart';
import 'package:gz_video_player_example/overflow_test_page.dart';
void main() { void main() {
runApp(const MyApp()); runApp(const MyApp());
...@@ -578,7 +579,7 @@ class _VideoPlayerPageState extends State<VideoPlayerPage> { ...@@ -578,7 +579,7 @@ class _VideoPlayerPageState extends State<VideoPlayerPage> {
// "play_url": "https://mpv.videocc.net/8f38fa3352/c/8f38fa3352029c8ac2af1c90e3bb7cdc_2.mp4", // "play_url": "https://mpv.videocc.net/8f38fa3352/c/8f38fa3352029c8ac2af1c90e3bb7cdc_2.mp4",
VideoDefinitionItem( VideoDefinitionItem(
dataSource: dataSource:
'https://mpv.videocc.net/8f38fa3352/c/8f38fa3352029c8ac2af1c90e3bb7cdc_1.mp4', 'https://mpv.videocc.net/8f38fa3352/c/8f38fa3352029c8ac2af1c90e3bb7cdc_1.mp4',
title: 'LD', title: 'LD',
), ),
VideoDefinitionItem( VideoDefinitionItem(
...@@ -594,6 +595,23 @@ class _VideoPlayerPageState extends State<VideoPlayerPage> { ...@@ -594,6 +595,23 @@ class _VideoPlayerPageState extends State<VideoPlayerPage> {
), ),
), ),
), ),
SliverToBoxAdapter(
child: Center(
child: CustomBtn(
title: 'overflow page',
onTap: () {
videoPlayerController?.pause();
Navigator.of(context).push(
MaterialPageRoute(
builder: (BuildContext context) {
return const OverflowTestPage();
},
),
);
},
),
),
),
], ],
), ),
) )
......
import 'package:flutter/material.dart';
import 'package:gz_video_player/video.dart';
class OverflowTestPage extends StatelessWidget {
const OverflowTestPage({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('overflowTestPage'),
),
body: Container(
width: 300,
height: 200,
color: Colors.blue,
child: GZVideoPlayer(
dataSource:
'https://mpv.videocc.net/8f38fa3352/5/8f38fa3352cdb65e6773173ae8c767b5_1.mp4',
sourceType: DataSourceType.network,
),
),
);
}
}
...@@ -457,8 +457,8 @@ class GZVideoPlayerState extends State<GZVideoPlayer> ...@@ -457,8 +457,8 @@ class GZVideoPlayerState extends State<GZVideoPlayer>
_controller.seekTo(position); _controller.seekTo(position);
Future.delayed(const Duration(milliseconds: 1500), () { Future.delayed(const Duration(milliseconds: 1500), () {
_controller.setPlaybackSpeed(_speedItem.speed); _controller.setPlaybackSpeed(_speedItem.speed);
debugPrint( // debugPrint(
'-----> playbackSpeed = ${_controller.value.playbackSpeed}'); // '-----> playbackSpeed = ${_controller.value.playbackSpeed}');
}); });
} else { } else {
_controller.seekTo(position); _controller.seekTo(position);
......
...@@ -100,19 +100,21 @@ class _VideoDefinitionSideBarState extends State<VideoDefinitionSideBar> ...@@ -100,19 +100,21 @@ class _VideoDefinitionSideBarState extends State<VideoDefinitionSideBar>
onTap: () { onTap: () {
_controller.reverse(); _controller.reverse();
}, },
child: Align( child: ClipRRect(
alignment: Alignment.centerRight, child: Align(
child: SlideTransition( alignment: Alignment.centerRight,
position: _offsetAnimation, child: SlideTransition(
child: Container( position: _offsetAnimation,
width: width, child: Container(
color: Colors.black.withOpacity(0.6), width: width,
alignment: Alignment.center, color: Colors.black.withOpacity(0.6),
child: SingleChildScrollView( alignment: Alignment.center,
child: Column( child: SingleChildScrollView(
mainAxisAlignment: MainAxisAlignment.center, child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch, mainAxisAlignment: MainAxisAlignment.center,
children: _renderItems(), crossAxisAlignment: CrossAxisAlignment.stretch,
children: _renderItems(),
),
), ),
), ),
), ),
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论