title: How to achieve boomerang effect of VideoPlayer in Flutter?
body: <p>I am using <a href="https://pub.dev/packages/video_player#-readme-tab-" rel="nofollow noreferrer">VideoPlayer</a> package to display .mp4 in my app. I am able to loop it very easly just by adding <code>_controller.setLooping(true);</code>. However I am not able to create a boomerang effect with this package. Do you have any ideas how to implement it?</p>
  <p>Here you can get sample code of mine:</p>
  <pre><code>class DashboardVideoBackground extends StatefulWidget {
    DashboardVideoBackground({Key key}) : super(key: key);
  
    @override
    State&lt;StatefulWidget&gt; createState() =&gt; _DashboardVideoBackgroundState();
  }
  
  class _DashboardVideoBackgroundState extends State&lt;DashboardVideoBackground&gt; {
    VideoPlayerController _controller;
    Future&lt;void&gt; _initializeVideoPlayerFuture;
  
    @override
    void initState() {
      _controller =
          VideoPlayerController.asset('assets/mock/dashboard_background.mp4');
      _initializeVideoPlayerFuture = _controller.initialize();
      _controller.setLooping(true);
  
      _controller.play();
      super.initState();
    }
  
    @override
    void dispose() {
      _controller.dispose();
      super.dispose();
    }
  
    @override
    Widget build(BuildContext context) {
      return LayoutBuilder(
        builder: (context, constraints) {
          return FutureBuilder(
            future: _initializeVideoPlayerFuture,
            builder: (context, snapshot) =&gt;
                snapshot.connectionState == ConnectionState.done
                    ? OverflowBox(
                        maxWidth: double.infinity,
                        maxHeight: double.infinity,
                        alignment: Alignment.center,
                        child: FittedBox(
                          fit: BoxFit.cover,
                          alignment: Alignment.center,
                          child: Container(
                            width: MediaQuery.of(context).size.width * 1.5,
                            height: MediaQuery.of(context).size.height,
                            child: VideoPlayer(_controller),
                          ),
                        ),
                      )
                    : Center(child: CircularProgressIndicator()),
          );
        },
      );
    }
  }
  </code></pre>