Coder Social home page Coder Social logo

rwrz / flutter_youtube_view Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hoanglm4/flutter_youtube_view

0.0 1.0 1.0 31.3 MB

Youtube widget for Flutter

License: Other

Kotlin 30.90% Ruby 5.77% Swift 29.17% Objective-C 0.67% Dart 25.75% HTML 6.73% Shell 1.01%

flutter_youtube_view's Introduction

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.9

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()
  • setPlaybackRate(rate: PlaybackRate.RATE_1) or setPlaybackRate(rateValue: 1.0)

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);

flutter_youtube_view's People

Contributors

hoanglm4 avatar rwrz avatar tamirrab avatar wongni avatar

Watchers

 avatar

Forkers

ogustavobelo

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.