mirror of
https://github.com/overte-org/overte.git
synced 2025-04-19 12:23:24 +02:00
Add a "record" button to initiate recording
This commit is contained in:
parent
905560b96d
commit
f30dc4b560
3 changed files with 24 additions and 2 deletions
|
@ -16,12 +16,14 @@ var isUsingToolbar = false,
|
|||
elRecordingsPlaying,
|
||||
elNumberOfPlayers,
|
||||
elLoadButton,
|
||||
elRecordButton,
|
||||
EVENT_BRIDGE_TYPE = "record",
|
||||
BODY_LOADED_ACTION = "bodyLoaded",
|
||||
RECORDINGS_BEING_PLAYED_ACTION = "recordingsBeingPlayed",
|
||||
NUMBER_OF_PLAYERS_ACTION = "numberOfPlayers",
|
||||
STOP_PLAYING_RECORDING_ACTION = "stopPlayingRecording",
|
||||
LOAD_RECORDING_ACTION = "loadRecording";
|
||||
LOAD_RECORDING_ACTION = "loadRecording",
|
||||
START_RECORDING_ACTION = "startRecording";
|
||||
|
||||
function stopPlayingRecording(event) {
|
||||
var playerID = event.target.getElementsByTagName("input")[0].value;
|
||||
|
@ -111,6 +113,14 @@ function onBodyLoaded() {
|
|||
}));
|
||||
}
|
||||
|
||||
elRecordButton = document.getElementById("record-button");
|
||||
elRecordButton.onclick = function () {
|
||||
EventBridge.emitWebEvent(JSON.stringify({
|
||||
type: EVENT_BRIDGE_TYPE,
|
||||
action: START_RECORDING_ACTION
|
||||
}));
|
||||
}
|
||||
|
||||
EventBridge.emitWebEvent(JSON.stringify({
|
||||
type: EVENT_BRIDGE_TYPE,
|
||||
action: BODY_LOADED_ACTION
|
||||
|
|
|
@ -37,6 +37,9 @@
|
|||
<div>
|
||||
<input id="load-button" type="button" value="Load" disabled />
|
||||
</div>
|
||||
<div>
|
||||
<input id="record-button" class="red" type="button" value="Record" />
|
||||
</div>
|
||||
<script>
|
||||
onBodyLoaded();
|
||||
</script>
|
||||
|
|
|
@ -400,7 +400,8 @@
|
|||
RECORDINGS_BEING_PLAYED_ACTION = "recordingsBeingPlayed",
|
||||
NUMBER_OF_PLAYERS_ACTION = "numberOfPlayers",
|
||||
STOP_PLAYING_RECORDING_ACTION = "stopPlayingRecording",
|
||||
LOAD_RECORDING_ACTION = "loadRecording";
|
||||
LOAD_RECORDING_ACTION = "loadRecording",
|
||||
START_RECORDING_ACTION = "startRecording";
|
||||
|
||||
function onWebEventReceived(data) {
|
||||
var message = JSON.parse(data);
|
||||
|
@ -422,6 +423,14 @@
|
|||
// User wants to select an ATP recording to play.
|
||||
log("TODO: Open dialog for user to select ATP recording to play");
|
||||
break;
|
||||
case START_RECORDING_ACTION:
|
||||
// Start making a recording.
|
||||
tablet.gotoHomeScreen(); // Closes window dialog.
|
||||
HMD.closeTablet();
|
||||
if (Recorder.isIdle()) {
|
||||
Recorder.startCountdown();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue