Arma 3 Scripting

Function in GUI

BIS_fnc_playVideo

Also available as Markdown and JSON, or read the original wiki page.

Description

Plays in-game video with a range of options. The function can be called or spawned. If spawned, scriptDone command can be used to see if video is stopped or finished. If called 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 - see BIS_fnc_addScriptedEventHandler and Arma 3: Scripted Event Handlers.

Note

  • to play the video on an object, e.g an in-game screen, see #Example 3
  • the video can be stopped in a variety of ways - see #Example 4
  • see OGV File Format for format and conversion information.

Syntax

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

Parameters:

Returns: Boolean - true

Examples

Example 1

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

Example 2

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

Example 3

_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 BIS_fnc_playVideo;
["\a3\missions_f_exp\video\exp_m04_v02.ogv"] call BIS_fnc_playVideo;
missionNamespace setVariable ["BIS_fnc_playVideo_skipVideo", true];
missionNamespace setVariable ["MyCustomSkipVar", true];
sleep 1;
missionNamespace setVariable ["MyCustomSkipVar", nil]; // so it can be reused later

See also

Functions Library

Community notes

Dedmen

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

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

See OGV File Format.