At first thank you so much Google Team for this great pub package for requesting Google APIs in my Flutter App ❤️
Issue
I recognized that I could load Youtube thumbnails for each Video via my Debug-App and Debug Web-App without any problems.
But after creating a Release version (and yes I've setup --web-renderer html) all thumbnails lead to a CORS-Issue I couldn't resolve at all and also in my hosted Firebase Website it also leads to the same error.
Possible solution
After investigating and looking after how others solve this, I found this:
Instead of i.ytimg.com they're generating the url with i3.ytimg.com.
After testing this in my own Firebase Project it solved all of my CORS-Issues directly by replacing all of my urls i'm getting by the current youtube client api.
At first thank you so much Google Team for this great pub package for requesting Google APIs in my Flutter App ❤️
Issue
I recognized that I could load Youtube thumbnails for each Video via my Debug-App and Debug Web-App without any problems.
But after creating a Release version (and yes I've setup
--web-renderer html
) all thumbnails lead to a CORS-Issue I couldn't resolve at all and also in my hosted Firebase Website it also leads to the same error.Possible solution
After investigating and looking after how others solve this, I found this:
https://github.com/sarbagyastha/youtube_player_flutter/blob/7b4e615d6f8102d83ce11517f0746cc236d930d8/packages/youtube_player_iframe/lib/src/controller/youtube_player_controller.dart#L417
Instead of
i.ytimg.com
they're generating the url withi3.ytimg.com
.After testing this in my own Firebase Project it solved all of my CORS-Issues directly by replacing all of my urls i'm getting by the current youtube client api.
Workaround