Remark.jl icon indicating copy to clipboard operation
Remark.jl copied to clipboard

Display video

Open yakir12 opened this issue 4 years ago • 6 comments

Is there a way to display a video?

I don't know much about Documenter.jl but it seems like it should work (see https://github.com/JuliaDocs/Documenter.jl/pull/1034). So should it therefore also work here?

I tried:

# something

![Alt video text](assets/lowres.webm)

but I got the Alt video text.

yakir12 avatar Sep 09 '21 08:09 yakir12

That's odd, I thought it should just be a matter of following the folder structure in https://github.com/piever/Remark.jl#external-assets-styling-and-customization and using relative paths.

If you add the video in the src/assets folder, (the one next to the file src/index.md) and you build the presentation, can you then find the video in build/assets?

Also, do you get this problem both with documenter=true and documenter=false?

piever avatar Sep 09 '21 15:09 piever

If you add the video in the src/assets folder, (the one next to the file src/index.md) and you build the presentation, can you then find the video in build/assets?

Yes.

Also, do you get this problem both with documenter=true and documenter=false?

Yeah, it doesn't matter.

yakir12 avatar Sep 09 '21 19:09 yakir12

That's odd, I thought it should just be a matter of following the folder structure in https://github.com/piever/Remark.jl#external-assets-styling-and-customization and using relative paths.

I'll add that I added a picture (a .jpeg file) to the assests folder and

# A picture

![](assets/coffee.jpeg)

to the index.md file and the resulting presentation showed the picture just fine. The video still shows the alternative text Alt video text.

yakir12 avatar Sep 10 '21 06:09 yakir12

Additionally, this doesn't work either:

---

# A video

<video width="320" height="240" controls>
  <source src="assets/video.mp4" type="video/mp4">
  Alt video text
</video> 

and I tried all sorts of paths in the src field.

And for sanity's sake, I checked and the following does work:

<img src="assets/coffee.jpeg" alt="Alt img text">

yakir12 avatar Sep 10 '21 07:09 yakir12

Ahhh, I understand what's happening... There is no markdown support for video. Documenter "cheats" by exporting the correct html. However we do not use the Documenter HTML export but the markdown export (which is what Remar.js wants). What's worse, if you add the raw html, Documenter will mess with it unless you wrap it in a raw block.

So, you should do

```@raw html
<video width="800" controls>
  <source src="assets/video.mp4" type="video/mp4">
  Your browser does not support the video tag.
</video>
```

Leaving the issue open because this is not ideal... I imagine the best would be to do the same trick Documenter does as a preprocessing step.

piever avatar Sep 11 '21 14:09 piever

Just acknowledging that this worked. Thanks!

yakir12 avatar Sep 11 '21 18:09 yakir12