youtube_player_interop 0.1.2

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 53

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

Analysis

We analyzed this package on Jun 12, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0-dev.60.0
  • pana: 0.11.3

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
6 / 100
Health:
Code health derived from static analysis. [more]
99 / 100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100 / 100
Overall score:
Weighted score of the above. [more]
53
Learn more about scoring.

Platforms

Detected platforms: web

Primary library: package:youtube_player_interop/youtube_player_interop.dart with components: html, js.

Suggestions

  • The description is too short.

    Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

  • Package is pre-v1 release.

    While there is nothing inherently wrong with versions of 0.*.*, it usually means that the author is still experimenting with the general direction API.

  • Maintain an example.

    None of the files in your example/ directory matches a known example patterns. Common file name patterns include: main.dart, example.dart or you could also use youtube_player_interop.dart.

  • Fix analysis and formatting issues.

    Analysis or formatting checks reported 1 hint.

    Run dartfmt to format lib/youtube_player_interop.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.20.1 <2.0.0
js ^0.6.1 0.6.1
meta ^1.1.2 1.1.5
Dev dependencies
test ^0.12.0