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