Last active
February 15, 2022 08:48
-
-
Save thanasi/ad31f798b747629e717bcebd2cad15cf to your computer and use it in GitHub Desktop.
Embed a local video file in a Jupyter Notebook
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
######################################### | |
# using cell magic | |
######################################### | |
%%HTML | |
<div align="middle"> | |
<video width="80%" controls> | |
<source src="path/to/my.mp4" type="video/mp4"> | |
</video></div> | |
######################################### | |
# explicitly calling the HTML renderer: | |
######################################### | |
from IPython.display import HTML | |
HTML(""" | |
<div align="middle"> | |
<video width="80%" controls> | |
<source src="path/to/my.mp4" type="video/mp4"> | |
</video></div>""") |
Im looking for a way to insert a youtube video or any local/remote video into the cells in Jupyter Notebook as part of a presentation (Slide mode). Is this possible?
This does not really work for me. I have a black video preview and that's it. Any insights regarding this?
same here I have a black video preview and that's it. Any insights regarding this?
This snippet is a bit outdated now. The IPython.display
module now contains classes for embedding local and remote video content.
https://ipython.readthedocs.io/en/stable/api/generated/IPython.display.html
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you! This is exactly what I am looking for.