# Function: showVideo() (/pixi-vn/index/functions/showVideo)



## Call Signature [#call-signature]

\> **showVideo**(`alias`, `options?`): `Promise`\<[`VideoSprite`](/pixi-vn/index/classes/VideoSprite)>

Defined in: [src/canvas/functions/video-utility.ts:93](https://github.com/DRincs-Productions/pixi-vn/blob/f55707110b4a4bd56fb1c8547285a9aea26fda31/src/canvas/functions/video-utility.ts#L93)

Add and show a video in the canvas, using `alias` as the video alias.

### Parameters [#parameters]

#### alias [#alias]

`string`

The unique alias of the component, also used as the alias of the asset (it must be registered in the asset cache or manifest).

#### options? [#options]

[`VideoSpriteOptions`](/pixi-vn/index/interfaces/VideoSpriteOptions)

The options of the video.

### Returns [#returns]

`Promise`\<[`VideoSprite`](/pixi-vn/index/classes/VideoSprite)>

This function returns an [VideoSprite](/pixi-vn/index/classes/VideoSprite) that you can use to manipulate the component.

### Throws [#throws]

when `alias` is not registered in the asset cache.

### Example [#example]

```ts
Assets.add({ alias: "film", src: "https://pixijs.com/assets/video.mp4" });
await showVideo("film", { xAlign: 0.5 });
```

## Call Signature [#call-signature-1]

\> **showVideo**(`alias`, `videoUrl?`, `options?`): `Promise`\<[`VideoSprite`](/pixi-vn/index/classes/VideoSprite)>

Defined in: [src/canvas/functions/video-utility.ts:111](https://github.com/DRincs-Productions/pixi-vn/blob/f55707110b4a4bd56fb1c8547285a9aea26fda31/src/canvas/functions/video-utility.ts#L111)

Add and show a video in the canvas. This function is a combination of [addVideo](/pixi-vn/index/functions/addVideo).

### Parameters [#parameters-1]

#### alias [#alias-1]

`string`

The unique alias of the video. You can use this alias to refer to this video

#### videoUrl? [#videourl]

`string`

The url of the video.

#### options? [#options-1]

[`VideoSpriteOptions`](/pixi-vn/index/interfaces/VideoSpriteOptions)

The options of the video.

### Returns [#returns-1]

`Promise`\<[`VideoSprite`](/pixi-vn/index/classes/VideoSprite)>

This function returns an [VideoSprite](/pixi-vn/index/classes/VideoSprite) that you can use to manipulate the component.

### Throws [#throws-1]

when `videoUrl` is not provided and `alias` is not registered in the asset cache.

### Example [#example-1]

```ts
Assets.add({ alias: "film", src: "https://pixijs.com/assets/video.mp4" });

// "film" is the alias of the component and of the asset
const film1 = await showVideo("film");
// a different alias for the component: (alias, assetAlias, options)
const film2 = await showVideo("film2", "film", { xAlign: 1 });
```
