React stream integration questions

Hi
Using Cloudflare stream to show video on my website, but got a bit confused with implementation and speed. The site is SPA on react, so I use Cloudflare’s official react component and do everything according to documentation. Everything is working fine, but I got problems with my site’s loading speed. First of all, why are thums in jpeg format, and I can’t choose compression level or deliver webp/avif? Or I’m missing something? Second, why is JS so heavy(500kb), and sometimes it loads 2-3 times on a single visit and has a cache for 5 minutes? And when the site made a request to stream in response, I got 301 . I don’t know if I can post a link to the site here; if the moderator agrees, I’ll share it. For now some examples. It looks like I’m missing something
it’s webpagespeed, but for real browser I got the same
request:
:authority: embed.cloudflarestream.xxx
:method: GET
:path: /embed/sdk-iframe-integration.fla9.latest.js
:scheme: https
accept: /
accept-encoding: gzip, deflate, br
accept-language: en-US,en;q=0.9
referer: https://iframe.cloudflarestream./
sec-ch-ua: " Not A;Brand";v=“99”, “Chromium”;v=“101”, “Google Chrome”;v=“101”
sec-ch-ua-mobile: ?1
sec-ch-ua-platform: “Android”
sec-fetch-dest: script
sec-fetch-mode: no-cors
sec-fetch-site: same-site
user-agent: Mozilla/5.0 (Linux; Android 8.1.0; Moto G (4)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.54 Mobile Safari/537.36 PTST/220426.203944
response:
cf-ray: 70818c08cb709c7c-IAD
content-length: 0
date: Sun, 08 May 2022 10:35:09 GMT
expect-ct: max-age=604800, report-uri="://report-uri.Cloudflare./cdn-cgi/beacon/expect-ct"
location: https://embed.cloudflarestream.com/embed/sdk-iframe-integration.fla9.latest.js
server: Cloudflare
vary: Accept-Encoding
Also, in generating thumb for video preview in jpeg, how could I change this? 1.
RequestURL:
://cloudflarestream./970ea4ccf6d8064e8df7866012a5e0bf/thumbnails/thumbnail.jpg?height=720
It slows down my site, especially on mobile, and bad connection, loading could last for 15-20 seconds. I’m on a pro account and using all optimizations.