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

暴露重播方法

上级 5e585d66
......@@ -9,8 +9,8 @@ class OtherTestPage extends StatefulWidget {
}
class _OtherTestPageState extends State<OtherTestPage> {
String url =
'https://mpv.videocc.net/8f38fa3352/c/8f38fa3352a8cc8f70dd384edb9b21dc_1.mp4';
String url = 'https://mpv.videocc.net/8f38fa3352/7/8f38fa335252dea652836243dd7e3f97_1.mp4';
// 'https://mpv.videocc.net/8f38fa3352/c/8f38fa3352a8cc8f70dd384edb9b21dc_1.mp4';
late VideoPlayerController _controller;
......
......@@ -3,7 +3,7 @@ import 'package:gz_video_player/video.dart';
class OverflowTestPage extends StatelessWidget {
const OverflowTestPage({super.key});
// https://mpv.videocc.net/8f38fa3352/7/8f38fa335252dea652836243dd7e3f97_1.mp4
@override
Widget build(BuildContext context) {
return Scaffold(
......@@ -16,7 +16,7 @@ class OverflowTestPage extends StatelessWidget {
color: Colors.blue,
child: GZVideoPlayer(
dataSource:
'https://mpv.videocc.net/8f38fa3352/5/8f38fa3352cdb65e6773173ae8c767b5_1.mp4',
'https://mpv.videocc.net/8f38fa3352/7/8f38fa335252dea652836243dd7e3f97_1.mp4',
sourceType: DataSourceType.network,
),
),
......
......@@ -480,6 +480,15 @@ class GZVideoPlayerState extends State<GZVideoPlayer>
}
}
/// 重播
void replay() {
_isEnded = false;
_updateDataSource(
source: _dataSource,
type: _sourceType,
);
}
/// 点击播放或暂停
void togglePlay() {
_createHideControlBarTimer();
......@@ -788,13 +797,7 @@ class GZVideoPlayerState extends State<GZVideoPlayer>
? Align(
alignment: Alignment.center,
child: GestureDetector(
onTap: () {
_isEnded = false;
_updateDataSource(
source: _dataSource,
type: _sourceType,
);
},
onTap: replay,
child: widget.videoStyle.replayIcon,
),
)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论