Flutter video player shows only the first frame of the video that I want to loop


I want to create a VideoPlayer class for my flutter application, where I can put a looping video. When I debug the app or I m running it in "release mode", the VideoPlayer shows only the first frame of the video.

This is the code from my videoplayer.dart file

import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:video_player/video_player.dart';

class clipVideo extends StatefulWidget {
  clipVideo() : super();
  final String title = "titlu video";

  _clipVideo createState() => _clipVideo();

class _clipVideo extends State<clipVideo> {
  VideoPlayerController _controller;
  Future<void> _initializeVideoPlayerFuture;

  void initState() {
    _controller = VideoPlayerController.asset('assets/videos/intro.mp4');
    _initializeVideoPlayerFuture = _controller.initialize();

  void dispose() {

  Widget build(BuildContext context) {
    return Container(
      child: FutureBuilder(
        future: _initializeVideoPlayerFuture,
        builder: (context, snapshot) {
          if (snapshot.connectionState == ConnectionState.done) {
            return Center(
              child: AspectRatio(
                aspectRatio: _controller.value.aspectRatio,
                child: VideoPlayer(_controller),
          } else {
            return Center(
              child: CircularProgressIndicator(),

here is my dependency from the public.yasml file

video_player: ^0.10.11

The flutter run has no errors whatsoever. Is it because the video has the size of 20MB?


Include in initState()


Answered By – Cesar Bassani

Answer Checked By – Clifford M. (FlutterFixes Volunteer)

Leave a Reply

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