Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display video #45

Open
yakir12 opened this issue Sep 9, 2021 · 6 comments
Open

Display video #45

yakir12 opened this issue Sep 9, 2021 · 6 comments

Comments

@yakir12
Copy link

yakir12 commented Sep 9, 2021

Is there a way to display a video?

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

I tried:

# something

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

but I got the Alt video text.

@piever
Copy link
Owner

piever commented Sep 9, 2021

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?

@yakir12
Copy link
Author

yakir12 commented Sep 9, 2021

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
Copy link
Author

yakir12 commented Sep 10, 2021

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
Copy link
Author

yakir12 commented Sep 10, 2021

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">

@piever
Copy link
Owner

piever commented Sep 11, 2021

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.

@yakir12
Copy link
Author

yakir12 commented Sep 11, 2021

Just acknowledging that this worked. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants