-
DescriptionI am creating an html report using quarto. The report includes a variable number of videos - depending on some parameters (differs from one report to the next). I embed the videos in the document in a tabset panel using the code below, where vidname[kk] is the video (stored locally) The problem is that the video chapters don't show up and can't be used/accessed. I have confirmed that the chapters exist and are properly formatted by opening the video externally with another player (e.g., vlc). I checked the issues here and on Video.js (I believe that's what's being used) but can't seem to find an answer.
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Sorry, but I don't understand what that means. Also you might want to change your code to something more reliable, that is valid HTML (and more readable): ```{r}
#| output: asis
#| panel: tabset
for (kk in seq_along(vidname)) {
cat(sprintf(
"\n\n###%s\n\n",
str_replace(vidlabs[kk], "_", " + ")
))
cat(sprintf(
'<video width="800" controls><source src="%s" type="video/mp4"></video>',
vidname[kk]
))
}
``` Could you share a small self-contained "working" (reproducible) example to work with, i.e., a complete Quarto document or a (simple and small) Git repository? Thanks. You can share a self-contained "working" (reproducible) Quarto document using the following syntax, i.e., using more backticks than you have in your document (usually four ````qmd
---
title: "Reproducible Quarto Document"
format: html
engine: knitr
---
This is a reproducible Quarto document using `format: html`.
It is written in Markdown and contains embedded R code.
When you run the code, it will produce a plot.
```{r}
plot(cars)
```

The end.
```` Additionally and if not already given, please share the output of |
Beta Was this translation helpful? Give feedback.
-
LOL - I was hoping that by posting on the discussion group, rather than as a "bug", I would avoid this response. I understand why you want a reproducible example - and in many cases it makes perfect sense - but I don't really know how to do it in this case. I don't use or understand Git repositories, and the problem I am describing uses locally stored video (not youtube). So I can't really create a reproducible example. Sorry. The reprex approach/philosophy is certainly great, but might not be the only answer to all issues - perhaps if I describe things more clearly someone might just know the answer without needing to reproduce it. That is, someone may understand how to make chapters appear, and see that I am missing some option in my <video ...> command. Maybe it's just a simple syntax thing. Maybe it's just not possible. So, I am going to try again. Below is the code. And below that a (hopefully) clearer explanation.
Regarding my apparently unreadable and unreliable syntax - thanks for the tip, I will look into that. I found this syntax on StackOverflow a few years ago and have been using it (with success) ever since. Regarding the essense of the problem: the video (5y_8mo.mp4) contains chapters describing various patient condtions. If I open this video with (e.g.) vlc, I can see these chapters on the timeline. These chapters show up as tick marks on the timeline, and can be identified with a hovering mouse pointer. However, when I render the quarto document, the video is embedded beautifully (despite the ugly syntax) - but there are no chapters (tick marks, hoverable or otherwise). |
Beta Was this translation helpful? Give feedback.
I'am afraid your question has nothing to do with Quarto.
Video chapters and video HTML tags are not a Quarto thing.
That's HTML.
You should ask on HTML related websites what is required as video HTML option to have this if that is even possible.
For instance, you can use the HTML produced and tweak it.
Or directly create a simple HTML page yourself since you output raw HTML and tweak it.