добавил отправку в vMix дополнительного времени

This commit is contained in:
2026-05-15 13:51:07 +03:00
parent d7f13dcfe2
commit e3b612433c

View File

@@ -353,6 +353,17 @@ function startTimer() {
saveMatchState();
}
async function triggerVmixExtraTimeAction(minutes, half) {
const title = "ДОБАВЛЕННОЕ ВРЕМЯ ДЛЯ ВЕРХНЕГО СЧЕТА"
const commands = [
vmixCmd(`Function=SetText&Input=${encodeURIComponent(title)}&SelectedName=Добавленное.Text&Value=+${minutes}`),
vmixCmd(`Function=PreviewInput&Input=${encodeURIComponent(title)}`)
];
await sendDirectVmixCommands(commands);
}
function applyExtraTime() {
const input = document.getElementById("extraTimeMinutes");
const value = Math.max(0, Number(input ? input.value : 0));
@@ -371,6 +382,7 @@ function applyExtraTime() {
`Добавлено ${value} мин. к 1-му тайму`,
matchClockSeconds
);
triggerVmixExtraTimeAction(value, "first");
} else if (currentPeriod === "2H" || currentPeriod === "FT") {
extraTimeMinutes.second = value;
updatePeriodBadge(`2-й тайм +${value}`);
@@ -380,6 +392,7 @@ function applyExtraTime() {
`Добавлено ${value} мин. ко 2-му тайму`,
matchClockSeconds
);
triggerVmixExtraTimeAction(value, "second");
}
saveMatchState();