flick_video_player_custom 0.5.6 flick_video_player_custom: ^0.5.6 copied to clipboard
Flick Video Player is a video player for flutter. The video_player plugin gives low level access for the video playback.
import 'package:flutter/material.dart';
import 'package:flick_video_player_custom/flick_video_player_custom.dart';
import 'package:video_player/video_player.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: const MyHomePage(title: 'Flick video player custom'),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({super.key, required this.title});
final String title;
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
late FlickManager flickManager1;
late FlickManager flickManager2;
@override
void initState() {
super.initState();
flickManager1 = FlickManager(
videoPlayerController: VideoPlayerController.network("https://storage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4"),
additionalOptions: [OptionModel(icon: Icons.hd, onPressFeature: () {}, name: 'Quality')]);
flickManager2 = FlickManager(
videoPlayerController: VideoPlayerController.network("http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ForBiggerMeltdowns.mp4"),
);
}
@override
void dispose() {
flickManager1.dispose();
flickManager2.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: Center(
child: SingleChildScrollView(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
FlickVideoPlayer(flickManager: flickManager1),
FlickVideoPlayer(
flickManager: flickManager2,
flickVideoWithControls: const FlickVideoWithControls(
videoFit: BoxFit.fitWidth,
controls: FlickPortraitControls(),
),
flickVideoWithControlsFullscreen: const FlickVideoWithControls(
controls: FlickLandscapeControls(),
),
),
],
),
),
),
);
}
}