OpenMediacenterMobileFlutter/lib/videoscreen_web.dart

53 lines
1.1 KiB
Dart
Raw Normal View History

2022-04-15 16:15:44 +00:00
import 'dart:convert';
import 'package:flutter/material.dart';
import 'api/api.dart';
import 'api/token.dart';
class VideoScreen extends StatefulWidget {
const VideoScreen({Key? key, required this.videoID}) : super(key: key);
final int videoID;
@override
State<VideoScreen> createState() => _VideoScreenState();
}
class _VideoScreenState extends State<VideoScreen> {
void loadData() async {
final data = await API.query("video", "loadVideo", {'MovieId': widget.videoID});
final d = jsonDecode(data);
final url = d["MovieUrl"];
final token = await Token.getInstance().getToken();
if (token == null) return;
final baseurl = token.domain;
// todo not static middle path
final path = baseurl + "/videos/vids/" + url;
}
@override
void initState() {
super.initState();
loadData();
// todo hide appbar after some seonds
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Second Route'),
),
2022-04-15 18:19:09 +00:00
body: const Center(
child: Text("Todo to implement")
2022-04-15 16:15:44 +00:00
),
);
}
}