flutter_youtube_view 1.1.5

flutter_youtube_view #

This plugin provides Inlining YouTube player. To interact with YouTube the library uses the Frame Player API, inside of a WebView (Android), WKWebview (iOS). Therefore the YouTube app is not required on the user's device and there are no issues with YouTube Terms of Service.

This plugin using:

APK sample: https://github.com/hoanglm4/flutter_youtube_view/tree/master/example/android/APK

How to Use #

1. Depend

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

dependencies:
  flutter_youtube_view: ^1.1.4

2. Install

Run command:

$ flutter packages get

3. Import

Import in Dart code:

import 'package:flutter_youtube_view/flutter_youtube_view.dart';

Currently apps need to opt-in for the UIViews embedding preview on iOS by adding a boolean property to the Info.plist (key=io.flutter.embedded_views_preview value=YES).

4. Using Youtube View

 Container(
          child: FlutterYoutubeView(
                onViewCreated: _onYoutubeCreated,
                listener: this,
                scaleMode: YoutubeScaleMode.none, // <option> fitWidth, fitHeight
                params: YoutubeParam(
                      videoId: 'gcj2RUWQZ60', 
                      showUI: false, 
                      startSeconds: 0.0, // <option>
                      autoPlay: false) // <option>
                )
            ),

Features #

Call IFrame API during playback #

  • play()
  • pause()
  • loadOrCueVideo()
  • seekTo()
  • setVolume() only Android
  • mute()
  • unMute()

PLAYER callback #

  void onReady();

  void onStateChange(String state); // UNKNOWN, UNSTARTED, ENDED, PLAYING, PAUSED, BUFFERING, VIDEO_CUED

  void onError(String error); // INVALID_PARAMETER_IN_REQUEST, HTML_5_PLAYER, VIDEO_NOT_FOUND, VIDEO_NOT_PLAYABLE_IN_EMBEDDED_PLAYER

  void onVideoDuration(double duration);

  void onCurrentSecond(double second);

0.0.1 #

Init project

1.1.0 #

Fixed issue #https://github.com/hoanglm4/flutter_youtube_view/issues/2

1.1.1 #

https://github.com/hoanglm4/flutter_youtube_view/issues/5

1.1.4 #

https://github.com/hoanglm4/flutter_youtube_view/issues/1 https://github.com/hoanglm4/flutter_youtube_view/issues/8 Fixed: Android: Video play in background

1.1.5 #

https://github.com/hoanglm4/flutter_youtube_view/issues/13

example/README.md

flutter_youtube_view_example #

Demonstrates how to use the flutter_youtube_view plugin.

Getting Started #

This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

Use this package as a library

1. Depend on it

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


dependencies:
  flutter_youtube_view: ^1.1.5

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

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

3. Import it

Now in your Dart code, you can use:


import 'package:flutter_youtube_view/flutter_youtube_view.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
84
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
80
Overall:
Weighted score of the above. [more]
88
Learn more about scoring.

We analyzed this package on Sep 20, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.5.0
  • pana: 0.12.21
  • Flutter: 1.9.1+hotfix.2

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health issues and suggestions

Document public APIs. (-0.25 points)

38 out of 39 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Format lib/flutter_youtube_view.dart.

Run flutter format to format lib/flutter_youtube_view.dart.

Format lib/src/flutter_youtube_view_controller.dart.

Run flutter format to format lib/src/flutter_youtube_view_controller.dart.

Format lib/src/youtube_param.dart.

Run flutter format to format lib/src/youtube_param.dart.

Maintenance suggestions

The package description is too short. (-20 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.7
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8