He seguido varias sugerencias para hacer que el video de YouTube se reproduzca automáticamente, pero no pude hacerlo. Mis códigos son los siguientes:
1er intento (el código incrustado sin procesar adquirido directamente de youtube):
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/16.6.3/umd/react.production.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/react-dom/16.6.3/umd/react-dom.production.min.js"></script> <iframe className='w-full md:h-[550px] h-[300px] rounded-lg' src="https://www.youtube.com/embed/wkTFd3QZSP0" title="YouTube video player" frameBorder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowFullScreen></iframe>Segundo intento (usando 'reproducción automática' en lugar de 'reproducción automática' y también usando 'silenciado'):
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/16.6.3/umd/react.production.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/react-dom/16.6.3/umd/react-dom.production.min.js"></script> <iframe className='w-full md:h-[550px] h-[300px] rounded-lg' src="https://www.youtube.com/embed/wkTFd3QZSP0" title="YouTube video player" frameBorder="0" allow="accelerometer; clipboard-write; encrypted-media; gyroscope; picture-in-picture" autoPlay muted allowFullScreen></iframe>También probé 'react-player'; desafortunadamente, nada de esto funcionó.
debe agregar el parámetro de consulta después del enlace del video de YouTube.
reproducción automática no jugar sin silencio.
Puedes seguir
<iframe width="560" height="315" src="https://www.youtube-nocookie.com/embed/ycDeZBYy074?autoplay=1&mute=1" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>