mirror of
https://github.com/valmojr/armatak.git
synced 2026-06-13 23:43:28 +00:00
Created video addon
This commit is contained in:
83
addons/video/functions/fnc_videoParser.sqf
Normal file
83
addons/video/functions/fnc_videoParser.sqf
Normal file
@@ -0,0 +1,83 @@
|
||||
#include "..\script_component.hpp"
|
||||
|
||||
params [
|
||||
["_logic", objNull, [objNull]],
|
||||
["_units", [], [[]]],
|
||||
["_activated", true, [true]]
|
||||
];
|
||||
|
||||
if (isServer) exitWith {
|
||||
private _instance_address = GETVAR(_logic,instance_address,false);
|
||||
private _instance_port = GETVAR(_logic,instance_port,false);
|
||||
private _instance_auth_user = GETVAR(_logic,instance_auth_user,false);
|
||||
private _instance_auth_pass = GETVAR(_logic,instance_auth_pass,false);
|
||||
|
||||
SETMVAR(GVAR(instance_address),_instance_address);
|
||||
SETMVAR(GVAR(instance_port),_instance_port);
|
||||
SETMVAR(GVAR(instance_auth_user),_instance_auth_user);
|
||||
SETMVAR(GVAR(instance_auth_pass),_instance_auth_pass);
|
||||
|
||||
_startAction = [
|
||||
QGVAR(startStream),
|
||||
"Start Video Feed",
|
||||
"",
|
||||
{
|
||||
_uuid = (_this select 0) call armatak_fnc_extract_uuid;
|
||||
_uuid_short = _uuid select [0, 8];
|
||||
_role = roleDescription (_this select 0);
|
||||
_name = name (_this select 0);
|
||||
|
||||
_role = [_role] call BIS_fnc_filterString;
|
||||
_name = [_name] call BIS_fnc_filterString;
|
||||
|
||||
_stream_path = _name + "_" + _role + "_" + _uuid_short;
|
||||
|
||||
armatak_mediamtx_video_stream_instance_address = GETMVAR(instance_address,false);
|
||||
armatak_mediamtx_video_stream_instance_port = missionNamespace getVariable "instance_port";
|
||||
armatak_mediamtx_video_stream_instance_auth_user = missionNamespace getVariable "instance_auth_user";
|
||||
armatak_mediamtx_video_stream_instance_auth_pass = missionNamespace getVariable "instance_auth_pass";
|
||||
|
||||
"armatak" callExtension ["video_stream:start", [armatak_mediamtx_video_stream_instance_address, armatak_mediamtx_video_stream_instance_port, _stream_path, armatak_mediamtx_video_stream_instance_auth_user, armatak_mediamtx_video_stream_instance_auth_pass]];
|
||||
(_this select 0) setVariable ["armatak_video_feed_is_streaming", true];
|
||||
},
|
||||
{
|
||||
(_this select 0) getVariable "armatak_video_feed_is_streaming" == false
|
||||
}
|
||||
] call ace_interact_menu_fnc_createAction;
|
||||
[
|
||||
"Man",
|
||||
1,
|
||||
["ACE_SelfActions"],
|
||||
_startAction,
|
||||
true
|
||||
] call ace_interact_menu_fnc_addActionToClass;
|
||||
|
||||
_stopAction = [
|
||||
"ArmatakStopStream",
|
||||
"Stop Video Feed",
|
||||
"",
|
||||
{
|
||||
"armatak" callExtension ["video_stream:stop", []];
|
||||
SETVAR(_this select 0,GVAR(isStreaming),false);
|
||||
},
|
||||
{
|
||||
GETVAR((this select 0),GVAR(isStreaming),false)
|
||||
}
|
||||
] call ace_interact_menu_fnc_createAction;
|
||||
[
|
||||
"Man",
|
||||
1,
|
||||
["ACE_SelfActions"],
|
||||
_stopAction,
|
||||
true
|
||||
] call ace_interact_menu_fnc_addActionToClass;
|
||||
if (isMultiplayer) then {
|
||||
{
|
||||
SETVAR(_x,GVAR(isStreaming),false);
|
||||
} forEach playableUnits;
|
||||
} else {
|
||||
SETVAR(player,GVAR(isStreaming),false);
|
||||
};
|
||||
};
|
||||
|
||||
true;
|
||||
Reference in New Issue
Block a user