Next.js Discord

Discord Forum

@next/third-party/google YouTube embed JS API

Unanswered
Pixiebob posted this in #help-forum
Open in Discord
Avatar
PixiebobOP
Hey, I'm curious what the best advice is on accessing the [JS API on lite-youtube-embed](https://github.com/paulirish/lite-youtube-embed?tab=readme-ov-file#access-the-youtube-iframe-player-api).

I would think about accessing the element using Ref, but the YouTubeEmbed doesn't accept ref as a parameter. Using document.querySelector is usually discouraged.

3 Replies

Avatar
PixiebobOP
Avatar
PixiebobOP
RIP
Avatar
PixiebobOP