youtube_player_interop 0.1.2

youtube_player_interop #

A Youtube iFrame API wrapper for Dart web apps

For Angular Dart apps see the Youtube iFrame Component

Example #


The simplest example


<!DOCTYPE html>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>youtube iframe interop</title>
    <link rel="stylesheet" href="styles.css">
    <link rel="icon" href="favicon.ico">
    <script defer src="main.dart" type="application/dart"></script>
    <script defer src="packages/browser/dart.js"></script>
    <div id="video"></div>

Dart #

import 'package:youtube_player_interop/youtube_player_interop.dart' as yt;

void main(){

void onYouTubeIframeAPIReady() {
  final options = new yt.PlayerOptions(
    height: '360',
    width: '480',
    videoId: 'JXcNqXbCa0E',
  final player = new yt.Player('video', options);


Events #

  • onReady
  • onStateChange
  • onPlaybackQualityChange
  • onPlaybackRateChange
  • onError

Changelog #

0.1.1 #

  • PlayerState enum : PlayerState.stopped, PlayerState.playing...

0.1.0 #

  • Initial version

Use this package as a library

1. Depend on it

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

  youtube_player_interop: ^0.1.2

2. Install it

You can install packages from the command line:

with pub:

$ pub get

Alternatively, your editor might support pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:youtube_player_interop/youtube_player_interop.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

The package version is not analyzed, because it does not support Dart 2. Until this is resolved, the package will receive a health and maintenance score of 0.

Analysis issues and suggestions

Support Dart 2 in pubspec.yaml.

The SDK constraint in pubspec.yaml doesn't allow the Dart 2.0.0 release. For information about upgrading it to be Dart 2 compatible, please see

Maintenance issues and suggestions

Make sure dartdoc successfully runs on your package's source files. (-10 points)

Dependencies were not resolved.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.20.1 <2.0.0