Youtube Player Plugin

A flutter plugin to play Youtube Videos "inline" without API Key in ranges of Quality(240p, 360p, 480p, 720p and 1080p).

Youtube-Player-Plugin

Salient Features

  • Inline playback
  • Supports HD and Full HD quality
  • No need for API Key and no Limitations
  • Thumbnail Support
  • Playable through <video id> or <link>
  • Picture in Picture for Android SDK > 24
  • Customizable Controls

Usage

1. Depend

Add this to you package's pubspec.yaml file:

dependencies:
  youtube_player: ^0.6.0

2. Install

Run command:

$ flutter packages get

3. Import

Import in Dart code:

import 'package:youtube_player/youtube_player.dart';

4. Using Youtube Player

///
/// LOW = 240p
/// MEDIUM = 360p
/// HIGH = 480p
/// HD = 720p
/// FHD = 1080p
/// "source" can be either youtube video ID or link.
/// "showThumbnail" Default is true.
/// "acpectRatio" Default is 16/9
///
YoutubePlayer(
          source: "nPt8bK2gbaU",
          quality: YoutubeQuality.HD,
          aspectRatio: 16/9,
          showThumbnail: true,
),

Example

Example sources

Limitation

  • Only Available for Android (Currently)

Future

  • Support for ios
  • Adaptive playback as per the internet bandwidth
  • High level of customization

GitHub

https://github.com/sarbagyastha/youtube_player