CarrKnight
CarrKnight

Reputation: 2928

Tell RMarkdown to not contain videos

RMarkdown is very useful and I build html documents containing both figures generated by R and some video links which I add straight through html as follows:

<video controls width="1000" height="600"  poster="linktoposter.jpg">
<source src="linkto.webm" type="video/webm">
<source src="http://linkto.mp4" type="video/mp4">
</video>   

This works absolutely fine except that RMarkdown downloads the video and embeds it in the html file.
When there are a few videos in the same document the html produced can reach 100s of megabytes in size.

I'd like to turn off the self-contained option but only for videos not for the charts R generates. Is there a way to do that? An html tag or class option perhaps?

Upvotes: 2

Views: 164

Answers (1)

G. Cocca
G. Cocca

Reputation: 2541

Embed the video using iframe tag in html

---
title: "My video"
output: html_document
---

<iframe width="1000" height="600"
src="https://www.youtube.com/embed/XGSy3_Czz8k">
</iframe>

Upvotes: 1

Related Questions