overlay added - waiting for official logos

missing null assignment
This commit is contained in:
AlessandroSigna 2015-11-23 14:42:16 -08:00
parent a261b240aa
commit 8f1ce6e1fb
2 changed files with 23 additions and 1 deletions

View file

@ -21,6 +21,10 @@
var START_MESSAGE = "recordingStarted";
var STOP_MESSAGE = "recordingEnded";
var PARTICIPATING_MESSAGE = "participatingToRecording";
var ICON_WIDTH = 60;
var ICON_HEIGHT = 60;
var overlay = null;
function recordingEntity() {
_this = this;
@ -60,12 +64,22 @@
enterEntity: function (entityID) {
print("entering in the recording area");
Messages.subscribe(MASTER_TO_CLIENTS_CHANNEL);
overlay = Overlays.addOverlay("image", {
imageURL: "http://wcdn2.dataknet.com/static/resources/icons/set49/1c828b8c.png", //waiting for the official logo
width: ICON_HEIGHT,
height: ICON_WIDTH,
x: 600,
y: 0,
visible: true
});
},
leaveEntity: function (entityID) {
print("leaving the recording area");
_this.stopRecording();
Messages.unsubscribe(MASTER_TO_CLIENTS_CHANNEL);
Overlays.deleteOverlay(overlay);
overlay = null;
},
startRecording: function (entityID) {
@ -74,6 +88,7 @@
Messages.sendMessage(CLIENTS_TO_MASTER_CHANNEL, PARTICIPATING_MESSAGE); //tell to master that I'm participating
Recording.startRecording();
isAvatarRecording = true;
Overlays.editOverlay(overlay, {imageURL: "http://www.polyrythmic.org/picts/REC.png"}); //waiting for the official logo
}
},
@ -88,6 +103,7 @@
Recording.saveRecording(recordingFile); //save the clip locally
}
Recording.saveRecordingToAsset(getClipUrl); //save the clip to the asset and link a callback to get its url
Overlays.editOverlay(overlay, {imageURL: "http://wcdn2.dataknet.com/static/resources/icons/set49/1c828b8c.png"}); //waiting for the official logo
}
},
@ -96,6 +112,10 @@
_this.stopRecording();
Messages.unsubscribe(MASTER_TO_CLIENTS_CHANNEL);
Messages.messageReceived.disconnect(receivingMessage);
if(overlay !== null){
Overlays.deleteOverlay(overlay);
overlay = null;
}
}
}

View file

@ -97,10 +97,12 @@ function update(deltaTime) {
if (waitingForPerformanceFile) {
totalWaitingTime += deltaTime;
if (totalWaitingTime > TIMEOUT || performanceJSON.avatarClips.length === responsesExpected) {
print("UPLOADING PERFORMANCE FILE");
if (performanceJSON.avatarClips.length !== 0) {
print("UPLOADING PERFORMANCE FILE");
//I can upload the performance file on the asset
Assets.uploadData(JSON.stringify(performanceJSON), extension, uploadFinished);
} else {
print("PERFORMANCE FILE EMPTY");
}
//clean things after upload performance file to asset
waitingForPerformanceFile = false;