I was using youtube_player_flutter and implemented everything correctly as it was written in it's README.
But still I was facing one issue that whenever I open that page where I want the youtube player to open, it keeps loading and never loads the video.
I've searched about this issue everywhere but didn't get any solution. One of those solutions was that to include internet permission in AndroidManifest.xml
:
<uses-permission android:name="android.permission.INTERNET"/>
I did this, nothing changed. I also downgraded the package to v6.1.1, someone asked me to do this in github issue, but that also did nothing.
How can I resolve this issue?
I'm answering my own question as I didn't find anything that can resolve this problem when I was searching about this issue.
So, I tried to
define the controller in initState()
and it worked, and now it'sworking in v7.0.0+7
. This is my code: