# iota.media

**Description**

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

* [IotaVideo](#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](#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](#class_IotaVideo) <a href="#class_iotavideo" id="class_iotavideo"></a>

#### [iota.media.**IotaVideo**(filepath)](#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_](../render#create_video) _and_ [_iota.render.Scene.create\_video_](../render#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](#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)](#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](#class_IotaImage) <a href="#class_iotaimage" id="class_iotaimage"></a>

#### [iota.media.**IotaImage**(filepath)](#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_](../render#create_screenshots) _and_ [_iota.render.Scene.create\_screenshots_](../render#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](#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)](#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)
```
