Open bpaul7101 opened 4 years ago
Same issue with the Android after the flutter upgrade. It just shows the progress loader and the video doesn't get loaded at all.
Same issue in iOS
I have same issue ... in the end I ended up just using the flutter webview plugin , works perfectly to show a youtube video without any spinning progress bar etc ...
Hey all, I am having the exact same problem. My app simply grabs youtube videos organized by playlist. Sometimes they load, sometimes not...all the time it takes too much time (spinning circle) even more when not connected to wifi.
does the webview plugin solve all of this? what about when you turn the screen sideways? no problems at all?
thanks!
@alexda12 any update on how your solution is performing?
@Strat68. Unfortunately - this plugin has some issues with regards to the video stopping 1/2 way, spinning progress showing intermittently, caching issues plus rotation problems (Android).
I have had 100% success adapting the webview plugin.
Rotation is easy to accomplish with the plugin, it has support for offline caching and a builder for an initial widget to show whilst it streams your video ...
I would recommend adopting this component if you need to stream YT videos ... should take no more than 10-15 mins to implement.,
Thank you, ill give it a try
@MsXam Can you please clarify which "webview" plugin you used? The plugin in question (youtube_player_flutter) relies on "flutter_inappwebview" (written by pichillilorenzo@gmail.com), but there is also the official "webview_flutter" (written by flutter.dev) as well as "flutter_webview_plugin" (written by fluttercommunity.dev). My head is spinning trying to determine which plugin will actually work AND not violate YouTube's terms of service! I just posted on a thread that is several years old asking for some sort of "official" plugin, where all of the Flutter devs seem to dismiss such a notion as a waste of time (for them anyway). This can't just be some ancillary, unimportant issue for them. YouTube is a revenue machine! I would think they would want to drive as many viewers as possible to their platform! I'm perplexed. Your help is greatly appreciated!!
@davlinski The plugin you require is the flutter_webview_plugin: 0.3.11, i.e here :
https://pub.dev/packages/flutter_webview_plugin
Since my projects have been created pre 1.12 and are Obj-c based, other similar plugins were incompatible because of new Android changes relating to new Java Embedding format , hence it was too much trouble moving my entire app over to support this.
If you do go for this plugin that I have mentioned here, remember that the webview is not integrated into the widget tree - this may not be an issue to you if you just intend to nest Youtube videos and nothing else ...
Additionally you will need to add some simple code to handle rotation in Android and remove the AppBar in Landscape mode - iOS this is handle automatically for you...
Lastly, i'm unsure of your comment here :
which plugin will actually work AND not violate YouTube's terms of service!
In effect all you are doing by using this plugin is having an embedded browser that just services your URL ...
@davlinski The plugin you require is the flutter_webview_plugin: 0.3.11, i.e here :
https://pub.dev/packages/flutter_webview_plugin
Since my projects have been created pre 1.12 and are Obj-c based, other similar plugins were incompatible because of new Android changes relating to new Java Embedding format , hence it was too much trouble moving my entire app over to support this.
If you do go for this plugin that I have mentioned here, remember that the webview is not integrated into the widget tree - this may not be an issue to you if you just intend to nest Youtube videos and nothing else ...
Additionally you will need to add some simple code to handle rotation in Android and remove the AppBar in Landscape mode - iOS this is handle automatically for you...
Lastly, i'm unsure of your comment here :
which plugin will actually work AND not violate YouTube's terms of service!
In effect all you are doing by using this plugin is having an embedded browser that just services your URL ...
Thanks for helping Davlinski! He needs all the help he can get LOL!
Lastly, i'm unsure of your comment here :
which plugin will actually work AND not violate YouTube's terms of service!
In effect all you are doing by using this plugin is having an embedded browser that just services your URL ...
@MsXam I'm just referring to a comment on the thread asking for an official YouTube plugin: https://github.com/flutter/flutter/issues/13756#issuecomment-490497865
The commenter lists several YouTube plugins and mentions that they all violate YouTube terms of service. Thankfully, none of the webview plugins are listed.
Thanks for your help!
@MsXam we attempted to use the plugin you recommended but videos are slow to start playing especially over wifi. Is there any way to fix this and make it faster?
When a video is initiated, i watch the "loading spinner" run for 20 seconds before it starts. as a comparison...the youtube app plays videos almost instantly even over wifi.
@MsXam The reason why this package exists is to support inline playback and custom controls. And as per your comment, seems like you donot want an inline player, for that purpose, you can try using flutter_youtube. It's based off native plugins.
Sorry for the delay, was not being able to address all the issues with the plugin. I am currently refactoring the plugin and that should address the issues. But due busy schedules these days, the refactoring is being slow. 😣
@sarbagyastha You are correct...i was originally using the flutter_youtube player but it was extremely slow with video initiation.
I hope your updates work, thanks!
Please try with youtube_player_iframe.
I am using Flutter 1.17.x and have a few issues with the plugin with respect to iOS :-
1) I get
flutter: type 'int' is not a subtype of type 'double' in type cast
being displayed constantly
2) The plugin works the first 2 times but when I navigate to a page the 3rd,4th, 5th etc time - I just get a spinning progress bar.
Is this a KNOWN issue in iOS or do you need any other config in info.plist, ?
Simple code for the player is :