youtube_player_interop 0.1.2

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 0

youtube_player_interop

A Youtube iFrame API wrapper for Dart web apps

For Angular Dart apps see the Youtube iFrame Component

Example

Example

The simplest example

HTML

<!DOCTYPE html>
<html>
<head>
    <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>
</head>
<body>
    <div id="video"></div>
</body>
</html>

Dart

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

void main(){
  yt.initYoutubeFrame(onYouTubeIframeAPIReady);
}

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

API

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:


dependencies:
  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';
  
Version Uploaded Documentation Archive
0.1.2 Oct 12, 2017 Go to the documentation of youtube_player_interop 0.1.2 Download youtube_player_interop 0.1.2 archive
0.1.1 Oct 11, 2017 Go to the documentation of youtube_player_interop 0.1.1 Download youtube_player_interop 0.1.1 archive
0.1.0+1 Oct 10, 2017 Go to the documentation of youtube_player_interop 0.1.0+1 Download youtube_player_interop 0.1.0+1 archive
0.1.0 Oct 10, 2017 Go to the documentation of youtube_player_interop 0.1.0 Download youtube_player_interop 0.1.0 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
0
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
0
Overall:
Weighted score of the above. [more]
0
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.

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 https://www.dartlang.org/dart-2#migration.

Dependencies

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