PaulieScanlon / mdx-embed

Embed 3rd party media content in MDX - no import required 🧽
https://mdx-embed.netlify.app/
MIT License
271 stars 30 forks source link

Add Youtube Nocookie component #231

Closed spacecowb0y closed 2 years ago

spences10 commented 2 years ago

Hey @spacecowb0y thanks for the PR, can you give a bit of detail on what this is for please?

My understanding was that the nocookie url was already used in the YouTube component, is this something additional to that?

spacecowb0y commented 2 years ago

Hi @spences10 , thank you for your fast reply. As far as I saw the YouTube component use the standard URL when embbeding the video. That's why I implemented a new one pointing to the no-cookie URL.

PaulieScanlon commented 2 years ago

@spacecowb0y hey. Thanks for the PR. I wonder if exposing a prop to switch the urls might be a better approach than duplicating the component. If the url is the only difference I'd suggest a useNoCookie optional boolean prop then a condition on the IFrame src url. What do you think?

spacecowb0y commented 2 years ago

I thought about that too. Let me re-write it and fix the PR.

PaulieScanlon commented 2 years ago

@spacecowb0y Yep! This looks a lot better! Thanks. I'll merge. I think that failing test has been resolved in another PR.