Saturday, July 27, 2024

Half 2: Displaying Movies in Jupyter Pocket book | by Chiawei Lim | Oct, 2023

[ad_1]

Presenting movies in Jupyter Pocket book cells

Photograph by the writer

Within the earlier article, the subject of displaying pictures in Jupyter Pocket book was lined. This text intends to proceed laying out the methods to run movies proper within the Jupyter Pocket book cells. This may ease any displaying of works that embrace video knowledge.

  • Add Movies to Markdown Cells
  • Add Movies to Python Cells

Show the Movies with HTML Syntax

Including movies to markdown cells could be executed with the HTML <video> tag.

<video src="video path">

The video path can both be

  • a video URL
  • a neighborhood video path (absolute/relative)

Under are the examples of every variant.

**Video URL**

<video src="https://interactive-examples.mdn.mozilla.internet/media/cc0-videos/flower.mp4">

**Native Relative Path**

<video src="metadata/video.mp4">

**Native Absolute Path**

<video src="/mypath/to/metadata/video.mp4">

Take a look at the code in Jupyter Pocket book

There are elective parameters that may be handed to the <video> tag. The non-exhausted listing under lays out the attributes that turn out to be useful and are of frequent use. Specifically, relating to adjusting the dimension of the video, altering both one (width/peak) retains the facet ratio of the video.

- width
- Instance: `width="200"`
- peak
- Instance: `peak="200"`
- autoPlay
- To play routinely: `autoplay="true"`
- To not play routinely: `autoplay="false"`
- controls
- To incorporate controls: `controls`
- To not embrace controls: exclude the controls parameter
- muted
- Muted for the reason that starting, however can toggle by person
- To mute sounds: `muted`
- To not mute sounds: exclude the parameter `muted`
- loop
- To run the video routinely in repetitive: `loop`
- To not run the video routinely: exclude the parameter `loop`

Examples are proven under:

**Relative Video Path**

<video…

[ad_2]

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles