How can I resolve the issue of a dark screen appearing in Rpubs when I embed YouTube videos using Quarto?

I am currently creating a document using Quarto in RStudio, where I am embedding a YouTube video and generating an HTML file, which is working without any errors. However, when I publish the document to RPubs, the embedded video appears as a black screen. I am seeking advice on how to resolve this issue.

This is the Yaml:

title: "Apuntes Pildoras informáticas curso de python, módulo 1"
author: "Pedro César Del Campo Neira"
format: 
  html: 
    self-contained: false
    toc: true
    toc-location: left
    toc-title: "Contenido"
#   css: styles.css
#    number-sections: true
theme:
  light: flatly
  dark: darkly

And, these are the ways I try to embed the videos:

The first:

{{< video https://www.youtube.com/watch?v=G2FCfQj-9ig&ab_channel=pildorasinformaticas >}}

The second:

<div>
<p style="text-align:center;">
<iframe width="600" height="420" src="https://www.youtube.com/embed/tgbNymZ7vqY">
</iframe>
</div>
</p>

And the third:

<iframe width="560" height="315" src="http://www.youtube.com/embed/9bZkp7q19f0?rel=0" frameborder="0" allowfullscreen></iframe>

I am attempting to successfully embed YouTube videos into Rpubs using Quarto in Rstudio. and seeking to resolve any issues that may arise.

Does the document renders correctly locally ? Is this only an issue in RPubs ?

If so, you could consider the newest alternative like RPubs, integrated with Quarto called Quarto Pub
See Quarto – Quarto Pub

Hope it helps

Hello cderv,

Yes, It renders locally. I could solve it using this thanks to Renzo Caceres Rossi with this video: Añadir vídeos en documento RMarkdown | Embed a video in a RMarkdown document | Embed vídeo RMarkdown - YouTube.

woow, Posit Pub, that was news to me. I will try it.

Thanks.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.