sarbagyastha / youtube_player_flutter

A Flutter plugin for inline playback or streaming of YouTube videos using the official iFrame Player API.
https://youtube.sarbagyastha.com.np
BSD 3-Clause "New" or "Revised" License
699 stars 806 forks source link

player stuck in loading state #955

Open MagarKJ opened 3 months ago

MagarKJ commented 3 months ago

E/flutter (26747): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:267) E/flutter (26747): at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:292) E/flutter (26747): at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:319) E/flutter (26747): at io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(Unknown Source:12) E/flutter (26747): at android.os.Handler.handleCallback(Handler.java:942) E/flutter (26747): at android.os.Handler.dispatchMessage(Handler.java:99) E/flutter (26747): at android.os.Looper.loopOnce(Looper.java:201) E/flutter (26747): at android.os.Looper.loop(Looper.java:288) E/flutter (26747): at android.app.ActivityThread.main(ActivityThread.java:7872) E/flutter (26747): at java.lang.reflect.Method.invoke(Native Method) E/flutter (26747): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548) E/flutter (26747): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936) E/flutter (26747): ) E/flutter (26747): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:648:7) E/flutter (26747): #1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:334:18) E/flutter (26747): E/flutter (26747): #2 ExpensiveAndroidViewController._sendCreateMessage (package:flutter/src/services/platform_views.dart:1099:5) E/flutter (26747): E/flutter (26747): #3 AndroidViewController.create (package:flutter/src/services/platform_views.dart:822:5) E/flutter (26747): E/flutter (26747): Screenshot (89) Screenshot (90) Screenshot (91) Screenshot (92)

CoderNamedHendrick commented 3 months ago

Is the issue from this package or in_app_webview @sarbagyastha ?

vko85 commented 3 months ago

However the package run on android, I notice the same on iOS that it stuck on loading phase. So as you pointed out inappwebview may hold the solution and due to the fact that I didn't see it among the installed packages i've added to dependencies. As soon as it deployed the inappwebview 5.8.0 package it solved my issue.

CoderNamedHendrick commented 3 months ago

Insane @vko85 . You added the inappwebview 5.8.0 as one of your dependency overrides right @vko85 ?

vko85 commented 3 months ago

@CoderNamedHendrick thats right.

CoderNamedHendrick commented 3 months ago

@vko85 I tried that and couldn't compile my app since the youtube player is depending on 6.0.0 and using some APIs that doesn't exist in 5.8.0.

Can you be more explicit about where you made this change @vko85 ?

CoderNamedHendrick commented 3 months ago

Overriding the youtube_player_flutter to an earlier version solves the problem.

Add this to my dependency_overrides youtube_player_flutter: 8.1.2

vko85 commented 3 months ago

@CoderNamedHendrick sorry, yes I was using these two versions too. youtube_player_flutter: ^8.1.2 flutter_inappwebview: ^5.8.0

I was already using an older version of the player because of some other dependencies.

novas1r1 commented 2 months ago

Thank you, downgrading youtube_player_flutter: ^8.1.2 fixed it for me as well.

TijnvandenEijnde commented 1 month ago

Unfortunately, the bug has not been addressed in version 9.0.2 as the YouTube player is constantly showing a loading spinner even when playing the video.

Constans commented 1 month ago

9.0.3 mentions that it addressed the issue, but it's still present for Android devices... The solution is to use 8.1.2 for now.