fix: 修正 查無跌倒影片顯示黑屏

This commit is contained in:
JingChiang 2024-10-25 17:18:05 +08:00
parent 66690c3795
commit 123f0c4958

View File

@ -186,7 +186,7 @@ class _FallDetailPageState extends State<FallDetailPage> {
void initState() {
super.initState();
BetterPlayerConfiguration betterPlayerConfiguration =
BetterPlayerConfiguration(
const BetterPlayerConfiguration(
aspectRatio: 16 / 9,
fit: BoxFit.contain,
);
@ -225,6 +225,7 @@ class _FallDetailPageState extends State<FallDetailPage> {
videoFormat: BetterPlayerVideoFormat.hls,
);
_betterPlayerController.setupDataSource(dataSource);
setState(() {}); //
}
} catch (e) {
@ -253,8 +254,7 @@ class _FallDetailPageState extends State<FallDetailPage> {
SizedBox(height: 10),
Text('跌倒地點: ${widget.fallDetail['跌倒地點']}', style: TextStyle(fontSize: 18)),
//
if (_betterPlayerController != null)
AspectRatio(
if (fhvideoId != '') AspectRatio(
aspectRatio: 16 / 9,
child: BetterPlayer(controller: _betterPlayerController),
),