mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 20:56:52 +02:00
Don't close dialog when start recording; press "Record" again to finish
This commit is contained in:
parent
c369b1314a
commit
84cfe1cb75
3 changed files with 52 additions and 20 deletions
|
@ -11,3 +11,7 @@
|
||||||
.hidden {
|
.hidden {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
input[type=button].red.pressed {
|
||||||
|
background: linear-gradient(#94132e, #94132e);
|
||||||
|
}
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
|
|
||||||
var isUsingToolbar = false,
|
var isUsingToolbar = false,
|
||||||
isDisplayingInstructions = false,
|
isDisplayingInstructions = false,
|
||||||
|
isRecording = false,
|
||||||
numberOfPlayers = 0,
|
numberOfPlayers = 0,
|
||||||
recordingsBeingPlayed = [],
|
recordingsBeingPlayed = [],
|
||||||
elRecordingsPlaying,
|
elRecordingsPlaying,
|
||||||
|
@ -28,7 +29,8 @@ var isUsingToolbar = false,
|
||||||
NUMBER_OF_PLAYERS_ACTION = "numberOfPlayers",
|
NUMBER_OF_PLAYERS_ACTION = "numberOfPlayers",
|
||||||
STOP_PLAYING_RECORDING_ACTION = "stopPlayingRecording",
|
STOP_PLAYING_RECORDING_ACTION = "stopPlayingRecording",
|
||||||
LOAD_RECORDING_ACTION = "loadRecording",
|
LOAD_RECORDING_ACTION = "loadRecording",
|
||||||
START_RECORDING_ACTION = "startRecording";
|
START_RECORDING_ACTION = "startRecording",
|
||||||
|
STOP_RECORDING_ACTION = "stopRecording";
|
||||||
|
|
||||||
function stopPlayingRecording(event) {
|
function stopPlayingRecording(event) {
|
||||||
var playerID = event.target.getElementsByTagName("input")[0].value;
|
var playerID = event.target.getElementsByTagName("input")[0].value;
|
||||||
|
@ -152,6 +154,38 @@ function onScriptEventReceived(data) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function onLoadButtonClicked() {
|
||||||
|
EventBridge.emitWebEvent(JSON.stringify({
|
||||||
|
type: EVENT_BRIDGE_TYPE,
|
||||||
|
action: LOAD_RECORDING_ACTION
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
function onRecordButtonClicked() {
|
||||||
|
if (!isRecording) {
|
||||||
|
elRecordButton.classList.add("pressed");
|
||||||
|
EventBridge.emitWebEvent(JSON.stringify({
|
||||||
|
type: EVENT_BRIDGE_TYPE,
|
||||||
|
action: START_RECORDING_ACTION
|
||||||
|
}));
|
||||||
|
isRecording = true;
|
||||||
|
} else {
|
||||||
|
elRecordButton.classList.remove("pressed");
|
||||||
|
EventBridge.emitWebEvent(JSON.stringify({
|
||||||
|
type: EVENT_BRIDGE_TYPE,
|
||||||
|
action: STOP_RECORDING_ACTION
|
||||||
|
}));
|
||||||
|
isRecording = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function signalBodyLoaded() {
|
||||||
|
EventBridge.emitWebEvent(JSON.stringify({
|
||||||
|
type: EVENT_BRIDGE_TYPE,
|
||||||
|
action: BODY_LOADED_ACTION
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
function onBodyLoaded() {
|
function onBodyLoaded() {
|
||||||
|
|
||||||
EventBridge.scriptEventReceived.connect(onScriptEventReceived);
|
EventBridge.scriptEventReceived.connect(onScriptEventReceived);
|
||||||
|
@ -167,23 +201,10 @@ function onBodyLoaded() {
|
||||||
elShowInfoButton.onclick = showInstructions;
|
elShowInfoButton.onclick = showInstructions;
|
||||||
|
|
||||||
elLoadButton = document.getElementById("load-button");
|
elLoadButton = document.getElementById("load-button");
|
||||||
elLoadButton.onclick = function () {
|
elLoadButton.onclick = onLoadButtonClicked;
|
||||||
EventBridge.emitWebEvent(JSON.stringify({
|
|
||||||
type: EVENT_BRIDGE_TYPE,
|
|
||||||
action: LOAD_RECORDING_ACTION
|
|
||||||
}));
|
|
||||||
};
|
|
||||||
|
|
||||||
elRecordButton = document.getElementById("record-button");
|
elRecordButton = document.getElementById("record-button");
|
||||||
elRecordButton.onclick = function () {
|
elRecordButton.onclick = onRecordButtonClicked;
|
||||||
EventBridge.emitWebEvent(JSON.stringify({
|
|
||||||
type: EVENT_BRIDGE_TYPE,
|
|
||||||
action: START_RECORDING_ACTION
|
|
||||||
}));
|
|
||||||
};
|
|
||||||
|
|
||||||
EventBridge.emitWebEvent(JSON.stringify({
|
signalBodyLoaded();
|
||||||
type: EVENT_BRIDGE_TYPE,
|
|
||||||
action: BODY_LOADED_ACTION
|
|
||||||
}));
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -391,7 +391,8 @@
|
||||||
NUMBER_OF_PLAYERS_ACTION = "numberOfPlayers",
|
NUMBER_OF_PLAYERS_ACTION = "numberOfPlayers",
|
||||||
STOP_PLAYING_RECORDING_ACTION = "stopPlayingRecording",
|
STOP_PLAYING_RECORDING_ACTION = "stopPlayingRecording",
|
||||||
LOAD_RECORDING_ACTION = "loadRecording",
|
LOAD_RECORDING_ACTION = "loadRecording",
|
||||||
START_RECORDING_ACTION = "startRecording";
|
START_RECORDING_ACTION = "startRecording",
|
||||||
|
STOP_RECORDING_ACTION = "stopRecording";
|
||||||
|
|
||||||
function onWebEventReceived(data) {
|
function onWebEventReceived(data) {
|
||||||
var message = JSON.parse(data);
|
var message = JSON.parse(data);
|
||||||
|
@ -415,12 +416,18 @@
|
||||||
break;
|
break;
|
||||||
case START_RECORDING_ACTION:
|
case START_RECORDING_ACTION:
|
||||||
// Start making a recording.
|
// Start making a recording.
|
||||||
tablet.gotoHomeScreen(); // Closes window dialog.
|
|
||||||
HMD.closeTablet();
|
|
||||||
if (Recorder.isIdle()) {
|
if (Recorder.isIdle()) {
|
||||||
Recorder.startCountdown();
|
Recorder.startCountdown();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case STOP_RECORDING_ACTION:
|
||||||
|
// Cancel or finish a recording.
|
||||||
|
if (Recorder.isCountingDown()) {
|
||||||
|
Recorder.cancelCountdown();
|
||||||
|
} else if (Recorder.isRecording()) {
|
||||||
|
Recorder.finishRecording();
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue