From 123f0c4958091fe8db2a39a16968f6140d1202dc Mon Sep 17 00:00:00 2001 From: JingChiang Date: Fri, 25 Oct 2024 17:18:05 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=AD=A3=20=E6=9F=A5=E7=84=A1?= =?UTF-8?q?=E8=B7=8C=E5=80=92=E5=BD=B1=E7=89=87=E9=A1=AF=E7=A4=BA=E9=BB=91?= =?UTF-8?q?=E5=B1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/HistoricalRecord.dart | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/HistoricalRecord.dart b/lib/HistoricalRecord.dart index 7aff251..4ed303a 100644 --- a/lib/HistoricalRecord.dart +++ b/lib/HistoricalRecord.dart @@ -186,7 +186,7 @@ class _FallDetailPageState extends State { void initState() { super.initState(); BetterPlayerConfiguration betterPlayerConfiguration = - BetterPlayerConfiguration( + const BetterPlayerConfiguration( aspectRatio: 16 / 9, fit: BoxFit.contain, ); @@ -225,6 +225,7 @@ class _FallDetailPageState extends State { videoFormat: BetterPlayerVideoFormat.hls, ); _betterPlayerController.setupDataSource(dataSource); + setState(() {}); // 重新繪製畫面 } } catch (e) { @@ -253,11 +254,10 @@ class _FallDetailPageState extends State { SizedBox(height: 10), Text('跌倒地點: ${widget.fallDetail['跌倒地點']}', style: TextStyle(fontSize: 18)), // 在這裡可以添加更多詳細資料 - if (_betterPlayerController != null) - AspectRatio( - aspectRatio: 16 / 9, - child: BetterPlayer(controller: _betterPlayerController), - ), + if (fhvideoId != '') AspectRatio( + aspectRatio: 16 / 9, + child: BetterPlayer(controller: _betterPlayerController), + ), ], ), ),