Great question — answering as the UphillTech team:
Your workaround has a hidden bug: onError never fires. When maxresdefault.jpg doesn't exist, YouTube's image servers return a 404, but the body of that 404 is a real 120x90 grey JPEG (1,097 bytes). The browser decodes it, the <img> fires load instead of error , and resolution stays at "maxresdefault" . That's the tiny grey poster you're seeing. You can check it yourself: curl -s -o /dev/null -w "%{http_code} %{size_download}\n" https://i.ytimg.com/vi/tPEE9ZwTmy0/maxresdefault.jpg # 404 1097 Bad news on the "without fetching" part: there is no "best size" URL. The library just builds https://i.ytimg.com/vi/ID/{poster}.jpg from whatever you pass as poster , so something has to probe. It just...
Full answer by user33108073: https://stackoverflow.stackexchange.com/a/80002269 (CC BY-SA 4.0).
Need it done for your business? UphillTech.