fix: 修正 查無跌倒影片顯示黑屏
This commit is contained in:
parent
66690c3795
commit
123f0c4958
|
|
@ -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,11 +254,10 @@ class _FallDetailPageState extends State<FallDetailPage> {
|
|||
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),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user