You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
48 lines
1.1 KiB
48 lines
1.1 KiB
import 'package:better_player/better_player.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:teso/Classes/Firebase/Posts.dart';
|
|
|
|
const ASPECT_RATIO = 16 / 9;
|
|
|
|
class VideoPlayerWidget extends StatefulWidget {
|
|
final BetterPlayerController controller;
|
|
final FBPosts ad;
|
|
|
|
const VideoPlayerWidget({
|
|
Key key,
|
|
@required this.controller,
|
|
@required this.ad,
|
|
}) : assert(controller != null),
|
|
assert(ad != null),
|
|
super(key: key);
|
|
|
|
@override
|
|
_VideoPlayerWidgetState createState() => _VideoPlayerWidgetState();
|
|
}
|
|
|
|
class _VideoPlayerWidgetState extends State<VideoPlayerWidget> {
|
|
@override
|
|
void initState() {
|
|
super.initState();
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return FittedBox(
|
|
clipBehavior: Clip.hardEdge,
|
|
child: SizedBox(
|
|
width: MediaQuery.of(context).size.width,
|
|
height: MediaQuery.of(context).size.height,
|
|
child: BetterPlayer(
|
|
controller: widget.controller,
|
|
),
|
|
),
|
|
);
|
|
}
|
|
|
|
@override
|
|
void dispose() {
|
|
widget.controller.dispose();
|
|
super.dispose();
|
|
}
|
|
}
|
|
|