You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
class VideoView extends StatefulWidget {
final String url;
final bool autoPlay;
final bool looping;
final double aspectRatio;
const VideoView({super.key, required this.url, this.autoPlay=false, this.looping=false, this.aspectRatio=16/9,});
@OverRide
State createState() => _VideoViewState();
}
class _VideoViewState extends State {
late VideoPlayerController _videoPlayerController;
late ChewieController _chewieController; @OverRide
initState() {
_videoPlayerController = VideoPlayerController.asset('assets/1.mp4');
initVideo();
_chewieController = ChewieController(
videoPlayerController: _videoPlayerController,
autoPlay: widget.autoPlay,
looping: widget.looping,
aspectRatio: widget.aspectRatio
);
super.initState();
}
Future initVideo() async {
await _videoPlayerController.initialize();
}