---
name: "BIS_fnc_playVideo"
type: function
status: ok
groups: ["GUI"]
arma3_since: "0.50"
locality: {"argument": null, "effect": "local", "server_exec": false}
source: https://community.bistudio.com/wiki/BIS_fnc_playVideo
revid: 351834
updated: 2024-01-13T09:28:32Z
---

# BIS_fnc_playVideo

*Function · GUI · Arma 3 v0.50 · introduced in Arma 2: Operation Arrowhead v1.56*

Locality: effect **local**

## Description

Plays in-game video with a range of options. The function can be [call](../commands/call.md)ed or [spawn](../commands/spawn.md)ed. If [spawn](../commands/spawn.md)ed, [scriptDone](../commands/scriptDone.md) command can be used to see if video is stopped or finished. If [call](../commands/call.md)ed in scheduled environment, the next line of code will not process until the video is stopped or finished.

The function also calls `"BIS_fnc_playVideo_started"` and `"BIS_fnc_playVideo_stopped"` Scripted Event Handlers in [missionNamespace](../commands/missionNamespace.md) - see [BIS_fnc_addScriptedEventHandler](../functions/BIS_fnc_addScriptedEventHandler.md) and [Arma 3: Scripted Event Handlers](../topics/Scripted_Event_Handlers.md).

> [!NOTE]
> - to play the video on an object, e.g an in-game screen, see [#Example 3](../functions/BIS_fnc_playVideo.md#example-3)
> - the video can be stopped in a variety of ways - see [#Example 4](../functions/BIS_fnc_playVideo.md#example-4)
> - see OGV File Format for format and conversion information.

## Syntax

```sqf
[content, size, color, skipVarName, bgColor, keepAspect] spawn BIS_fnc_playVideo
```

**Parameters:**

- `content`: [String](../topics/String.md) - full path to `.ogv` file
- `size`: [Array](../topics/Array.md) of [Number](../topics/Number.md)s - (Optional, default [[safeZoneX](../commands/safeZoneX.md), [safeZoneY](../commands/safeZoneY.md), [safeZoneW](../commands/safeZoneW.md), [safeZoneH](../commands/safeZoneH.md)]) screen size in format [x, y, w, h]

  > [!NOTE]
  > If the aspect ratio of the size parameter is not the same as the aspect ratio of the video file, black bars will be visibile. The video will not be stretched
- `color`: [Array](../topics/Array.md) of [Number](../topics/Number.md)s - (Optional, default [1,1,1,1]) foreground color in format [r, g, b, a]
- `skipVarName`: [String](../topics/String.md) - (Optional, default "BIS_fnc_playVideo_skipVideo") [missionNamespace](../commands/missionNamespace.md) variable to skip the video when variable is [true](../commands/true.md)
- `bgColor`: [Array](../topics/Array.md) format [Color (RGBA)](../topics/Color.md) - (Optional, default: [0,0,0,1]) background color in format [r, g, b, a]
- `keepAspect`: [Boolean](../topics/Boolean.md) - (Optional, default [true](../commands/true.md)) [true](../commands/true.md) to keep original video aspect ratio (background color will fill the void), [false](../commands/false.md) to stretch

**Returns:** [Boolean](../topics/Boolean.md) - [true](../commands/true.md)

## Examples

### Example 1

```sqf
private _video = ["A3\Missions_F_EPA\video\A_in_intro.ogv"] spawn BIS_fnc_playVideo;
```

### Example 2

```sqf
private _video = ["\a3\missions_f_exp\video\exp_m04_v01.ogv"] call BIS_fnc_playVideo;
```

### Example 3

```sqf
_video = "a3\missions_f_exp\video\exp_m07_vout.ogv";
_screen = "Land_TripodScreen_01_large_F" createVehicle (player modelToWorld [0,10,0]);
_screen setObjectTexture [0, _video];
[_video, [10, 10]] call BIS_fnc_playVideo;
```

### Example 4

How to stop the video:
- call or spawn the function with an empty string: 

```sqf
[""] call BIS_fnc_playVideo;
```

- call or spawn the function with another video: 

```sqf
["\a3\missions_f_exp\video\exp_m04_v02.ogv"] call BIS_fnc_playVideo;
```

- set the variable "BIS_fnc_playVideo_skipVideo" to [true](../commands/true.md): 

```sqf
missionNamespace setVariable ["BIS_fnc_playVideo_skipVideo", true];
```

- set the custom skip variable (*skipVarName*) to [true](../commands/true.md): 

```sqf
missionNamespace setVariable ["MyCustomSkipVar", true];
sleep 1;
missionNamespace setVariable ["MyCustomSkipVar", nil]; // so it can be reused later
```

## See also

Functions Library

## Community notes

**Dedmen** — 2019-11-11

Example ffmpeg command to encode a ogv video which can be played back.

```sqf
ffmpeg -i input.mp4 -c:v libtheora -q:v 7 -c:a libvorbis -q:a 4 intro.ogv
```

See OGV File Format.

<sub>Source: [BI Community Wiki — BIS fnc playVideo](https://community.bistudio.com/wiki/BIS_fnc_playVideo) (revision 351834).</sub>
