Library / SDK
sarbagyastha/youtube_player_flutter avatar
sarbagyastha/youtube_player_flutter

youtube_player_flutter offers two ways to play YouTube inside a Flutter app

A Flutter plugin for inline playback or streaming of YouTube videos using the official iFrame Player API.

810 stars1,002 forksDartBSD-3-Clause

At a glance

What is it?
This Flutter monorepo publishes a batteries-included YouTube player and a low-level port of the YouTube iFrame API that you drive with your own UI, plus the web implementation the second one depends on. Both run on Android, iOS, macOS and the web, and both are subject to the YouTube API Services Terms of Service.
Who is it for?
Flutter teams that need YouTube playback inside an app should start with youtube_player_flutter if a standard player UI is acceptable and with youtube_player_iframe if the design is custom, because both wrap the same official iFrame API and ship for the same four platforms.
Can I use it commercially?
Yes. BSD-3-Clause is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 146 days ago.
What is it written in?
Mainly Dart, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on October 23, 2026, and from our analysis. They are not legal advice.

Editorial analysis

One monorepo, three packages, one underlying API

youtube_player_flutter is a Flutter monorepo, and the README is organised around the choice it asks you to make: which of two packages to depend on.

All three packages are powered by the official YouTube iFrame Player API, which is the constraint that shapes everything else about this project. There is no native YouTube SDK integration, no direct streaming of YouTube video files, and no offline mode. What the packages do is give Dart code a way to drive the official web player, which means the player is a web view with a JavaScript API behind it.

The packages table lists them. youtube_player_flutter is the batteries-included option with built-in controls, gestures and a live stream UI, shipping for Android, iOS, macOS and Web. youtube_player_iframe is the full-control port of the iFrame API, on the same four platforms, where you build your own UI. youtube_player_iframe_web is the web platform implementation for youtube_player_iframe, added automatically, and it exists for the cases where a platform plugin needs it or when you are working inside the monorepo itself.

That third package is the giveaway that this is a federated plugin setup rather than a single package. The web implementation is registered automatically for the web platform, so most developers never name it, and the README says so directly: you probably do not need to add this.

The repository layout matches: a packages directory holding the three packages, a top level pubspec.yaml, an analysis_options.yaml, an all-contributors configuration, and a LICENSE and NOTICE file at the root.

The batteries-included package: controls, gestures, live streams

The README describes youtube_player_flutter as the quickest path to YouTube playback in your app. You add the dependency and point the widget at a video ID.

bash
flutter pub add youtube_player_flutter

What comes with it is spelled out in the README: ready-made controls, a progress bar, drag-to-seek, pinch-to-fullscreen, and a live stream UI, all out of the box. The stated use case is an app that wants a polished, functional player with minimal setup, and the workflow it describes is deliberately dull: drop it in, point it at a video ID, and you are done.

That last point is the real value of this package. Embedding a YouTube player means dealing with a JavaScript API that lives in a web view, with state changes that arrive asynchronously and a UI that has to be rebuilt in Dart. The batteries-included package exists so that a developer who needs a video on a screen does not have to model any of that.

The live stream UI is worth singling out. YouTube live streams behave differently from ordinary videos in the player, and the fact that this package handles them in its default surface says the author expected live content to be a normal case rather than an edge case.

The package also has a hosted web demo linked from the README, which is the fastest way to see what the default player looks like before adding the dependency.

The iframe package gives you the API and leaves the pixels to you

youtube_player_iframe is the lower-level option, and the README positions it clearly: a full-control Flutter port of the YouTube iFrame API, where you own the UI and the package handles the plumbing.

bash
flutter pub add youtube_player_iframe

The package handles playback state, playlists, metadata, fullscreen transitions and thumbnails, and includes a lazy-loading thumbnail widget described as suited to video lists. The stated use cases are a custom player design, complex playback logic and playlist management.

The distinction from the first package is therefore about responsibility rather than about capability. Both packages talk to the same iFrame API; one draws the controls and the other leaves that to you while still handling the state synchronisation, the playlist bookkeeping and the fullscreen transition that are fiddly to get right by hand.

That last point is worth spelling out because fullscreen is exactly the kind of thing that looks simple and is not. A fullscreen transition in a web view has to coordinate the Dart widget tree, the platform view and the JavaScript player, and doing it yourself means writing that coordination for every platform you support. The iframe package does it once, for all four.

The lazy-loading thumbnail widget is the piece most likely to matter for a content list, where a screen of video cards that all load their thumbnails eagerly is a performance problem, and where the platform thumbnail URL scheme is a detail you should not have to reimplement.

Two licences and one set of API terms

The licensing has three layers, and the third one is the one that decides whether you can ship.

The code is BSD-3-Clause. The README states that and points at the LICENSE file for details. BSD-3-Clause is a permissive licence with no copyleft obligation and no source disclosure requirement, so you can vendor the packages into a commercial app without difficulty.

The second layer is documentation attribution. The API method documentation in the packages is adapted from the YouTube IFrame Player API Reference, which is credited to Google LLC and licensed under CC BY 4.0, and the repository carries a NOTICE file describing this.

The third layer is the important one. The README states that by using these packages you agree to the YouTube API Services Terms of Service. That is not a formality: YouTube playback through this API is a licensed use of a Google service, and the terms attached to it govern what your application may do with embedded player content, separately from the licence of the Dart code that drives it.

For a commercial product this is the check to do early. A permissive code licence tells you the source can be reused, and it says nothing about whether the service you are embedding permits your use. The two questions have different answers and different consequences.

The attribution obligation for the documentation is small but real, and the NOTICE file at the root is there to make it easy to comply with rather than to be discovered during an audit.

Where this plugin set is the wrong tool

The limits follow from the choice to sit on top of the iFrame API.

There is no offline playback and no background audio. The player is a web view running the official YouTube player, so the video has to be fetched from YouTube at play time. Any product requirement that involves a video playing without a network, or continuing after the app is backgrounded, is outside what this design can deliver.

The platform list is closed. Android, iOS, macOS and Web are supported, and Linux is not on it, so a Flutter desktop build targeting Linux has no player here.

The YouTube API terms are a constraint on behaviour, not only on paperwork. Embedding a YouTube player in a third-party app is a use that Google regulates, and the terms linked from the README are what your application has to comply with.

The versioning picture is also worth checking before you depend on it. The release list in the repository is per package, and the tagged versions visible are youtube_player_iframe v3.0.3 from 2022-08-14 alongside older youtube_player_iframe tags, while the repository has since been reorganised into the monorepo with youtube_player_flutter and youtube_player_iframe_web added. The default branch is develop, not main, so a fork or a path dependency is worth understanding before you build on it.

None of this makes the packages unusable. It makes them a good fit for an app that wants to show YouTube content with a standard or custom player, and a poor fit for an app that wants to own the video pipeline.

Maintenance state and how the monorepo is versioned

The repository is not archived and the last push was on 2026-05-30, so the work is still landing, though there is no recent release tag in the list to match it.

That mismatch between a recent push and an old tag is the practical thing to plan around. The visible releases are for the iframe package specifically: v3.0.3 on 2022-08-14, v1.0.1 on 2020-07-17 and v1.0.0+4 on 2020-07-12. The two newer packages, youtube_player_flutter and youtube_player_iframe_web, carry their version numbers on pub.dev rather than appearing in that list.

So there are two version tracks in play, one in the repository tags and one on the package registry, and a consumer should read the version from pub.dev for whichever package they add.

The development workflow is standard Flutter, with a root pubspec.yaml, an analysis_options.yaml for the linter configuration, a .github directory and an .all-contributorsrc file for credit, and the conventional package layout under packages. A contributor working inside the monorepo would edit the package they care about and keep the root workspace consistent, which is why the iframe package can be developed alongside the batteries-included one and the web implementation.

The default branch being develop rather than main is a small but real detail for anyone who clones the repository directly, and it is consistent with a project where the published packages move faster than the repository tags.

Editorial conclusion

Flutter teams that need YouTube playback inside an app should start with youtube_player_flutter if a standard player UI is acceptable and with youtube_player_iframe if the design is custom, because both wrap the same official iFrame API and ship for the same four platforms. It is the wrong choice for offline playback, for background audio, and for any target the package list does not include, and it is the wrong choice if your product cannot live with the YouTube API Services Terms of Service that using these packages implies. Before adopting, read the NOTICE file for the documentation attribution, decide which of the two packages matches your UI plans, and check the release tags for the package you intend to depend on, since the tagged versions in this repository are per package rather than for the monorepo as a whole.

Frequently asked questions

Which youtube_player_flutter package should I use?

Use youtube_player_flutter if you want a working player with built-in controls, a progress bar, drag-to-seek, pinch-to-fullscreen and a live stream UI. Use youtube_player_iframe if you want to build your own UI while the package handles playback state, playlists, metadata, fullscreen transitions and thumbnails.

Do I need to add youtube_player_iframe_web myself?

Probably not. The README describes it as the web platform implementation for youtube_player_iframe, added automatically. You only need to add it directly if you are building a platform plugin or working inside the monorepo.

What licence applies to these packages?

The code is BSD-3-Clause, with the LICENSE file at the repository root. The API method documentation is adapted from the YouTube IFrame Player API Reference, licensed under CC BY 4.0, described in the NOTICE file. Using the packages also means agreeing to the YouTube API Services Terms of Service.

Which platforms do the YouTube player packages support?

The packages table lists Android, iOS, macOS and Web for both youtube_player_flutter and youtube_player_iframe, with youtube_player_iframe_web covering the web platform. Linux is not listed.

Official sources

  1. License: BSD-3-Clause
  2. Project website
  3. README
  4. Releases
  5. sarbagyastha/youtube_player_flutter on GitHub
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/sarbagyastha-youtube-player-flutter.svg)](https://hysenlabs.com/projects/sarbagyastha-youtube-player-flutter)

Was this useful?