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.
60 lines
1.5 KiB
60 lines
1.5 KiB
import 'package:flutter/material.dart';
|
|
import 'package:video_player/video_player.dart';
|
|
import 'package:flick_video_player/flick_video_player.dart';
|
|
|
|
class ProblemAudio extends StatefulWidget {
|
|
var videoUrl;
|
|
ProblemAudio({this.videoUrl});
|
|
|
|
@override
|
|
State<ProblemAudio> createState() => _ProblemAudioState();
|
|
}
|
|
|
|
class _ProblemAudioState extends State<ProblemAudio> {
|
|
|
|
late VideoPlayerController _controller;
|
|
late Future<void> _initializeVideoPlayerFuture;
|
|
late FlickManager flickManager;
|
|
|
|
@override
|
|
void initState() {
|
|
super.initState();
|
|
_controller = VideoPlayerController.networkUrl(
|
|
Uri.parse(widget.videoUrl,),
|
|
);
|
|
flickManager = FlickManager(
|
|
videoPlayerController:
|
|
VideoPlayerController.networkUrl(Uri.parse(widget.videoUrl,),)
|
|
);
|
|
_initializeVideoPlayerFuture = _controller.initialize();
|
|
_controller.setLooping(false);
|
|
}
|
|
@override
|
|
void dispose() {
|
|
// Ensure disposing of the VideoPlayerController to free up resources.
|
|
_controller.dispose();
|
|
flickManager.dispose();
|
|
super.dispose();
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Container(
|
|
height: MediaQuery.of(context).size.height * .30,
|
|
width: double.infinity,
|
|
child:FlickVideoPlayer(
|
|
flickManager: flickManager,
|
|
flickVideoWithControls: FlickVideoWithControls(
|
|
videoFit: BoxFit.fill,
|
|
controls: FlickPortraitControls(
|
|
progressBarSettings:
|
|
FlickProgressBarSettings(playedColor: Colors.green),
|
|
),
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
}
|
|
}
|