Skip to content
pubscout

video_player

2.14.1, released 7 weeks ago by flutter.dev

Flutter plugin for displaying inline video on Android, iOS, macOS, and web.

Flutter FavoriteRock solid
$ flutter pub add video_player
Source repository

What it does

Allows developers to embed and control video playback inside Flutter widgets across multiple platforms. It provides controllers to manage playback state, speed, positioning, and tracks.

AI-written summary of version 2.14.1, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to play local or network videos inline with other Flutter widgets.
  • You require cross-platform video playback supporting Android, iOS, macOS, and web.

Skip it when

  • You are building a complex audio/video streaming app that requires advanced background playback or comprehensive custom media controls out of the box (consider chewie or media_kit instead).
  • You need to play video using `VideoPlayerController.file` on the web platform.

Strengths

  • Official Flutter team package with broad platform support.
  • Supports adaptive streams, audio/video track selection, and playback speed configuration.

Weaknesses

  • Web platform capabilities depend heavily on individual browser implementations.
  • Requires manual implementation of UI controls (play/pause, progress bars).

Setup

Kind
Plugin (native code)
Effort
Low
Code generation
No
Direct dependencies
6

Requires adding network permissions in AndroidManifest.xml and optionally configuring NSAppTransportSecurity in iOS Info.plist or network client entitlements for macOS.

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

void main() => runApp(const VideoApp());

class VideoApp extends StatefulWidget {
  const VideoApp({super.key});

  @override
  _VideoAppState createState() => _VideoAppState();
}

class _VideoAppState extends State<VideoApp> {
  late VideoPlayerController _controller;

  @override
  void initState() {
    super.initState();
    _controller = VideoPlayerController.networkUrl(
        Uri.parse('https://flutter.github.io/assets-for-api-docs/assets/videos/bee.mp4'),
      )
      ..initialize().then((_) {
        setState(() {});
      });
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: Center(
          child: _controller.value.isInitialized
              ? AspectRatio(
                  aspectRatio: _controller.value.aspectRatio,
                  child: VideoPlayer(_controller),
                )
              : Container(),
        ),
      ),
    );
  }

  @override
  void dispose() {
    _controller.dispose();
    super.dispose();
  }
}

Alternatives

Packages that do the same job and could replace video_player.

  • media_kit

    A heavy-duty general-purpose audio and video player for Flutter based on libmpv.

Works with

Packages commonly used together with video_player: ones it builds on, ones built on it, and its own family.