mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 14:47:41 +02:00
Display playback errors only for user that initiated playback
This commit is contained in:
parent
acd71caae2
commit
2bed69cfea
2 changed files with 11 additions and 4 deletions
|
@ -267,7 +267,8 @@
|
||||||
|
|
||||||
Player = (function () {
|
Player = (function () {
|
||||||
// Recording playback functions.
|
// Recording playback functions.
|
||||||
var isPlayingRecording = false,
|
var userID = null,
|
||||||
|
isPlayingRecording = false,
|
||||||
recordingFilename = "",
|
recordingFilename = "",
|
||||||
autoPlayTimer = null,
|
autoPlayTimer = null,
|
||||||
|
|
||||||
|
@ -277,13 +278,16 @@
|
||||||
// Send error message to user.
|
// Send error message to user.
|
||||||
Messages.sendMessage(HIFI_RECORDER_CHANNEL, JSON.stringify({
|
Messages.sendMessage(HIFI_RECORDER_CHANNEL, JSON.stringify({
|
||||||
command: RECORDER_COMMAND_ERROR,
|
command: RECORDER_COMMAND_ERROR,
|
||||||
|
user: userID,
|
||||||
message: message
|
message: message
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
function play(recording, position, orientation) {
|
function play(user, recording, position, orientation) {
|
||||||
var errorMessage;
|
var errorMessage;
|
||||||
|
|
||||||
|
userID = user;
|
||||||
|
|
||||||
if (Entity.create(recording, position, orientation)) {
|
if (Entity.create(recording, position, orientation)) {
|
||||||
log("Play recording " + recording);
|
log("Play recording " + recording);
|
||||||
isPlayingRecording = true;
|
isPlayingRecording = true;
|
||||||
|
@ -305,6 +309,7 @@
|
||||||
recording = Entity.find();
|
recording = Entity.find();
|
||||||
if (recording) {
|
if (recording) {
|
||||||
log("Play persisted recording " + recordingFilename);
|
log("Play persisted recording " + recordingFilename);
|
||||||
|
userID = null;
|
||||||
playRecording(recording.recording, recording.position, recording.orientation);
|
playRecording(recording.recording, recording.position, recording.orientation);
|
||||||
} else {
|
} else {
|
||||||
autoPlayTimer = Script.setTimeout(autoPlay, AUTOPLAY_SEARCH_INTERVAL); // Try again soon.
|
autoPlayTimer = Script.setTimeout(autoPlay, AUTOPLAY_SEARCH_INTERVAL); // Try again soon.
|
||||||
|
@ -424,7 +429,7 @@
|
||||||
switch (message.command) {
|
switch (message.command) {
|
||||||
case PLAYER_COMMAND_PLAY:
|
case PLAYER_COMMAND_PLAY:
|
||||||
if (!Player.isPlaying()) {
|
if (!Player.isPlaying()) {
|
||||||
Player.play(message.recording, message.position, message.orientation);
|
Player.play(sender, message.recording, message.position, message.orientation);
|
||||||
} else {
|
} else {
|
||||||
log("Didn't start playing " + message.recording + " because already playing " + Player.recording());
|
log("Didn't start playing " + message.recording + " because already playing " + Player.recording());
|
||||||
}
|
}
|
||||||
|
|
|
@ -352,7 +352,9 @@
|
||||||
message = JSON.parse(message);
|
message = JSON.parse(message);
|
||||||
|
|
||||||
if (message.command === RECORDER_COMMAND_ERROR) {
|
if (message.command === RECORDER_COMMAND_ERROR) {
|
||||||
error(message.message);
|
if (message.user === MyAvatar.sessionUUID) {
|
||||||
|
error(message.message);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
index = playerIDs.indexOf(sender);
|
index = playerIDs.indexOf(sender);
|
||||||
if (index === -1) {
|
if (index === -1) {
|
||||||
|
|
Loading…
Reference in a new issue