Skip to content

Instantly share code, notes, and snippets.

@pvrego
Forked from thanasi/jupyter_local_video.py
Last active September 26, 2020 14:59
Show Gist options
  • Save pvrego/c0246e60de707e3c8b73e3c0fd5e4553 to your computer and use it in GitHub Desktop.
Save pvrego/c0246e60de707e3c8b73e3c0fd5e4553 to your computer and use it in GitHub Desktop.
Embed a local video file in a Jupyter Notebook

Embed a local video file in a Jupyter Notebook

#########################################
# 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>""")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment