mirror of
https://github.com/overte-org/overte.git
synced 2025-07-22 22:34:12 +02:00
Cancel autoplay when manually playing
This commit is contained in:
parent
5c5eb298f5
commit
6bdd498ecf
1 changed files with 7 additions and 0 deletions
|
@ -286,6 +286,11 @@
|
||||||
function play(user, recording, position, orientation) {
|
function play(user, recording, position, orientation) {
|
||||||
var errorMessage;
|
var errorMessage;
|
||||||
|
|
||||||
|
if (autoPlayTimer) { // Cancel autoplay.
|
||||||
|
Script.clearTimeout(autoPlayTimer);
|
||||||
|
autoPlayTimer = null;
|
||||||
|
}
|
||||||
|
|
||||||
userID = user;
|
userID = user;
|
||||||
|
|
||||||
if (Entity.create(recording, position, orientation)) {
|
if (Entity.create(recording, position, orientation)) {
|
||||||
|
@ -297,6 +302,8 @@
|
||||||
errorMessage = "Could not persist recording " + recording.slice(4); // Remove leading "atp:".
|
errorMessage = "Could not persist recording " + recording.slice(4); // Remove leading "atp:".
|
||||||
log(errorMessage);
|
log(errorMessage);
|
||||||
error(errorMessage);
|
error(errorMessage);
|
||||||
|
|
||||||
|
autoPlayTimer = Script.setTimeout(autoPlay, AUTOPLAY_ERROR_INTERVAL); // Resume autoplay later.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue