From 088a55f60e66c69ebe99863e1d6576747d568083 Mon Sep 17 00:00:00 2001 From: YuanPeiyu Date: Fri, 13 Dec 2024 07:25:54 +0000 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86=E9=B8=BF=E8=92=99=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E4=B8=8A=E8=A7=86=E9=A2=91=E6=92=AD=E6=94=BE=E5=AE=8C?= =?UTF-8?q?=E6=88=90=E5=90=8E=E5=86=8D=E6=AC=A1=E6=92=AD=E6=94=BE=E4=BC=9A?= =?UTF-8?q?=E7=9B=B4=E6=8E=A5=E8=B7=B3=E8=BD=AC=E8=87=B3=E8=A7=86=E9=A2=91?= =?UTF-8?q?=E6=9C=AB=E5=B0=BE=E7=9A=84=E9=97=AE=E9=A2=98=20=E5=9C=A8?= =?UTF-8?q?=E9=B8=BF=E8=92=99=E8=AE=BE=E5=A4=87=E4=B8=8A=E6=92=AD=E6=94=BE?= =?UTF-8?q?=E5=AE=8C=E8=A7=86=E9=A2=91=EF=BC=8C=E6=94=B6=E5=88=B0avplayer?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E5=8F=98=E6=9B=B4=E4=B8=BAcomplete=E5=90=8E?= =?UTF-8?q?=E5=86=8D=E8=B0=83=E7=94=A8seek=E6=96=B9=E6=B3=95=E5=90=8E?= =?UTF-8?q?=EF=BC=8C=E5=86=8D=E6=AC=A1play=E6=97=B6avplayer=E7=9A=84?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E4=BC=9A=E5=85=88=E5=8F=98=E4=B8=BAplaying?= =?UTF-8?q?=E5=90=8E=E5=BE=88=E5=BF=AB=E5=B0=B1=E5=8F=98=E4=B8=BAcomplete?= =?UTF-8?q?=EF=BC=8C=E5=AF=BC=E8=87=B4=E8=A7=86=E9=A2=91=E7=9B=B4=E6=8E=A5?= =?UTF-8?q?=E8=B7=B3=E8=BD=AC=E8=87=B3=E9=BB=98=E8=AE=A4=EF=BC=8C=E4=B8=94?= =?UTF-8?q?=E5=BC=80=E5=A7=8B=E4=B9=9F=E4=B8=8D=E6=98=AF=E8=A7=86=E9=A2=91?= =?UTF-8?q?=E5=BC=80=E5=A7=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: YuanPeiyu --- packages/video_player/video_player/lib/video_player.dart | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/video_player/video_player/lib/video_player.dart b/packages/video_player/video_player/lib/video_player.dart index 3fbead5a7..e659dbb53 100644 --- a/packages/video_player/video_player/lib/video_player.dart +++ b/packages/video_player/video_player/lib/video_player.dart @@ -468,7 +468,11 @@ class VideoPlayerController extends ValueNotifier { // position=value.duration. Instead of setting the values directly, // we use pause() and seekTo() to ensure the platform stops playing // and seeks to the last frame of the video. - pause().then((void pauseResult) => seekTo(value.duration)); + if (Platform.operatingSystem == "ohos") { + pause().then((void pauseResult) => value = value.copyWith(position: value.duration)); + } else { + pause().then((void pauseResult) => seekTo(value.duration)); + } break; case VideoEventType.bufferingUpdate: value = value.copyWith(buffered: event.buffered); -- Gitee