Compare commits
3 Commits
66690c3795
...
3131f611da
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3131f611da | ||
|
|
4c8b6db2ba | ||
|
|
123f0c4958 |
@@ -186,13 +186,13 @@ class _FallDetailPageState extends State<FallDetailPage> {
|
||||
void initState() {
|
||||
super.initState();
|
||||
BetterPlayerConfiguration betterPlayerConfiguration =
|
||||
BetterPlayerConfiguration(
|
||||
const BetterPlayerConfiguration(
|
||||
aspectRatio: 16 / 9,
|
||||
fit: BoxFit.contain,
|
||||
);
|
||||
_betterPlayerController = BetterPlayerController(betterPlayerConfiguration);
|
||||
|
||||
_fetchData(); // 連資料庫
|
||||
_fetchData(); // 連資料庫、取得影片連結
|
||||
}
|
||||
|
||||
void dispose() {
|
||||
@@ -211,7 +211,7 @@ class _FallDetailPageState extends State<FallDetailPage> {
|
||||
await conn.connect();
|
||||
|
||||
try {
|
||||
var userNameResult = await conn.execute(// 使用傳遞過來的 email來找homeusername
|
||||
var userNameResult = await conn.execute(// 使用傳遞過來的 hfId來找hfvideoId
|
||||
'SELECT hfvideoId FROM HomeFallVideo WHERE hfallId = :fallId',
|
||||
{'fallId': widget.fallDetail['跌倒編號']},
|
||||
);
|
||||
@@ -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),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
@@ -77,14 +77,14 @@ class _HomePageState extends State<HomePage> {
|
||||
},
|
||||
onNavigationRequest: (NavigationRequest request) {
|
||||
if (request.url.startsWith(
|
||||
'http://203.64.84.154:8088/video_feed')) {
|
||||
'https://streamer.comprehensive-guardian.systems/video_feed')) {
|
||||
return NavigationDecision.prevent;
|
||||
}
|
||||
return NavigationDecision.navigate;
|
||||
},
|
||||
),
|
||||
)
|
||||
..loadRequest(Uri.parse('http://203.64.84.154:8088/0')),
|
||||
..loadRequest(Uri.parse('https://streamer.comprehensive-guardian.systems/0')),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
|
||||
@@ -79,14 +79,14 @@ class _MessagePageState extends State<MessagePage> {
|
||||
print(error.description);
|
||||
},
|
||||
onNavigationRequest: (NavigationRequest request) {
|
||||
if (request.url.startsWith('http://203.64.84.154:8088/video_feed')) {
|
||||
if (request.url.startsWith('https://streamer.comprehensive-guardian.systems/video_feed')) {
|
||||
return NavigationDecision.prevent;
|
||||
}
|
||||
return NavigationDecision.navigate;
|
||||
},
|
||||
),
|
||||
)
|
||||
..loadRequest(Uri.parse('http://203.64.84.154:8088/0')),
|
||||
..loadRequest(Uri.parse('https://streamer.comprehensive-guardian.systems/0')),
|
||||
),
|
||||
Align(
|
||||
alignment: Alignment.bottomRight,
|
||||
@@ -147,7 +147,7 @@ class _MessagePageState extends State<MessagePage> {
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
_cameraId = camera_id;
|
||||
_webViewController.loadRequest(Uri.parse('http://203.64.84.154:8088/$camera_id'));
|
||||
_webViewController.loadRequest(Uri.parse('https://streamer.comprehensive-guardian.systems/$camera_id'));
|
||||
},
|
||||
child: Center(
|
||||
child: Column(
|
||||
@@ -218,14 +218,14 @@ class _WebViewPageState extends State<WebViewPage> {
|
||||
print(error.description);
|
||||
},
|
||||
onNavigationRequest: (NavigationRequest request) {
|
||||
if (request.url.startsWith('http://203.64.84.154:8088/video_feed')) {
|
||||
if (request.url.startsWith('https://streamer.comprehensive-guardian.systems/video_feed')) {
|
||||
return NavigationDecision.prevent;
|
||||
}
|
||||
return NavigationDecision.navigate;
|
||||
},
|
||||
),
|
||||
)
|
||||
..loadRequest(Uri.parse('http://203.64.84.154:8088/${widget._cameraId}')),
|
||||
..loadRequest(Uri.parse('https://streamer.comprehensive-guardian.systems/${widget._cameraId}')),
|
||||
),
|
||||
Align(
|
||||
alignment: Alignment.bottomRight,
|
||||
|
||||
Reference in New Issue
Block a user