question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add support / docs for adding movies to a book

See original GitHub issue

Allow movies from local file.

The documentation here shows that it is possible to add movies (in that case a gif) from the internet (though it does not show how). Movies stored as local files do not seem to be supported though.

![NOT WORKING my local movie](file_example_MOV_480_700kB.mov)

![WORKING giphy](https://media.giphy.com/media/yoJC2A59OCZHs1LXvW/giphy.gif)

![NOT WORKING movie from site](https://file-examples-com.github.io/uploads/2018/04/file_example_MOV_480_700kB.mov)

<div>
<video  loop controls width='420' height='315' preload='none'>
    <source src='file_example_MOV_480_700kB.mov' type='video/webm; codecs="vp8, vorbis"'>
</video>
</div>
<p><em>NOT WORKING Caption and label: <div id="movie"></div></em></p>

Steps to reproduce the behavior:

  1. Create a jupyter-book jupyter-book create mybook;
  2. Place the code above in a .md file, for example in mybook/intro.md;
  3. Download a movie from the internet, e.g. from here;
  4. jupyter-book build mybook
  5. The movies do not work, only one of the gif does.

Maybe the documentation means that only links to gif can work. In that case this is a feature request.

  • Python Version 3.6.9
  • Jupyter Book: 0.10.0
  • Operating System: Linux Mint

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:13 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
choldgrafcommented, Sep 21, 2021

Doesn’t YouTube have an embed code that you could use to embed it directly into the book’s markdown?

e.g.

# My title

Some text

<youtube embed code here >

Some more text

I feel like that should work as expected.

(and no progress has been made directly on this, we are a very resource-limited project, sorry that this is not happening quickly)

0reactions
parmentelatcommented, Dec 11, 2022

hi folks; as a follow-up on this one:

for the record here are a few related resources

and indeed the way I’ve been going forward to get local (as opposed to published on YouTube) videos embedded properly in both notebooks and jupyter-books has been to

  • use a raw html <video> tag
  • and move all the movies into a _static folder located right under the top of the document folder (that is, the place where jb is launched)

that kind of works, but I have to say there is room for improvement: in particular I have a source tree with a 2 to 3 deep layout, that is made of a collection of exercises/assignments and each exercise is a bundle in itself, so it is truly awkward that each subtree cannot hold its own media files as a consequence every one and again the students don’t get the attached videos because the teacher forgets about that oddity

plus, as this one repo / book is scaling up, this is becoming an issue in terms of namespace as well


I guess this is also frustrating because of the difference with image files: I can choose to have a media/ folder under each subfolder, and things work smoothly both in the notebook and in jb; and it is hard to understand why video files should be treated so differently

IIUC the image files work thanks to this

parse:
  myst_enable_extensions:
    - html_image    # for raw <img> tags in markdown

so, would it make sense to imagine a html_video extension that would allow us to deal with both kinds of media in a more uniform way ? in other words how welcome would be a PR in MyST-Parser to add such a feature ?

it looks like the crux of the matter lies around here https://github.com/executablebooks/MyST-Parser/blob/master/myst_parser/mdit_to_docutils/html_to_nodes.py#L72

Read more comments on GitHub >

github_iconTop Results From Across the Web

Upload PDF and EPUB files to your library - Google Play Help
Upload PDF & EPUB files · On your device, open Google Play Books Play Books . · At the top right, tap your...
Read more >
Use advanced book creation options in Pages - Apple Support
Learn how to use advanced options in Pages to fine tune or create a digital book in the EPUB book format.
Read more >
Add movie and sound files to InDesign documents
You can import audio files in MP3 format. Media file types such as QuickTime (.MOV), AVI, and MPEG are supported in exported interactive...
Read more >
Insert pictures, files, and videos in OneNote - Microsoft Support
Select the file and select Open. Insert a video. Find the video you want online. Copy the video URL from the address bar ......
Read more >
Learn About Sending Documents to Your Kindle Library
Send to Kindle is a free service that allows you to send documents to your Kindle library on your Kindle devices and Kindle...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found