Re: Video Embed's
Reply #6 –
How about some twitter, the place for open discussion on topics that most don't give a darn about, or a place to be the ultimate narcissist.
https://twitter.com/Interior/status/463440424141459456
https://twitter.com/KatieWoolard/status/1525298113241567238
Twitter is a bit funny in the API. You do not seem to be able to make a call directly from JS due CORS restrictions
So instead we have to make an API call from your site server to get the embed code and then display that.
An alternative would be to do a click and load, much like the facebook post above. But as an experiment I set up the server call to get and show the embed, and as a bonus its a lazy load, so it will not fetch until its in the viewport. Now someone may say you can just put loading=lazy on the tag, well no you can't as the tag is rendered by the script thats in in the embed, ha!
So here is Twitter, will show the twitter logo until the post is in frame and then it will fetch the tweet (which may or may not even have a video in it, its a tweet embed)
https://twitter.com/Interior/status/463440424141459456
https://twitter.com/KatieWoolard/status/1525298113241567238