BIS fnc playVideo: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "sqf>_([a-zA-Z0-9_]+) = " to "sqf>private _$1 = ") |
Lou Montana (talk | contribs) (Add OGV File Format link) |
||
Line 19: | Line 19: | ||
The function also calls {{hl|"BIS_fnc_playVideo_started"}} and {{hl|"BIS_fnc_playVideo_stopped"}} Scripted Event Handlers in [[missionNamespace]] - see [[BIS_fnc_addScriptedEventHandler]] and [[Arma 3: Scripted Event Handlers]]. | The function also calls {{hl|"BIS_fnc_playVideo_started"}} and {{hl|"BIS_fnc_playVideo_stopped"}} Scripted Event Handlers in [[missionNamespace]] - see [[BIS_fnc_addScriptedEventHandler]] and [[Arma 3: Scripted Event Handlers]]. | ||
{{Feature | informative | | {{Feature|informative| | ||
* to play the video on an object, e.g an in-game screen, see {{HashLink|#Example 3}} | * to play the video on an object, e.g an in-game screen, see {{HashLink|#Example 3}} | ||
* the video can be stopped in a variety of ways - see {{HashLink|#Example 4}}. | * the video can be stopped in a variety of ways - see {{HashLink|#Example 4}} | ||
* see [[OGV File Format]] for format and conversion information. | |||
}} | }} | ||
Line 28: | Line 29: | ||
|p1= content: [[String]] - Full path to .ogv file | |p1= content: [[String]] - Full path to .ogv file | ||
|p2= size: [[Array]] - | |p2= size: [[Array]] of [[Number]]s - (Optional, default [<nowiki/>[[safeZoneX]], [[safeZoneY]], [[safeZoneW]], [[safeZoneH]]]) screen size in format [x, y, w, h] | ||
|p3= color: [[Array]] - (Optional, default [1,1,1,1]) foreground color in format [r, g, b, a] | |p3= color: [[Array]] of [[Number]]s - (Optional, default [1,1,1,1]) foreground color in format [r, g, b, a] | ||
|p4= skipVarName: [[String]] - (Optional, default "BIS_fnc_playVideo_skipVideo") [[missionNamespace]] variable to skip the video when variable is [[true]] | |p4= skipVarName: [[String]] - (Optional, default "BIS_fnc_playVideo_skipVideo") [[missionNamespace]] variable to skip the video when variable is [[true]] | ||
|p5= bgColor: [[Array]] - (Optional, default: [0,0,0,1]) background color in format [r, g, b, a] | |p5= bgColor: [[Array]] format [[Color|Color (RGBA)]] - (Optional, default: [0,0,0,1]) background color in format [r, g, b, a] | ||
|p6= keepAspect (Optional): [[Boolean]] - [[true]] to keep original video aspect ratio (background color will fill the void), [[false]] to stretch. Default: [[true]] | |p6= keepAspect (Optional): [[Boolean]] - [[true]] to keep original video aspect ratio (background color will fill the void), [[false]] to stretch. Default: [[true]] | ||
Line 69: | Line 70: | ||
|text= Example ffmpeg command to encode a ogv video which can be played back. | |text= Example ffmpeg command to encode a ogv video which can be played back. | ||
<code>ffmpeg -i input.mp4 -c:v libtheora -q:v 7 -c:a libvorbis -q:a 4 intro.ogv</code> | <code>ffmpeg -i input.mp4 -c:v libtheora -q:v 7 -c:a libvorbis -q:a 4 intro.ogv</code> | ||
See [[OGV File Format]]. | |||
}} | }} |
Revision as of 00:12, 25 June 2022
Description
- 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. - Execution:
- call
- Groups:
- GUI
Syntax
- Syntax:
- [content, size, color, skipVarName, bgColor, keepAspect] spawn BIS_fnc_playVideo
- Parameters:
- content: String - Full path to .ogv file
- size: Array of Numbers - (Optional, default [safeZoneX, safeZoneY, safeZoneW, safeZoneH]) screen size in format [x, y, w, h]
- color: Array of Numbers - (Optional, default [1,1,1,1]) foreground color in format [r, g, b, a]
- skipVarName: String - (Optional, default "BIS_fnc_playVideo_skipVideo") missionNamespace variable to skip the video when variable is true
- bgColor: Array format Color (RGBA) - (Optional, default: [0,0,0,1]) background color in format [r, g, b, a]
- keepAspect (Optional): Boolean - true to keep original video aspect ratio (background color will fill the void), false to stretch. Default: true
- Return Value:
- Boolean - true
Examples
- Example 1:
- Example 2:
- 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 or spawn the function with an empty string:
- call or spawn the function with another video:
- set the variable "BIS_fnc_playVideo_skipVideo" to true:
- set the custom skip variable (skipVarName) to true: missionNamespace setVariable ["MyCustomSkipVar", true]; sleep 1; missionNamespace setVariable ["MyCustomSkipVar", nil]; // so it can be reused later
- call or spawn the function with an empty string:
Additional Information
- See also:
- Functions Library
Notes
-
Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note
- Posted on Nov 11, 2019 - 18:31 (UTC)
-
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.