mirror of
https://github.com/lubosz/overte.git
synced 2025-04-16 17:38:15 +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) {
|
||||
var errorMessage;
|
||||
|
||||
if (autoPlayTimer) { // Cancel autoplay.
|
||||
Script.clearTimeout(autoPlayTimer);
|
||||
autoPlayTimer = null;
|
||||
}
|
||||
|
||||
userID = user;
|
||||
|
||||
if (Entity.create(recording, position, orientation)) {
|
||||
|
@ -297,6 +302,8 @@
|
|||
errorMessage = "Could not persist recording " + recording.slice(4); // Remove leading "atp:".
|
||||
log(errorMessage);
|
||||
error(errorMessage);
|
||||
|
||||
autoPlayTimer = Script.setTimeout(autoPlay, AUTOPLAY_ERROR_INTERVAL); // Resume autoplay later.
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue