Skip to article frontmatterSkip to article content

youtube: use IPython IFrame()

from IPython.display import IFrame

# Youtube
IFrame(
    "https://www.youtube.com/embed/i_ZcP7iNw-U?rel=0&controls=0&showinfo=0",
    width="600",
    height="400",
    # extras='frameborder="0" allowfullscreen',
)
Loading...

ditto with hide-input

the same with the input area hidden with

Loading...

local video: use ipywidgets’s Video()

for a local video - source needs to be put under _static

# same as above, you can use `remove-input` to hide the code

from ipywidgets import Video
Video.from_file("_static/under-static.mp4", autoplay=False, width='800px')
Loading...

using mystmd recipe

remote - youtube

using the iframe myst directive

works in both jlab and jb2

local (and not under _static)

using the figure myst directive

this works in mystmd/jb2, but not in jlab

local (and under _static)

using the figure myst directive again

this works in mystmd/jb2, but not in jlab