Flutter Splash Screen Video Player


I am trying to create a background video splash screen for my app.
Currently, I am achieving a blank screen by running this code.

 void main() => runApp(WalkThrough());

class WalkThrough extends StatefulWidget {
  _WalkThroughState createState() => _WalkThroughState();

class _WalkThroughState extends State<WalkThrough> {
  VideoPlayerController _controller;

  void initState() {
    // Pointing the video controller to our local asset.
    _controller = VideoPlayerController.asset('assets/video.mp4')
      ..initialize().then((_) {
        // Once the video has been loaded we play the video and set looping to true.
        // Ensure the first frame is shown after the video is initialized.
        setState(() {});

  Widget build(BuildContext context) {
    return Scaffold(
      body: Stack(
        children: <Widget>[

I suspect the problem may be here and have based my research off this Full screen video background in Flutter on Login as I am trying to achieve a similar result.

            child: FittedBox(
              // If your background video doesn't look right, try changing the BoxFit property.
              // BoxFit.fill created the look I was going for.
              fit: BoxFit.fill,
              child: SizedBox(
                width: _controller.value.size?.width ?? 0,
                height: _controller.value.size?.height ?? 0,
                child: VideoPlayer(_controller),


I think the video player package has an issue to show video in the Ios simulator. I had the same issue and search for it and find out this issue in Github. until now this issue is open. I tested the video player on a real device and there were no problems.

Answered By – Payam Zahedi

Answer Checked By – Clifford M. (FlutterFixes Volunteer)

Leave a Reply

Your email address will not be published. Required fields are marked *