Git Product home page Git Product logo

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: ^2.0.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()
  • 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 jayjah avatar rwrz avatar tamirrab avatar wongni avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

flutter_youtube_view's Issues

Migration to androidX

Hi,

Please migrate this project to androidx since now most of the flutter project use androidx

How to add captions

Hi,
Thanks for a great plugin. Clean, worked first time, easy to setup.
I'd like to have closed captions enabled for my videos. Is there a way to enable these? I couldn't see a setting.
Thanks,
Tom

Video size

Hello so far seems to work really good even with live video!

One question is there anyway to set like a BoxFit for the video widget like cover, fitwidth stuff like that?

App close when pop screen with flutter_youtube_view

The player works good but when I pop the current screen with the vide I get this error and app close.

D/AudioTrack(16645): stop() called with 198724 frames delivered
D/ (16645): PlayerBase::stop() from IPlayer
V/AudioManager(16645): requestAudioFocus streamType: 3 durationHint: 1
V/AudioManager(16645): registerAudioFocusListener...
V/AudioManager(16645): unregisterAudioFocusListener...
I/AudioManager(16645): abandonAudioFocus
D/AndroidRuntime(16645): Shutting down VM
E/AndroidRuntime(16645): FATAL EXCEPTION: main
E/AndroidRuntime(16645): Process: com.sounter.sounter, PID: 16645
E/AndroidRuntime(16645): java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.DisplayAdjustments android.view.Display.getDisplayAdjustments()' on a null object reference
E/AndroidRuntime(16645): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1746)
E/AndroidRuntime(16645): at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1515)
E/AndroidRuntime(16645): at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7266)
E/AndroidRuntime(16645): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:981)
E/AndroidRuntime(16645): at android.view.Choreographer.doCallbacks(Choreographer.java:790)
E/AndroidRuntime(16645): at android.view.Choreographer.doFrame(Choreographer.java:721)
E/AndroidRuntime(16645): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:967)
E/AndroidRuntime(16645): at android.os.Handler.handleCallback(Handler.java:808)
E/AndroidRuntime(16645): at android.os.Handler.dispatchMessage(Handler.java:101)
E/AndroidRuntime(16645): at android.os.Looper.loop(Looper.java:166)
E/AndroidRuntime(16645): at android.app.ActivityThread.main(ActivityThread.java:7529)
E/AndroidRuntime(16645): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(16645): at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:245)
E/AndroidRuntime(16645): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:921)
I/Process (16645): Sending signal. PID: 16645 SIG: 9
Lost connection to device.

Platform Exception Error

I am trying to setup your library and receive the following error

Here is my code


import 'dart:ui';
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter_youtube_view/flutter_youtube_view.dart';
import 'package:flutter/material.dart';
import 'dart:core';

import data/movies.dart';

class DetailsPage extends StatefulWidget{
  final Movies record;

  //receive data from main.dart
  DetailsPage({Key key, @required this.record}) : super(key: key);

  @override
  State<StatefulWidget> createState() {
    return _DetailsPageState();
  }
}

class _DetailsPageState extends State<DetailsPage> implements YouTubePlayerListener{
  FlutterYoutubeViewController _controller;
  double _currentVideoSecond = 0.0;
  String _playerState = "";

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: ListView(
        children: <Widget>[
          Stack(
            children: <Widget>[
              Container(
                height: 360.0,
                width: double.infinity,
                child: _backgroundImage(widget.record),
              ),
              Container(
                  height: 360.0,
                  width: double.infinity,
                  color: Colors.black.withOpacity(0.375)),
              IconButton(
                  icon: Icon(
                    Icons.arrow_back,
                    color: Colors.white,
                  ),
                  onPressed: () => Navigator.pop(context)),
            ],
          ),
          Container(
              margin: EdgeInsets.only(top: 8.0,left: 8.0),
              child: Text('Plot Summary',
                style: TextStyle(fontSize: 20.0,
                    fontWeight: FontWeight.bold),
              )
          ),
          _aboutTitle(context, widget.record),
          Container(
            width: 200,
            height: 200,
            child: FlutterYoutubeView(
              onViewCreated: _onYoutubeCreated,
              listener: this,
              scaleMode: YoutubeScaleMode.none,
              params: YoutubeParam(
                videoId: widget.record.trailerUrl,
                showUI: false,
                startSeconds: 0.0
              ),
            ),
          ),
        ],
      ),
    );
  }

  //Youtube Methods Start
  @override
  void onCurrentSecond(double second) {
    print("onCurrentSecond second = $second");
    _currentVideoSecond = second;
  }

  @override
  void onError(String error) {
    print("onError error = $error");
  }

  @override
  void onReady() {
    print("onReady");
  }

  @override
  void onStateChange(String state) {
    print("onStateChange state = $state");
    setState(() {
      _playerState = state;
    });
  }

  @override
  void onVideoDuration(double duration) {
    print("onVideoDuration duration = $duration");
  }

  void _onYoutubeCreated(FlutterYoutubeViewController controller) {
    this._controller = controller;
  }
  //Youtube Methods End
}

This is what comes up in my console

Performing hot restart...
Syncing files to device Android SDK built for x86...
Restarted application in 2,814ms.
D/EGL_emulation(21355): eglMakeCurrent: 0x9e36efe0: ver 2 0 (tinfo 0xa0d03280)
I/chatty  (21355): uid=10083(u0_a83) 1.gpu identical 17 lines
D/EGL_emulation(21355): eglMakeCurrent: 0x9e36efe0: ver 2 0 (tinfo 0xa0d03280)
D/EGL_emulation(21355): eglMakeCurrent: 0x9e36efe0: ver 2 0 (tinfo 0xa0d03280)
D/EGL_emulation(21355): eglMakeCurrent: 0x9e36efe0: ver 2 0 (tinfo 0xa0d03280)
I/chatty  (21355): uid=10083(u0_a83) 1.gpu identical 558 lines
D/EGL_emulation(21355): eglMakeCurrent: 0x9e36efe0: ver 2 0 (tinfo 0xa0d03280)
E/flutter (21355): [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: PlatformException(error, Trying to create a platform view of unregistered type: plugins.hoanglm.com/youtube, null)
E/flutter (21355): #0      StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:564:7)
E/flutter (21355): #1      MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:302:33)
E/flutter (21355): <asynchronous suspension>
E/flutter (21355): #2      AndroidViewController._create (package:flutter/src/services/platform_views.dart:580:54)
E/flutter (21355): <asynchronous suspension>
E/flutter (21355): #3      AndroidViewController.setSize (package:flutter/src/services/platform_views.dart:505:14)
E/flutter (21355): <asynchronous suspension>
E/flutter (21355): #4      RenderAndroidView._sizePlatformView (package:flutter/src/rendering/platform_view.dart:178:29)
E/flutter (21355): <asynchronous suspension>
E/flutter (21355): #5      RenderAndroidView.performResize (package:flutter/src/rendering/platform_view.dart:159:5)
E/flutter (21355): #6      RenderObject.layout (package:flutter/src/rendering/object.dart:1617:9)
E/flutter (21355): #7      RenderConstrainedBox.performLayout (package:flutter/src/rendering/proxy_box.dart:259:13)
E/flutter (21355): #8      RenderObject.layout (package:flutter/src/rendering/object.dart:1632:7)
E/flutter (21355): #9      _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
E/flutter (21355): #10     RenderObject.layout (package:flutter/src/rendering/object.dart:1632:7)
E/flutter (21355): #11     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
E/flutter (21355): #12     RenderObject.layout (package:flutter/src/rendering/object.dart:1632:7)
E/flutter (21355): #13     RenderSliverMultiBoxAdaptor.insertAndLayoutChild (package:flutter/src/rendering/sliver_multi_box_adaptor.dart:413:13)
E/flutter (21355): #14     RenderSliverList.performLayout.advance (package:flutter/src/rendering/sliver_list.dart:190:19)
E/flutter (21355): #15     RenderSliverList.performLayout (package:flutter/src/rendering/sliver_list.dart:233:19)
E/flutter (21355): #16     RenderObject.layout (package:flutter/src/rendering/object.dart:1632:7)
E/flutter (21355): #17     RenderSliverPadding.performLayout (package:flutter/src/rendering/sliver_padding.dart:182:11)
E/flutter (21355): #18     RenderObject.layout (package:flutter/src/rendering/object.dart:1632:7)
E/flutter (21355): #19     RenderViewportBase.layoutChildSequence (package:flutter/src/rendering/viewport.dart:407:13)
E/flutter (21355): #20     RenderViewport._attemptLayout (package:flutter/src/rendering/viewport.dart:1322:12)
E/flutter (21355): #21     RenderViewport.performLayout (package:flutter/src/rendering/viewport.dart:1240:20)
E/flutter (21355): #22     RenderObject.layout (package:flutter/src/rendering/object.dart:1632:7)
E/flutter (21355): #23     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
E/flutter (21355): #24     RenderObject.layout (package:flutter/src/rendering/object.dart:1632:7)
E/flutter (21355): #25     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
E/flutter (21355): #26     RenderObject.layout (package:flutter/src/rendering/object.dart:1632:7)
E/flutter (21355): #27     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
E/flutter (21355): #28     RenderObject.layout (package:flutter/src/rendering/object.dart:1632:7)
E/flutter (21355): #29     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
E/flutter (21355): #30     RenderObject.layout (package:flutter/src/rendering/object.dart:1632:7)
E/flutter (21355): #31     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
E/flutter (21355): #32     RenderObject.layout (package:flutter/src/rendering/object.dart:1632:7)
E/flutter (21355): #33     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
E/flutter (21355): #34     RenderObject.layout (package:flutter/src/rendering/object.dart:1632:7)
E/flutter (21355): #35     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
E/flutter (21355): #36     Render
D/EGL_emulation(21355): eglMakeCurrent: 0x9e36efe0: ver 2 0 (tinfo 0xa0d03280)
I/chatty  (21355): uid=10083(u0_a83) 1.gpu identical 2 lines
D/EGL_emulation(21355): eglMakeCurrent: 0x9e36efe0: ver 2 0 (tinfo 0xa0d03280)

Any help is appreciated

why request CheckMediaAccessPermission

I/flutter ( 5449): onStateChange state = PLAYING
I/flutter ( 5449): onVideoDuration duration = 4118.0
E/chromium( 5449): [ERROR:web_contents_delegate.cc(197)] WebContentsDelegate::CheckMediaAccessPermission: Not supported.
E/chromium( 5449): [ERROR:web_contents_delegate.cc(197)] WebContentsDelegate::CheckMediaAccessPermission: Not supported.
W/cr_media( 5449): Requires MODIFY_AUDIO_SETTINGS and RECORD_AUDIO. No audio device will be available for recording

Bug in android

There are a view problem in android platform (fullscreen bug, persistent buttons). As the second option, can we get the option to use the web-based UI provided by the native library (useWebUi)?

Not visible with iOS

the viewer isn't visible on iOS even after add bool in the infoplist. All is good for android.

jvm problem

../flutter/.pub-cache/hosted/pub.dartlang.org/flutter_youtube_view-2.0.2/android/src/main/kotlin/com/hoanglm/flutteryoutubeview/FlutterYoutubeView.kt](): (134, 30): Cannot inline bytecode built with JVM target 1.8 into bytecode that is being built with JVM target 1.6. Please specify proper '-jvm-target' option

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':flutter_youtube_view:compileDebugKotlin'.

Compilation error. See log for more details

Share button doesn't work

When i click the share button in the video, it doesn't show share options. what we can do it about?

How to stop autoplay ?

I think it's not an issue but I don't succeded to not play automatically the video. Any solution ? Thank you

Force close on Samsung J2 Prime when screen rotated

This is the log
E/AndroidRuntime(18920): FATAL EXCEPTION: main
E/AndroidRuntime(18920): Process: com.kesan.android.stag, PID: 18920
E/AndroidRuntime(18920): java.lang.NullPointerException: Attempt to invoke virtual method 'void android.view.Display.getSize(android.graphics.Point)' on a null object reference
E/AndroidRuntime(18920): at org.chromium.ui.display.DisplayAndroid.updateFromDisplay(DisplayAndroid.java:133)
E/AndroidRuntime(18920): at org.chromium.ui.display.DisplayAndroidManager$DisplayListenerBackendImpl.onDisplayChanged(DisplayAndroidManager.java:169)
E/AndroidRuntime(18920): at android.hardware.display.DisplayManagerGlobal$DisplayListenerDelegate.handleMessage(DisplayManagerGlobal.java:786)
E/AndroidRuntime(18920): at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime(18920): at android.os.Looper.loop(Looper.java:148)
E/AndroidRuntime(18920): at android.app.ActivityThread.main(ActivityThread.java:7406)
E/AndroidRuntime(18920): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(18920): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
E/AndroidRuntime(18920): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)

Build failed with an exception

e: C:\Android\flutter.pub-cache\hosted\pub.dartlang.org\flutter_youtube_view-2.0.0\android\src\main\kotlin\com\hoanglm\flutteryoutubeview\FlutterYoutubeViewPlugin.kt: (19, 1): Class 'FlutterYoutubeViewPlugin' is not abstract and does not implement abstract member public abstract fun onActivitySaveInstanceState(p0: Activity, p1: Bundle): Unit defined in android.app.Application.ActivityLifecycleCallbacks
e: C:\Android\flutter.pub-cache\hosted\pub.dartlang.org\flutter_youtube_view-2.0.0\android\src\main\kotlin\com\hoanglm\flutteryoutubeview\FlutterYoutubeViewPlugin.kt: (143, 5): 'onActivitySaveInstanceState' overrides nothing

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':flutter_youtube_view:compileDebugKotlin'.

Compilation error. See log for more details

How to fix it?

Android full screen problem

I was trying to put the default youtube view into the body of a scaffold page like this

return Scaffold(
     appBar: AppBar(),
     body: Container(
         child: FlutterYoutubeView(
           onViewCreated: _onYoutubeCreated,
           listener: this,
           params: YoutubeParam(
             videoId: 'gcj2RUWQZ60', showUI: true, startSeconds: 0
           ),
         ),
       ),
     
   );

This works fine on my IOS device, however, the fullscreen function on the Android device is strange. On my Android device the full screen button will just "move" the youtube view to the top.

This is the normal view :
2019-10-08 02_14

This is the full-screen view:
2019-10-08 02_15

360 Video only working on android

Hi i really loved your plugin. I have used it in one our my application and it worked as i expected except in iOS , because i want to use this to host 360 video on youtube which works great in Android device but in iOS it does not so if you can please take a look at this and provide any quick solution.

Thanks

Suggestion: Support setPlaybackRate

I'd like to add setPlaybackRate(double rate) to the controller class so that a user can change the video playback speed from 0.5x to 2.0x.

Android Instructions

Are there any android instructions on integrating the package?

I was able to make it work for iOS but on android is just closes when I open this view.

Logs before the crash

W/Gralloc3(29124): allocator 3.x is not supported
D/FlutterYoutubeView(29124): params = {showYoutube=true, showFullScreen=false, startSeconds=0.0, scale_mode=0, videoId=ii_7IbHFEhc, showUI=true, autoPlay=true}
I/DecorView(29124): [INFO] isPopOver=false, config=false
I/DecorView(29124): updateCaptionType >> DecorView@adfbb0[], isFloating=false, isApplication=false, hasWindowDecorCaption=false, hasWindowControllerCallback=false
D/DecorView(29124): setCaptionType = 0, this = DecorView@adfbb0[]
D/InputTransport(29124): Input channel constructed: 'ea71c91', fd=213
I/ViewRootImpl@721baba[MainActivity](29124): setView = com.android.internal.policy.DecorView@adfbb0 TM=true
E/AndroidRuntime(29124): FATAL EXCEPTION: main
E/AndroidRuntime(29124): Process: io.with, PID: 29124
E/AndroidRuntime(29124): java.lang.AbstractMethodError: abstract method "void io.flutter.plugin.platform.PlatformView.onFlutterViewAttached(android.view.View)"
E/AndroidRuntime(29124): 	at io.flutter.plugin.platform.VirtualDisplayController.onFlutterViewAttached(VirtualDisplayController.java:181)
E/AndroidRuntime(29124): 	at io.flutter.plugin.platform.PlatformViewsController$1.createVirtualDisplayForPlatformView(PlatformViewsController.java:233)
E/AndroidRuntime(29124): 	at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.create(PlatformViewsChannel.java:104)
E/AndroidRuntime(29124): 	at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.onMethodCall(PlatformViewsChannel.java:59)
E/AndroidRuntime(29124): 	at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:233)
E/AndroidRuntime(29124): 	at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85)
E/AndroidRuntime(29124): 	at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:738)
E/AndroidRuntime(29124): 	at android.os.MessageQueue.nativePollOnce(Native Method)
E/AndroidRuntime(29124): 	at android.os.MessageQueue.next(MessageQueue.java:335)
E/AndroidRuntime(29124): 	at android.os.Looper.loop(Looper.java:206)

Full Screen and Youtube selections (like open with Youtube) not working on Android

when i click to fullscreen button nothing done but when i click to open with Youtube button i see this error

D/AndroidRuntime(10300): Shutting down VM E/AndroidRuntime(10300): FATAL EXCEPTION: main E/AndroidRuntime(10300): Process: dershub.senv2yayin, PID: 10300 E/AndroidRuntime(10300): android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want? E/AndroidRuntime(10300): at android.app.ContextImpl.startActivity(ContextImpl.java:682) E/AndroidRuntime(10300): at android.app.ContextImpl.startActivity(ContextImpl.java:669) E/AndroidRuntime(10300): at android.content.ContextWrapper.startActivity(ContextWrapper.java:341) E/AndroidRuntime(10300): at com.pierfrancescosoffritti.androidyoutubeplayer.core.ui.DefaultPlayerUiController$onVideoId$1.onClick(DefaultPlayerUiController.kt:283) E/AndroidRuntime(10300): at android.view.View.performClick(View.java:5215) E/AndroidRuntime(10300): at android.view.View$PerformClick.run(View.java:21193) E/AndroidRuntime(10300): at android.os.Handler.handleCallback(Handler.java:742) E/AndroidRuntime(10300): at android.os.Handler.dispatchMessage(Handler.java:95) E/AndroidRuntime(10300): at android.os.Looper.loop(Looper.java:157) E/AndroidRuntime(10300): at android.app.ActivityThread.main(ActivityThread.java:5653) E/AndroidRuntime(10300): at java.lang.reflect.Method.invoke(Native Method) E/AndroidRuntime(10300): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:746) E/AndroidRuntime(10300): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:636) I/Process (10300): Sending signal. PID: 10300 SIG: 9 Lost connection to device.

State stuck on BUFFERING - iOS

Try to embed the YouTubeDefaultWidget from the example in my app without success:

flutter: onReady
flutter: onStateChange state = UNSTARTED
flutter: onStateChange state = BUFFERING
[VERBOSE-2:platform_view_layer.cc(19)] Trying to embed a platform view but the PrerollContext does not support embedding
[VERBOSE-2:platform_view_layer.cc(28)] Trying to embed a platform view but the PaintContext does not support embedding

Set autoplay to true, but i cannot even see the video frame.

Video stopped when rotate

When I rotate video from portrait to landscape or landscape to portrait video stoped itself. why is that and how to overcome this behavior?

Add quality param in YoutubeParam

An enum like {Highest, High, Medium, Low} for quality will be good.
Side feature: somehow making sure your API always plays with the highest possible quality by default.

Cannot build apk

I have used this plugin in my app but when I am trying to build it, it throws this error:
`
FAILURE: Build failed with an exception.

  • What went wrong:
    A problem occurred configuring root project 'flutter_youtube_view'.

SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. `

Error when build IOS

I have error when build for IOS
How do I solve this?
Tks!

- `YoutubeKit` does not specify a Swift version and none of the targets (`Runner`) integrating it have the `SWIFT_VERSION` attribute set. Please contact the author or set the `SWIFT_VERSION` attribute in at least one of the targets that integrate this pod.
- `flutter_youtube_view` does not specify a Swift version and none of the targets (`Runner`) integrating it have the `SWIFT_VERSION` attribute set. Please contact the author or set the `SWIFT_VERSION` attribute in at least one of the targets that integrate this pod.

Youtube Player shows 'Video unavailable' for available video

I was able to reproduce this on unmodified repo by changing videoId value to _45ZERilec0 for YoutubeParam in YoutubeCustomWidget.dart. This video itself opens in browser just fine.

Console output:

flutter: onReady
flutter: onStateChange state = UNSTARTED
flutter: onStateChange state = BUFFERING
flutter: onStateChange state = UNSTARTED

startSeconds doesn't work in iOS

startSeconds doesn't work in iOS when passing non-zero value to FlutterYoutubeView constructor or loadOrCueVideo() method.

The same things work well in Android.

Any way to execute code on close webview?

I'm rotating the screen when the webview opens, but I need a way to set the rotation back to portrait when the webview is dismissed, is there an event or something I can do to achieve that?

CocoaPods could not find compatible versions for pod "flutter_youtube_view":

/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.3/lib/cocoapods/command.rb:52:inrun'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.3/bin/pod:55:in <top (required)>' /usr/local/bin/pod:22:in load'
/usr/local/bin/pod:22:in `

'
Error output from CocoaPods:

WARNING: CocoaPods requires your terminal to be using UTF-8 encoding.
Consider adding the following to ~/.profile:
export LANG=en_US.UTF-8

[!] Automatically assigning platform `iOS` with version `8.0` on target `Runner` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.

Error running pod install
Error launching application on iPhone 6s.
Exited (sigterm)`

'NSLayoutFormatOptions' was obsoleted in Swift 4.2

UIKit.NSLayoutFormatOptions:2:18: note: 'NSLayoutFormatOptions' was obsoleted in Swift 4.2
when trying to lunch on iOS

Try to refer to this fixed issue but still does not work
Does not work on Android as well. Fixed issue has not clear enough. Can you please guide us through ios and android error when trying to launch the plugin? The hack is hard to understand with no swift experience

for web

after web compiling i got only white screen, if push run button in studio then...

image

java.lang.Double cannot be cast to java.lang.Float

My code:
game.getLyric().getPhraseAt(1).startTime - 1000) / 1000

That return for example 80.805

When I call

this._controller.seekTo( ((game.getLyric().getPhraseAt(1).startTime - 1000) / 1000))

I have the following issue:

Failed to handle method call E/MethodChannel#plugins.hoanglm.com/youtube_3(19122): java.lang.ClassCastException: java.lang.Double cannot be cast to java.lang.Float E/MethodChannel#plugins.hoanglm.com/youtube_3(19122): at com.hoanglm.flutteryoutubeview.FlutterYoutubeView.seekTo(FlutterYoutubeView.kt:181) E/MethodChannel#plugins.hoanglm.com/youtube_3(19122): at com.hoanglm.flutteryoutubeview.FlutterYoutubeView.onMethodCall(FlutterYoutubeView.kt:106) E/MethodChannel#plugins.hoanglm.com/youtube_3(19122): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:201) E/MethodChannel#plugins.hoanglm.com/youtube_3(19122): at io.flutter.view.FlutterNativeView$PlatformMessageHandlerImpl.handleMessageFromDart(FlutterNativeView.java:188) E/MethodChannel#plugins.hoanglm.com/youtube_3(19122): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:202) E/MethodChannel#plugins.hoanglm.com/youtube_3(19122): at android.os.MessageQueue.nativePollOnce(Native Method) E/MethodChannel#plugins.hoanglm.com/youtube_3(19122): at android.os.MessageQueue.next(MessageQueue.java:379) E/MethodChannel#plugins.hoanglm.com/youtube_3(19122): at android.os.Looper.loop(Looper.java:144) E/MethodChannel#plugins.hoanglm.com/youtube_3(19122): at android.app.ActivityThread.main(ActivityThread.java:7529) E/MethodChannel#plugins.hoanglm.com/youtube_3(19122): at java.lang.reflect.Method.invoke(Native Method) E/MethodChannel#plugins.hoanglm.com/youtube_3(19122): at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:245) E/MethodChannel#plugins.hoanglm.com/youtube_3(19122): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:921) E/flutter (19122): [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: PlatformException(error, java.lang.Double cannot be cast to java.lang.Float, null) E/flutter (19122): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:564:7) E/flutter (19122): #1 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:302:33) E/flutter (19122): <asynchronous suspension> E/flutter (19122): #2 FlutterYoutubeViewController.seekTo (package:flutter_youtube_view/flutter_youtube_view.dart:115:20)

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.