-
Notifications
You must be signed in to change notification settings - Fork 28k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[@next/third-parties] Youtube Embed missing muted option for autoplay parameter #77447
Comments
I don't think this issue is inherently a problem with Next.js itself. The README of @next/third-parties states: Next.js uses lite-youtube-embed, and there is an open issue regarding autoplay in that library: Ultimately, lite-youtube-embed sacrifices autoplay for performance optimization. |
Perhaps it's worth mentioning in the documentation of nextjs that autoplay will not work in the |
I agree with you. The Next.js documentation states that YouTube IFrame API parameters can be used, but it does not mention that the autoplay feature does not work. Most people would assume this is a bug in Next.js because there is no indication in the documentation that lite-youtube-embed does not support autoplay. I think it would be worth creating a PR to address this issue. |
Link to the code that reproduces this issue
https://codesandbox.io/p/devbox/async-star-46kklw
To Reproduce
@next/third-parties
YoutubeEmbed
from@next/third-parties/google
params="autoplay=1"
<video>
or<iframe>
thatthird-parties
is using under the hood to have themuted=true
property.Current vs. Expected behavior
I expected my video to autoplay
But, it didn't autoplay because there was no way to mute the video using
muted
(param doesn't exist)Provide environment information
Which area(s) are affected? (Select all that apply)
Not sure
Which stage(s) are affected? (Select all that apply)
next dev (local), Other (Deployed), Vercel (Deployed)
Additional context
Should look like this:
<YouTubeEmbed videoid="" height={400} params="autoplay=1" muted/>
or if autoplay is in param, automatically mute it. (
muted
property isn't a feature)The iFrame Player API from google docs does not include the option to mute. This needs to be done by
<video>
or<iframe>
component.Reference to nextjs docs for this library
The text was updated successfully, but these errors were encountered: