> For the complete documentation index, see [llms.txt](https://particle-analytics-1.gitbook.io/iota-user-manual/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://particle-analytics-1.gitbook.io/iota-user-manual/iota-python-reference-library/media.md).

# iota.media

**Description**

This module provides functionalities to display videos and images on notebooks.

* [IotaVideo](/iota-user-manual/iota-python-reference-library/media.md#class_IotaVideo)
  * [filepath](https://github.com/particle-analytics/iota-user-manual/tree/c25e767c006a77f3660728a528545cf848dbef52/IotaVideo_filepath/README.md)
  * [display](https://github.com/particle-analytics/iota-user-manual/tree/c25e767c006a77f3660728a528545cf848dbef52/IotaVideo_display/README.md)
* [IotaImage](/iota-user-manual/iota-python-reference-library/media.md#class_IotaVideo)
  * [filepath](https://github.com/particle-analytics/iota-user-manual/tree/c25e767c006a77f3660728a528545cf848dbef52/IotaImage_filepath/README.md)
  * [display](https://github.com/particle-analytics/iota-user-manual/tree/c25e767c006a77f3660728a528545cf848dbef52/IotaImage_display/README.md)

## [class IotaVideo](/iota-user-manual/iota-python-reference-library/media.md#class_IotaVideo) <a href="#class_iotavideo" id="class_iotavideo"></a>

#### [iota.media.**IotaVideo**(filepath)](/iota-user-manual/iota-python-reference-library/media.md#IotaVideo_ctor) <a href="#iotavideo_ctor" id="iotavideo_ctor"></a>

*Iota Video class object. This object can be created based on an existing video file or returned by the iota methods that allow to generate a videos (see for example* [*iota.render.create\_video*](/iota-user-manual/iota-python-reference-library/render.md#create_video) *and* [*iota.render.Scene.create\_video*](/iota-user-manual/iota-python-reference-library/render.md#scene_create_video)*)*

**Parameters**

* `filepath` : (str) filepath and name of the video file

**Example**

*Creating an IotaVideo object given a the path to a video file*

```python
my_video = iota.media.IotaVideo(filepath= 'C:/Users/Stephen/MyVideo/my_video.mp4')
```

### Attributes

#### [IotaVideo.filepath](/iota-user-manual/iota-python-reference-library/media.md#IotaVideo_filepath) <a href="#iotavideo_filepath" id="iotavideo_filepath"></a>

*Get the path and the name of the video file*

**Returns**

* A **string** with path and name of the video file

**Example**

*Getting the path and the name of the IotaVideo object*

```python
video_file = my_video.filepath
print(video_file)
```

### Methods

#### [IotaVideo.display(width, height)](/iota-user-manual/iota-python-reference-library/media.md#IotaVideo_display) <a href="#iotavideo_display" id="iotavideo_display"></a>

*Display an IotaVideo on the working notebook*

**Parameters**

* `width` : (int) width of the video display in pixels (Default: **None**)
* `height` : (int) height of the video display in pixels (Default: **None**)

**Example**

*Displaying an IotaVideo on the working notebook with original dimensions of the video*

```python
my_video.display()
```

*Displaying an IotaVideo on the working notebook with width equal to 600 pixels and keeping the original aspect ratio of the video*

```python
my_video.display(width=600)
```

*Displaying an IotaVideo on the working notebook with width equal to 800 pixels and height equal to 600 pixels*

```python
my_video.display(width=800, height=600)
```

## [class IotaImage](/iota-user-manual/iota-python-reference-library/media.md#class_IotaImage) <a href="#class_iotaimage" id="class_iotaimage"></a>

#### [iota.media.**IotaImage**(filepath)](/iota-user-manual/iota-python-reference-library/media.md#IotaImage_ctor) <a href="#iotaimage_ctor" id="iotaimage_ctor"></a>

*Iota Image class object. This object can be created based on an existing image file or returned by the iota methods that allow to generate a images (see for example* [*iota.render.create\_screenshots*](/iota-user-manual/iota-python-reference-library/render.md#create_screenshots) *and* [*iota.render.Scene.create\_screenshots*](/iota-user-manual/iota-python-reference-library/render.md#scene_create_screenshots)*)*

**Parameters**

* `filepath` : (str) filepath and name of the image file

**Example**

*Creating an IotaImage object given a the path to a image file*

```python
my_image = iota.media.IotaImage(filepath= 'C:/Users/Stephen/MyImages/my_image.png')
```

### Attributes

#### [IotaImage.filepath](/iota-user-manual/iota-python-reference-library/media.md#IotaImage_filepath) <a href="#iotaimage_filepath" id="iotaimage_filepath"></a>

*Get the path and the name of the image file*

**Returns**

* A **string** with path and name of the video file

**Example**

*Getting the path and the name of the IotaImage object*

```python
image_file = my_image.filepath
print(image_file)
```

### Methods

#### [IotaImage.display(width, height)](/iota-user-manual/iota-python-reference-library/media.md#IotaImage_display) <a href="#iotaimage_display" id="iotaimage_display"></a>

*Display an IotaImage on the working notebook*

**Parameters**

* `width` : (int) width of the image display in pixels (Default: **None**)
* `height` : (int) height of the image display in pixels (Default: **None**)

**Example**

*Displaying an IotaImage on the working notebook with original dimensions of the image*

```python
my_image.display()
```

*Displaying an IotaImage on the working notebook with width equal to 600 pixels and keeping the original aspect ratio of the image*

```python
my_image.display(width=600)
```

*Displaying an IotaImage on the working notebook with width equal to 800 pixels and height equal to 600 pixels*

```python
my_image.display(width=800, height=600)
```
