vercel / react-tweet

Embed tweets in your React application.
https://react-tweet.vercel.app
MIT License
1.48k stars 82 forks source link

Disable preloading for Twitter videos #148

Closed dmeijboom closed 2 months ago

dmeijboom commented 7 months ago

When the preload attribute of the video element is set to metadata most browsers (if not all) will buffer the video anyway. In our application this results in huge data usage as we have multiple twitter embeds on the same page.

With preload set to none this doesn't happen.

vercel[bot] commented 7 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-tweet-create-react-app ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 5, 2023 1:11pm
react-tweet-custom-tweet-dub ❌ Failed (Inspect) Dec 5, 2023 1:11pm
react-tweet-next-app ❌ Failed (Inspect) Dec 5, 2023 1:11pm
react-tweet-site ❌ Failed (Inspect) Dec 5, 2023 1:11pm
react-tweet-vite-app ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 5, 2023 1:11pm
lfades commented 2 months ago

I couldn't merge the PR because I can't update it and there are conflicts due to changes in pnpm-lock so I've pushed the change in https://github.com/vercel/react-tweet/commit/649fb05e1429bfa0ebb8f96bc1d63448198ea0ef