Open nicollegah opened 1 year ago
It's possible to improve the library by working with the oembed standard which tiktok offers.
https://www.tiktok.com/oembed?url=https://www.tiktok.com/@scout2015/video/6718335390845095173
As you can see the oembed endpoint gives you a bunch of informations. We're interested in the thumbnail data.
My implementation plan would be the following:
<img />
with the specified dimensions (or make it responsive with width 100%)<img />
Tag where the <img />
will be replaced with the embedded code which automatically starts. Hope this helps
For anyone encountering this issue and looking for a quick and dirty hack, just use height={"70vh"}
(or adjust as needed - you can also use the height of the video as a hardcoded magic number), then append a fake element below it to maintain visual continuity.
Here's an example:
Hey,
awesome project, it really alleviates some pain of including all these social media posts. I am wondering if it's possible to disable autoplay for TikTok videos. It is automatically disabled for Instagram and Twitter videos but the TikTok ones play on load and eat up memory.
Or am I overlooking something?
Thanks,
Nico