mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
voice fixes
This commit is contained in:
parent
0ccf565956
commit
9a4a0e78a9
11 changed files with 231 additions and 175 deletions
|
@ -1,9 +1,15 @@
|
|||
define(['playbackManager'], function (playbackManager) {
|
||||
|
||||
function setActiveDevice(name) {
|
||||
return function () {
|
||||
playbackManager.trySetActiveDeviceName(name);
|
||||
};
|
||||
}
|
||||
|
||||
return function (result) {
|
||||
result.success = true;
|
||||
|
||||
if (result.properties.devicename) {
|
||||
playbackManager.trySetActiveDeviceName(result.properties.devicename);
|
||||
return setActiveDevice(result.properties.devicename);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -1,13 +1,18 @@
|
|||
define(['inputManager'], function (inputManager) {
|
||||
|
||||
function disableDisplayMirror() {
|
||||
return function () {
|
||||
inputManager.trigger('disabledisplaymirror');
|
||||
};
|
||||
}
|
||||
|
||||
return function (result) {
|
||||
result.success = true;
|
||||
|
||||
switch (result.item.deviceid) {
|
||||
case 'displaymirroring':
|
||||
inputManager.trigger('disabledisplaymirror');
|
||||
return disableDisplayMirror();
|
||||
break;
|
||||
default:
|
||||
result.success = false;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,13 +1,18 @@
|
|||
define(['inputManager'], function (inputManager) {
|
||||
|
||||
function enableDisplayMirror() {
|
||||
return function () {
|
||||
inputManager.trigger('enabledisplaymirror');
|
||||
};
|
||||
}
|
||||
|
||||
return function (result) {
|
||||
result.success = true;
|
||||
|
||||
switch (result.item.deviceid) {
|
||||
case 'displaymirroring':
|
||||
inputManager.trigger('enabledisplaymirror');
|
||||
return enableDisplayMirror();
|
||||
break;
|
||||
default:
|
||||
result.success = false;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -49,8 +49,8 @@
|
|||
}
|
||||
|
||||
return function (result) {
|
||||
result.success = false;
|
||||
|
||||
return function () {
|
||||
var query = {
|
||||
|
||||
Limit: result.item.limit || 100,
|
||||
|
@ -70,8 +70,6 @@
|
|||
playItems(queryResult.Items, result.item.shuffle);
|
||||
|
||||
});
|
||||
result.success = true;
|
||||
return;
|
||||
}
|
||||
|
||||
if (result.item.shuffle) {
|
||||
|
@ -97,10 +95,6 @@
|
|||
|
||||
playItems(queryResult.Items, result.item.shuffle);
|
||||
});
|
||||
|
||||
result.success = true;
|
||||
|
||||
return;
|
||||
|
||||
};
|
||||
}
|
||||
});
|
|
@ -3,7 +3,6 @@
|
|||
return function (result) {
|
||||
switch (result.item.deviceid) {
|
||||
default:
|
||||
result.success = false;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
define(['inputManager', 'connectionManager', 'embyRouter'], function (inputManager, connectionManager, embyRouter) {
|
||||
|
||||
return function (result) {
|
||||
result.success = true;
|
||||
switch (result.item.sourceid) {
|
||||
case 'music':
|
||||
function getMusicCommand(result) {
|
||||
return function () {
|
||||
inputManager.trigger('music');
|
||||
break;
|
||||
case 'movies':
|
||||
};
|
||||
}
|
||||
|
||||
function getMoviesCommand(result) {
|
||||
return function () {
|
||||
if (result.properties.movieName) {
|
||||
|
||||
//TODO: Find a way to display movie
|
||||
|
@ -32,12 +33,17 @@
|
|||
} else {
|
||||
inputManager.trigger('movies');
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
break;
|
||||
case 'tvseries':
|
||||
function getTVCommand(result) {
|
||||
return function () {
|
||||
inputManager.trigger('tv');
|
||||
break;
|
||||
case 'livetv':
|
||||
};
|
||||
}
|
||||
|
||||
function getLiveTVCommand(result) {
|
||||
return function () {
|
||||
var act = result.item.menuid;
|
||||
if (act) {
|
||||
if (act.indexOf('livetv') != -1) {
|
||||
|
@ -58,13 +64,23 @@
|
|||
} else {
|
||||
inputManager.trigger('livetv');
|
||||
}
|
||||
break;
|
||||
case 'recordings':
|
||||
};
|
||||
}
|
||||
|
||||
function getRecordingsCommand(result) {
|
||||
return function () {
|
||||
inputManager.trigger('recordedtv');
|
||||
break;
|
||||
case 'latestepisodes':
|
||||
};
|
||||
}
|
||||
|
||||
function getLatestEpisodesCommand(result) {
|
||||
return function () {
|
||||
inputManager.trigger('latestepisodes');
|
||||
case 'home':
|
||||
};
|
||||
}
|
||||
|
||||
function getHomeCommand(result) {
|
||||
return function () {
|
||||
var act = result.item.menuid;
|
||||
if (act) {
|
||||
if (act.indexOf('home') != -1) {
|
||||
|
@ -87,10 +103,29 @@
|
|||
} else {
|
||||
inputManager.trigger('home');
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
return function (result) {
|
||||
|
||||
switch (result.item.sourceid) {
|
||||
case 'music':
|
||||
return getMusicCommand(result);
|
||||
case 'movies':
|
||||
return getMoviesCommand(result);
|
||||
case 'tvseries':
|
||||
return getTVCommand(result);
|
||||
case 'livetv':
|
||||
return getLiveTVCommand(result);
|
||||
case 'recordings':
|
||||
return getRecordingsCommand(result);
|
||||
case 'latestepisodes':
|
||||
return getLatestEpisodesCommand(result);
|
||||
case 'home':
|
||||
return getHomeCommand(result);
|
||||
case 'group':
|
||||
break;
|
||||
return;
|
||||
default:
|
||||
result.success = false;
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,14 +1,20 @@
|
|||
define(['inputManager'], function (inputManager) {
|
||||
|
||||
function toggleDisplayMirror() {
|
||||
return function () {
|
||||
inputManager.trigger('toggledisplaymirror');
|
||||
};
|
||||
}
|
||||
|
||||
return function (result) {
|
||||
result.success = true;
|
||||
|
||||
switch (result.item.deviceid) {
|
||||
case 'displaymirroring':
|
||||
inputManager.trigger('toggledisplaymirror');
|
||||
return toggleDisplayMirror();
|
||||
break;
|
||||
default:
|
||||
result.success = false;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
});
|
|
@ -11,11 +11,15 @@ define(['require'], function (require) {
|
|||
return new Promise(function (resolve, reject) {
|
||||
|
||||
require([commandPath], function (command) {
|
||||
command(result);
|
||||
if (result.success) {
|
||||
|
||||
var fn = command(result);
|
||||
|
||||
if (fn) {
|
||||
result.fn = fn;
|
||||
resolve(result);
|
||||
}
|
||||
} else {
|
||||
reject();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -23,38 +27,34 @@ define(['require'], function (require) {
|
|||
|
||||
return function (result) {
|
||||
|
||||
return new Promise(function (resolve, reject) {
|
||||
|
||||
switch (result.item.actionid) {
|
||||
|
||||
case 'show':
|
||||
processCommand('./commands/showcommands.js', result).then(function (result) { resolve(result); });
|
||||
return processCommand('./commands/showcommands.js', result);
|
||||
break;
|
||||
case 'play':
|
||||
processCommand('./commands/playcommands.js', result).then(function (result) { resolve(result); });
|
||||
return processCommand('./commands/playcommands.js', result);
|
||||
break;
|
||||
case 'shuffle':
|
||||
processCommand('./commands/playcommands.js', result).then(function (result) { resolve(result); });
|
||||
return processCommand('./commands/playcommands.js', result);
|
||||
break;
|
||||
case 'search':
|
||||
processCommand('./commands/searchcommands.js', result).then(function (result) { resolve(result); });
|
||||
return processCommand('./commands/searchcommands.js', result);
|
||||
break;
|
||||
case 'control':
|
||||
processCommand('./commands/controlcommands.js', result).then(function (result) { resolve(result); });
|
||||
return processCommand('./commands/controlcommands.js', result);
|
||||
break;
|
||||
case 'enable':
|
||||
processCommand('./commands/enablecommands.js', result).then(function (result) { resolve(result); });
|
||||
return processCommand('./commands/enablecommands.js', result);
|
||||
break;
|
||||
case 'disable':
|
||||
processCommand('./commands/disablecommands.js', result).then(function (result) { resolve(result); });
|
||||
return processCommand('./commands/disablecommands.js', result);
|
||||
break;
|
||||
case 'toggle':
|
||||
processCommand('./commands/togglecommands.js', result).then(function (result) { resolve(result); });
|
||||
return processCommand('./commands/togglecommands.js', result);
|
||||
break;
|
||||
default:
|
||||
reject();
|
||||
return;
|
||||
return Promise.reject();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
|
@ -247,10 +247,15 @@ define(['dialogHelper', './voicereceiver', './voiceprocessor', 'globalize', 'emb
|
|||
listen();
|
||||
}
|
||||
function listen() {
|
||||
voicereceiver.listenForCommand(lang || "en-US").then(processInput).then(function (data) {
|
||||
voicereceiver.listenForCommand(lang || "en-US").then(processInput).then(function (result) {
|
||||
|
||||
closeDialog();
|
||||
|
||||
// Put a delay here in case navigation/popstate is involved. Allow that to flush out
|
||||
setTimeout(function () {
|
||||
result.fn();
|
||||
}, 1);
|
||||
|
||||
}, function (result) {
|
||||
if (result.error == 'group') {
|
||||
showVoiceHelp(result.item.groupid, result.groupName);
|
||||
|
|
|
@ -28,11 +28,12 @@
|
|||
console.log("Command from Grammar Processor", processor);
|
||||
return voicecommands(processor)
|
||||
.then(function (result) {
|
||||
|
||||
console.log("Result of executed command", result);
|
||||
if (result.item.actionid === 'show' && result.item.sourceid === 'group') {
|
||||
return Promise.resolve({ error: "group", item: result.item, groupName: result.name });
|
||||
return Promise.resolve({ error: "group", item: result.item, groupName: result.name, fn: result.fn });
|
||||
} else {
|
||||
return Promise.resolve({ item: result.item });
|
||||
return Promise.resolve({ item: result.item, fn: result.fn });
|
||||
}
|
||||
}, function () {
|
||||
return Promise.reject({ error: "unrecognized-command", text: text });
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
view.querySelector('.fldSelectEncoderPathType').classList.remove('hide');
|
||||
}
|
||||
|
||||
/*if (systemInfo.OperatingSystem == 'Windows' && systemInfo.SystemArchitecture != 'Arm') {
|
||||
if (systemInfo.OperatingSystem == 'Windows' && systemInfo.SystemArchitecture != 'Arm') {
|
||||
|
||||
view.querySelector('.suggestedLocation').innerHTML = Globalize.translate('FFmpegSuggestedDownload', '<a target="_blank" href="https://ffmpeg.zeranoe.com/builds">https://ffmpeg.zeranoe.com</a>');
|
||||
|
||||
|
@ -29,7 +29,7 @@
|
|||
instructions = 'Download FFmpeg 64-Bit Static';
|
||||
}
|
||||
|
||||
} else*/ if (systemInfo.OperatingSystem == 'Linux' && systemInfo.SystemArchitecture != 'Arm') {
|
||||
} else if (systemInfo.OperatingSystem == 'Linux' && systemInfo.SystemArchitecture != 'Arm') {
|
||||
|
||||
view.querySelector('.suggestedLocation').innerHTML = Globalize.translate('FFmpegSuggestedDownload', '<a target="_blank" href="http://johnvansickle.com/ffmpeg">http://johnvansickle.com/ffmpeg</a>');
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue