youtube: use IPython IFrame()¶
from IPython.display import IFrame
# Youtube
IFrame(
"https://www.youtube.com/embed/i_ZcP7iNw-U?rel=0&controls=0",
width="600",
height="400",
# extras='frameborder="0" allowfullscreen',
)Loading...
ditto with remove-input¶
the same with the input area hidden using the remove-input cell tag
Loading...
using mystmd’s directives¶
remote with iframe¶
using the iframe myst directive
local with figure - under media/¶
somehow, the myst directive would result in a blank output...
here we’re using the figure myst directive
here we can set a width; it’s best to leave height undefined
not much control on the player though
this works in mystmd/jb2 (only in autoplay), but not in jlab
this would also work on a static file, but there’s no actual need to
using ipywidgets’s Video() is broken¶
# 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...