diff --git a/dashboard-ui/bower_components/emby-webcomponents/.bower.json b/dashboard-ui/bower_components/emby-webcomponents/.bower.json index 4673f8fd82..0ae3e2753a 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/.bower.json +++ b/dashboard-ui/bower_components/emby-webcomponents/.bower.json @@ -15,12 +15,12 @@ }, "devDependencies": {}, "ignore": [], - "version": "1.4.66", - "_release": "1.4.66", + "version": "1.4.68", + "_release": "1.4.68", "_resolution": { "type": "version", - "tag": "1.4.66", - "commit": "16a14d612b193c7a375e2391aa9c2370add0e32d" + "tag": "1.4.68", + "commit": "b14aefcc4a69f3dc2dfd530ddd0b99791719d259" }, "_source": "https://github.com/MediaBrowser/emby-webcomponents.git", "_target": "^1.2.0", diff --git a/dashboard-ui/bower_components/emby-webcomponents/inputmanager.js b/dashboard-ui/bower_components/emby-webcomponents/inputmanager.js new file mode 100644 index 0000000000..d1b4b2b2a7 --- /dev/null +++ b/dashboard-ui/bower_components/emby-webcomponents/inputmanager.js @@ -0,0 +1,242 @@ +define(['playbackManager', 'focusManager', 'embyRouter'], function (playbackManager, focusManager, embyRouter) { + + var lastInputTime = new Date().getTime(); + + function notify() { + lastInputTime = new Date().getTime(); + } + + function idleTime() { + return new Date().getTime() - lastInputTime; + } + + function select(sourceElement) { + + sourceElement.click(); + } + + var eventListenerCount = 0; + function on(scope, fn) { + eventListenerCount++; + scope.addEventListener('command', fn); + } + + function off(scope, fn) { + + if (eventListenerCount) { + eventListenerCount--; + } + + scope.removeEventListener('command', fn); + } + + var commandTimes = {}; + + function checkCommandTime(command) { + + var last = commandTimes[command] || 0; + var now = new Date().getTime(); + + if ((now - last) < 1000) { + return false; + } + + commandTimes[command] = now; + return true; + } + + function handleCommand(name, options) { + + notify(); + + var sourceElement = (options ? options.sourceElement : null); + + if (sourceElement) { + sourceElement = focusManager.focusableParent(sourceElement); + } + + sourceElement = sourceElement || document.activeElement || window; + + if (eventListenerCount) { + var customEvent = new CustomEvent("command", { + detail: { + command: name + }, + bubbles: true, + cancelable: true + }); + + var eventResult = sourceElement.dispatchEvent(customEvent); + if (!eventResult) { + // event cancelled + return; + } + } + + switch (name) { + + case 'up': + focusManager.moveUp(sourceElement); + break; + case 'down': + focusManager.moveDown(sourceElement); + break; + case 'left': + focusManager.moveLeft(sourceElement); + break; + case 'right': + focusManager.moveRight(sourceElement); + break; + case 'home': + embyRouter.goHome(); + break; + case 'settings': + embyRouter.showSettings(); + break; + case 'back': + embyRouter.back(); + break; + case 'forward': + // TODO + break; + case 'select': + select(sourceElement); + break; + case 'pageup': + // TODO + break; + case 'pagedown': + // TODO + break; + case 'end': + // TODO + break; + case 'menu': + case 'info': + // TODO + break; + case 'next': + if (playbackManager.isPlayingVideo()) { + playbackManager.nextChapter(); + } else if (playbackManager.isPlaying()) { + playbackManager.nextTrack(); + } + break; + case 'previous': + + if (playbackManager.isPlayingVideo()) { + playbackManager.previousChapter(); + } else if (playbackManager.isPlaying()) { + playbackManager.previousTrack(); + } + break; + case 'guide': + embyRouter.showGuide(); + break; + case 'recordedtv': + embyRouter.showRecordedTV(); + break; + case 'record': + // TODO + break; + case 'livetv': + embyRouter.showLiveTV(); + break; + case 'mute': + playbackManager.mute(); + break; + case 'unmute': + playbackManager.unMute(); + break; + case 'togglemute': + playbackManager.toggleMute(); + break; + case 'volumedown': + playbackManager.volumeDown(); + break; + case 'volumeup': + playbackManager.volumeUp(); + break; + case 'play': + playbackManager.unpause(); + break; + case 'pause': + playbackManager.pause(); + break; + case 'playpause': + playbackManager.playPause(); + break; + case 'stop': + if (checkCommandTime('stop')) { + playbackManager.stop(); + } + break; + case 'changezoom': + // TODO + break; + case 'changeaudiotrack': + // TODO + break; + case 'changesubtitletrack': + break; + case 'search': + embyRouter.showSearch(); + break; + case 'favorites': + embyRouter.showFavorites(); + break; + case 'fastforward': + playbackManager.fastForward(); + break; + case 'rewind': + playbackManager.rewind(); + break; + case 'togglefullscreen': + // TODO + break; + case 'disabledisplaymirror': + playbackManager.enableDisplayMirroring(false); + break; + case 'enabledisplaymirror': + playbackManager.enableDisplayMirroring(true); + break; + case 'toggledisplaymirror': + playbackManager.toggleDisplayMirroring(); + break; + case 'movies': + // TODO + break; + case 'music': + // TODO + break; + case 'tv': + // TODO + break; + case 'latestepisodes': + // TODO + break; + case 'nowplaying': + // TODO + break; + case 'upcomingtv': + // TODO + break; + case 'nextup': + // TODO + break; + default: + break; + } + } + + document.addEventListener('click', notify); + + return { + trigger: handleCommand, + handle: handleCommand, + notify: notify, + idleTime: idleTime, + on: on, + off: off + }; +}); \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/router.js b/dashboard-ui/bower_components/emby-webcomponents/router.js index c4279ac30e..78c235c773 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/router.js +++ b/dashboard-ui/bower_components/emby-webcomponents/router.js @@ -27,6 +27,12 @@ define(['loading', 'viewManager', 'skinManager', 'pluginManager', 'backdrop', 'b }, showLiveTV: function () { skinManager.getCurrentSkin().showLiveTV(); + }, + showRecordedTV: function () { + skinManager.getCurrentSkin().showRecordedTV(); + }, + showFavorites: function () { + skinManager.getCurrentSkin().showFavorites(); } }; diff --git a/dashboard-ui/bower_components/emby-webcomponents/strings/en-US.json b/dashboard-ui/bower_components/emby-webcomponents/strings/en-US.json index 5d4ee9e1c5..5d410526e3 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/strings/en-US.json +++ b/dashboard-ui/bower_components/emby-webcomponents/strings/en-US.json @@ -86,5 +86,11 @@ "ReplaceAllMetadata": "Replace all metadata", "SearchForMissingMetadata": "Search for missing metadata", "LabelRefreshMode": "Refresh mode:", + "NoItemsFound": "No items found.", + "HeaderSaySomethingLike": "Say Something Like...", + "ButtonTryAgain": "Try Again", + "HeaderYouSaid": "You Said...", + "MessageWeDidntRecognizeCommand": "We're sorry, we didn't recognize that command.", + "MessageIfYouBlockedVoice": "If you denied voice access to the app you'll need to reconfigure before trying again.", "RefreshDialogHelp": "Metadata is refreshed based on settings and internet services that are enabled in the Emby Server dashboard." } \ No newline at end of file diff --git a/dashboard-ui/voice/Readme.md b/dashboard-ui/bower_components/emby-webcomponents/voice/Readme.md similarity index 100% rename from dashboard-ui/voice/Readme.md rename to dashboard-ui/bower_components/emby-webcomponents/voice/Readme.md diff --git a/dashboard-ui/bower_components/emby-webcomponents/voice/commands/controlcommands.js b/dashboard-ui/bower_components/emby-webcomponents/voice/commands/controlcommands.js new file mode 100644 index 0000000000..c1b46cc0e7 --- /dev/null +++ b/dashboard-ui/bower_components/emby-webcomponents/voice/commands/controlcommands.js @@ -0,0 +1,10 @@ +define(['playbackManager'], function (playbackManager) { + + return function (result) { + result.success = true; + if (result.properties.devicename) { + playbackManager.trySetActiveDeviceName(result.properties.devicename); + } + return; + } +}); \ No newline at end of file diff --git a/dashboard-ui/voice/commands/disablecommands.js b/dashboard-ui/bower_components/emby-webcomponents/voice/commands/disablecommands.js similarity index 61% rename from dashboard-ui/voice/commands/disablecommands.js rename to dashboard-ui/bower_components/emby-webcomponents/voice/commands/disablecommands.js index b6cbd120be..20f1e004f6 100644 --- a/dashboard-ui/voice/commands/disablecommands.js +++ b/dashboard-ui/bower_components/emby-webcomponents/voice/commands/disablecommands.js @@ -1,10 +1,10 @@ -define([], function () { +define(['inputManager'], function (inputManager) { - return function (result) { + return function (result) { result.success = true; switch (result.item.deviceid) { case 'displaymirroring': - MediaController.enableDisplayMirroring(false); + inputManager.trigger('disabledisplaymirror'); break; default: result.success = false; diff --git a/dashboard-ui/voice/commands/enablecommands.js b/dashboard-ui/bower_components/emby-webcomponents/voice/commands/enablecommands.js similarity index 69% rename from dashboard-ui/voice/commands/enablecommands.js rename to dashboard-ui/bower_components/emby-webcomponents/voice/commands/enablecommands.js index 5fc5eff211..af88c8e432 100644 --- a/dashboard-ui/voice/commands/enablecommands.js +++ b/dashboard-ui/bower_components/emby-webcomponents/voice/commands/enablecommands.js @@ -1,10 +1,10 @@ -define([], function () { +define(['inputManager'], function (inputManager) { return function (result) { result.success = true; switch (result.item.deviceid) { case 'displaymirroring': - MediaController.enableDisplayMirroring(true); + inputManager.trigger('enabledisplaymirror'); break; default: result.success = false; diff --git a/dashboard-ui/voice/commands/playcommands.js b/dashboard-ui/bower_components/emby-webcomponents/voice/commands/playcommands.js similarity index 85% rename from dashboard-ui/voice/commands/playcommands.js rename to dashboard-ui/bower_components/emby-webcomponents/voice/commands/playcommands.js index ce2b500fde..7aedf49c6f 100644 --- a/dashboard-ui/voice/commands/playcommands.js +++ b/dashboard-ui/bower_components/emby-webcomponents/voice/commands/playcommands.js @@ -1,5 +1,4 @@ - -define([], function () { +define(['connectionManager', 'playbackManager', 'globalize'], function (connectionManager, playbackManager, globalize) { /// Play items. /// The items. @@ -16,13 +15,13 @@ define([], function () { }); if (items.length) { - MediaController.play({ + playbackManager.play({ ids: items }); } else { require(['toast'], function (toast) { - toast(Globalize.translate('MessageNoItemsFound')); + toast(globalize.translate('sharedcomponents#NoItemsFound')); }); } } @@ -63,9 +62,10 @@ define([], function () { query.IncludeItemTypes = result.item.itemType; } + var apiClient = connectionManager.currentApiClient(); if (result.item.sourceid === 'nextup') { - ApiClient.getNextUpEpisodes(query).then(function (queryResult) { + apiClient.getNextUpEpisodes(query).then(function (queryResult) { playItems(queryResult.Items, result.item.shuffle); @@ -93,7 +93,7 @@ define([], function () { } - ApiClient.getItems(Dashboard.getCurrentUserId(), query).then(function (queryResult) { + apiClient.getItems(apiClient.getCurrentUserId(), query).then(function (queryResult) { playItems(queryResult.Items, result.item.shuffle); }); diff --git a/dashboard-ui/voice/commands/searchcommands.js b/dashboard-ui/bower_components/emby-webcomponents/voice/commands/searchcommands.js similarity index 76% rename from dashboard-ui/voice/commands/searchcommands.js rename to dashboard-ui/bower_components/emby-webcomponents/voice/commands/searchcommands.js index 59ed4d3ea9..715114f9ca 100644 --- a/dashboard-ui/voice/commands/searchcommands.js +++ b/dashboard-ui/bower_components/emby-webcomponents/voice/commands/searchcommands.js @@ -1,4 +1,4 @@ -define([], function () { +define(['inputManager'], function (inputManager) { return function (result) { switch (result.item.deviceid) { diff --git a/dashboard-ui/bower_components/emby-webcomponents/voice/commands/showcommands.js b/dashboard-ui/bower_components/emby-webcomponents/voice/commands/showcommands.js new file mode 100644 index 0000000000..4446af9b53 --- /dev/null +++ b/dashboard-ui/bower_components/emby-webcomponents/voice/commands/showcommands.js @@ -0,0 +1,98 @@ +define(['inputManager', 'connectionManager', 'embyRouter'], function (inputManager, connectionManager, embyRouter) { + + return function (result) { + result.success = true; + switch (result.item.sourceid) { + case 'music': + inputManager.trigger('music'); + break; + case 'movies': + if (result.properties.movieName) { + + //TODO: Find a way to display movie + var query = { + Limit: 1, + UserId: result.userId, + ExcludeLocationTypes: "Virtual", + NameStartsWith: result.item.itemType + }; + + if (result.item.itemType) { + query.IncludeItemTypes = result.item.itemType; + } + + var apiClient = connectionManager.currentApiClient(); + apiClient.getItems(apiClient.getCurrentUserId(), query).then(function (queryResult) { + + if (queryResult.Items.length) { + embyRouter.showItem(queryResult.Items[0]); + } + }); + + } else { + inputManager.trigger('movies'); + } + + break; + case 'tvseries': + inputManager.trigger('tv'); + break; + case 'livetv': + var act = result.item.menuid; + if (act) { + if (act.indexOf('livetv') != -1) { + inputManager.trigger('livetv'); + } else if (act.indexOf('guide') != -1) { + inputManager.trigger('guide'); + } else if (act.indexOf('channels') != -1) { + inputManager.trigger('livetv'); + } else if (act.indexOf('recordings') != -1) { + inputManager.trigger('recordedtv'); + } else if (act.indexOf('scheduled') != -1) { + inputManager.trigger('recordedtv'); + } else if (act.indexOf('series') != -1) { + inputManager.trigger('recordedtv'); + } else { + inputManager.trigger('livetv'); + } + } else { + inputManager.trigger('livetv'); + } + break; + case 'recordings': + inputManager.trigger('recordedtv'); + break; + case 'latestepisodes': + inputManager.trigger('latestepisodes'); + case 'home': + var act = result.item.menuid; + if (act) { + if (act.indexOf('home') != -1) { + inputManager.trigger('home'); + } + else if (act.indexOf('nextup') != -1) { + inputManager.trigger('nextup'); + } + else if (act.indexOf('favorites') != -1) { + inputManager.trigger('favorites'); + } else if (act.indexOf('upcoming') != -1) { + inputManager.trigger('upcomingtv'); + } + else if (act.indexOf('nowplaying') != -1) { + inputManager.trigger('nowplaying'); + } + else { + inputManager.trigger('home'); + } + } else { + inputManager.trigger('home'); + } + case 'group': + break; + default: + result.success = false; + return; + } + + } +}); \ No newline at end of file diff --git a/dashboard-ui/voice/commands/togglecommands.js b/dashboard-ui/bower_components/emby-webcomponents/voice/commands/togglecommands.js similarity index 69% rename from dashboard-ui/voice/commands/togglecommands.js rename to dashboard-ui/bower_components/emby-webcomponents/voice/commands/togglecommands.js index 1bc588d771..9fa7382bd0 100644 --- a/dashboard-ui/voice/commands/togglecommands.js +++ b/dashboard-ui/bower_components/emby-webcomponents/voice/commands/togglecommands.js @@ -1,10 +1,10 @@ -define([], function () { +define(['inputManager'], function (inputManager) { return function (result) { result.success = true; switch (result.item.deviceid) { case 'displaymirroring': - MediaController.toggleDisplayMirroring(); + inputManager.trigger('toggledisplaymirror'); break; default: result.success = false; diff --git a/dashboard-ui/voice/grammar/en-US.json b/dashboard-ui/bower_components/emby-webcomponents/voice/grammar/en-US.json similarity index 100% rename from dashboard-ui/voice/grammar/en-US.json rename to dashboard-ui/bower_components/emby-webcomponents/voice/grammar/en-US.json diff --git a/dashboard-ui/voice/grammar/grammar.json b/dashboard-ui/bower_components/emby-webcomponents/voice/grammar/grammar.json similarity index 100% rename from dashboard-ui/voice/grammar/grammar.json rename to dashboard-ui/bower_components/emby-webcomponents/voice/grammar/grammar.json diff --git a/dashboard-ui/voice/grammarprocessor.js b/dashboard-ui/bower_components/emby-webcomponents/voice/grammarprocessor.js similarity index 100% rename from dashboard-ui/voice/grammarprocessor.js rename to dashboard-ui/bower_components/emby-webcomponents/voice/grammarprocessor.js diff --git a/dashboard-ui/voice/voice.css b/dashboard-ui/bower_components/emby-webcomponents/voice/voice.css similarity index 100% rename from dashboard-ui/voice/voice.css rename to dashboard-ui/bower_components/emby-webcomponents/voice/voice.css diff --git a/dashboard-ui/voice/voicecommands.js b/dashboard-ui/bower_components/emby-webcomponents/voice/voicecommands.js similarity index 100% rename from dashboard-ui/voice/voicecommands.js rename to dashboard-ui/bower_components/emby-webcomponents/voice/voicecommands.js diff --git a/dashboard-ui/voice/voicedialog.js b/dashboard-ui/bower_components/emby-webcomponents/voice/voicedialog.js similarity index 92% rename from dashboard-ui/voice/voicedialog.js rename to dashboard-ui/bower_components/emby-webcomponents/voice/voicedialog.js index 308b8efbfe..a7347339bc 100644 --- a/dashboard-ui/voice/voicedialog.js +++ b/dashboard-ui/bower_components/emby-webcomponents/voice/voicedialog.js @@ -1,4 +1,4 @@ -define(['dialogHelper', 'voice/voicereceiver', 'voice/voiceprocessor', 'globalize', 'emby-button', 'css!./voice.css', 'material-icons'], function (dialogHelper, voicereceiver, voiceprocessor, globalize) { +define(['dialogHelper', './voicereceiver', './voiceprocessor', 'globalize', 'emby-button', 'css!./voice.css', 'material-icons', 'css!./../formdialog'], function (dialogHelper, voicereceiver, voiceprocessor, globalize) { var lang = 'en-US'; @@ -126,7 +126,7 @@ define(['dialogHelper', 'voice/voicereceiver', 'voice/voiceprocessor', 'globaliz html += '
'; - html += '

' + globalize.translate('HeaderSaySomethingLike') + '

'; + html += '

' + globalize.translate('sharedcomponents#HeaderSaySomethingLike') + '

'; html += '
'; html += '
'; @@ -135,23 +135,23 @@ define(['dialogHelper', 'voice/voicereceiver', 'voice/voiceprocessor', 'globaliz html += '
'; html += '
'; - html += '

' + globalize.translate('HeaderYouSaid') + '

'; + html += '

' + globalize.translate('sharedcomponents#HeaderYouSaid') + '

'; html += '

'; - html += '

' + globalize.translate('MessageWeDidntRecognizeCommand') + '

'; + html += '

' + globalize.translate('sharedcomponents#MessageWeDidntRecognizeCommand') + '

'; html += '
'; html += ''; html += '

' + - globalize.translate('MessageIfYouBlockedVoice') + + globalize.translate('sharedcomponents#MessageIfYouBlockedVoice') + '

'; html += '
'; html += - ''; + ''; html += ''; html += ''; diff --git a/dashboard-ui/voice/voiceprocessor.js b/dashboard-ui/bower_components/emby-webcomponents/voice/voiceprocessor.js similarity index 78% rename from dashboard-ui/voice/voiceprocessor.js rename to dashboard-ui/bower_components/emby-webcomponents/voice/voiceprocessor.js index 5570ab2b8c..d618e813f4 100644 --- a/dashboard-ui/voice/voiceprocessor.js +++ b/dashboard-ui/bower_components/emby-webcomponents/voice/voiceprocessor.js @@ -1,4 +1,4 @@ -define(['voice/voicecommands.js', 'voice/grammarprocessor.js'], function (voicecommands, grammarprocessor) { +define(['./voicecommands.js', './grammarprocessor.js', 'require'], function (voicecommands, grammarprocessor, require) { var commandgroups; @@ -11,21 +11,11 @@ return new Promise(function (resolve, reject) { var file = "grammar"; - //if (language && language.length > 0) - // file = language; - var xhr = new XMLHttpRequest(); - xhr.open('GET', "voice/grammar/" + file + ".json", true); - - xhr.onload = function (e) { - - commandgroups = JSON.parse(this.response); + require(['text!./grammar/' + file + '.json'], function (response) { + commandgroups = JSON.parse(response); resolve(commandgroups); - } - - xhr.onerror = reject; - - xhr.send(); + }); }); } /// Process the transcript described by text. diff --git a/dashboard-ui/voice/voicereceiver.js b/dashboard-ui/bower_components/emby-webcomponents/voice/voicereceiver.js similarity index 100% rename from dashboard-ui/voice/voicereceiver.js rename to dashboard-ui/bower_components/emby-webcomponents/voice/voicereceiver.js diff --git a/dashboard-ui/bower_components/polymer/.bower.json b/dashboard-ui/bower_components/polymer/.bower.json index 36ef2ed872..5320b592cc 100644 --- a/dashboard-ui/bower_components/polymer/.bower.json +++ b/dashboard-ui/bower_components/polymer/.bower.json @@ -39,6 +39,6 @@ "commit": "8715c83bf04a228de00ec662ed43eb6141e61b91" }, "_source": "git://github.com/Polymer/polymer.git", - "_target": "^1.0.0", + "_target": "^1.1.0", "_originalSource": "Polymer/polymer" } \ No newline at end of file diff --git a/dashboard-ui/bower_components/polymer/polymer.html b/dashboard-ui/bower_components/polymer/polymer.html index ff9405c9af..3e158701bb 100644 --- a/dashboard-ui/bower_components/polymer/polymer.html +++ b/dashboard-ui/bower_components/polymer/polymer.html @@ -768,7 +768,7 @@ prevent = dy > dx; prevent = dx > dy; } if (prevent) { -//ev.preventDefault(); +ev.preventDefault(); } else { Gestures.prevent('track'); } diff --git a/dashboard-ui/components/apphost.js b/dashboard-ui/components/apphost.js index 0410a4ff24..6fc05e515b 100644 --- a/dashboard-ui/components/apphost.js +++ b/dashboard-ui/components/apphost.js @@ -75,6 +75,14 @@ define(['appStorage', 'browser'], function (appStorage, browser) { return deviceName; } + function supportsVoiceInput() { + return window.SpeechRecognition || + window.webkitSpeechRecognition || + window.mozSpeechRecognition || + window.oSpeechRecognition || + window.msSpeechRecognition; + } + var appInfo; var version = window.dashboardVersion || '3.0'; @@ -96,6 +104,12 @@ define(['appStorage', 'browser'], function (appStorage, browser) { 'sharing' ]; + features.push('externallinks'); + + if (supportsVoiceInput()) { + features.push('voiceinput'); + } + return features.indexOf(command.toLowerCase()) != -1; }, appInfo: function () { diff --git a/dashboard-ui/scripts/librarymenu.js b/dashboard-ui/scripts/librarymenu.js index fe7661e666..5eb2cfc4d0 100644 --- a/dashboard-ui/scripts/librarymenu.js +++ b/dashboard-ui/scripts/librarymenu.js @@ -140,9 +140,9 @@ } } - require(['voice/voice'], function (voice) { + require(['apphost'], function (apphost) { - if (voice.isSupported()) { + if (apphost.supports('voiceinput')) { header.querySelector('.headerVoiceButton').classList.remove('hide'); } else { header.querySelector('.headerVoiceButton').classList.add('hide'); @@ -164,8 +164,8 @@ } function showVoice() { - require(['voice/voice'], function (voice) { - voice.showDialog(); + require(['voiceDialog'], function (voiceDialog) { + voiceDialog.showDialog(); }); } diff --git a/dashboard-ui/scripts/site.js b/dashboard-ui/scripts/site.js index 66dbb6899b..ed988c16f9 100644 --- a/dashboard-ui/scripts/site.js +++ b/dashboard-ui/scripts/site.js @@ -1752,6 +1752,7 @@ var AppInfo = {}; visibleinviewport: embyWebComponentsBowerPath + "/visibleinviewport", browserdeviceprofile: embyWebComponentsBowerPath + "/browserdeviceprofile", browser: embyWebComponentsBowerPath + "/browser", + inputManager: embyWebComponentsBowerPath + "/inputmanager", qualityoptions: embyWebComponentsBowerPath + "/qualityoptions", connectservice: apiClientBowerPath + '/connectservice', hammer: bowerPath + "/hammerjs/hammer.min", @@ -1814,6 +1815,7 @@ var AppInfo = {}; define("fetchHelper", [embyWebComponentsBowerPath + "/fetchhelper"], returnFirstDependency); define("tvguide", [embyWebComponentsBowerPath + "/guide/guide", 'embyRouter'], returnFirstDependency); + define("voiceDialog", [embyWebComponentsBowerPath + "/voice/voicedialog"], returnFirstDependency); define("viewManager", [embyWebComponentsBowerPath + "/viewmanager/viewmanager"], function (viewManager) { window.ViewManager = viewManager; @@ -2006,16 +2008,6 @@ var AppInfo = {}; return Emby.Page; }); - // mock this for now. not used in this app - define("inputManager", [], function () { - return { - on: function () { - }, - off: function () { - } - }; - }); - // mock this for now. not used in this app define("playbackManager", [], function () { return { diff --git a/dashboard-ui/voice/commands/controlcommands.js b/dashboard-ui/voice/commands/controlcommands.js deleted file mode 100644 index 621bb6fde3..0000000000 --- a/dashboard-ui/voice/commands/controlcommands.js +++ /dev/null @@ -1,10 +0,0 @@ -define([], function () { - - return function (result) { - result.success = true; - if (result.properties.devicename) - MediaController.trySetActiveDeviceName(result.properties.devicename); - - return; - } -}); \ No newline at end of file diff --git a/dashboard-ui/voice/commands/showcommands.js b/dashboard-ui/voice/commands/showcommands.js deleted file mode 100644 index ebfb7dd5f9..0000000000 --- a/dashboard-ui/voice/commands/showcommands.js +++ /dev/null @@ -1,92 +0,0 @@ -define([], function () { - - return function (result) { - result.success = true; - switch (result.item.sourceid) { - case 'music': - Dashboard.navigate('music.html'); - break; - case 'movies': - if (result.properties.movieName) { - //TODO: Find a way to display movie - var query = { - - Limit: 1, - UserId: result.userId, - ExcludeLocationTypes: "Virtual" - }; - - - if (result.item.itemType) { - query.IncludeItemTypes = result.item.itemType; - } - - query.SearchTerm = result.properties.movieName; - - ApiClient.getItems(Dashboard.getCurrentUserId(), query).then(function (queryResult) { - - var s = queryResult[0]; - - }); - - } - else - Dashboard.navigate('movies.html'); - - break; - case 'tvseries': - Dashboard.navigate('tv.html'); - break; - case 'livetv': - var act = result.item.menuid; - if (act) { - if (act.indexOf('livetv') != -1) - Dashboard.navigate('livetv.html?tab=0'); - else if (act.indexOf('guide') != -1) - Dashboard.navigate('livetv.html?tab=1'); - else if (act.indexOf('channels') != -1) - Dashboard.navigate('livetv.html?tab=2'); - else if (act.indexOf('recordings') != -1) - Dashboard.navigate('livetv.html?tab=3'); - else if (act.indexOf('scheduled') != -1) - Dashboard.navigate('livetv.html?tab=4'); - else if (act.indexOf('series') != -1) - Dashboard.navigate('livetv.html?tab=5'); - else - Dashboard.navigate('livetv.html?tab=0'); - } - else - Dashboard.navigate('livetv.html?tab=0'); - break; - case 'recordings': - Dashboard.navigate('livetv.html?tab=3'); - break; - case 'latestepisodes': - Dashboard.navigate('tv.html?tab=1'); - case 'home': - var act = result.item.menuid; - if (act) { - if (act.indexOf('home') != -1) - Dashboard.navigate('index.html'); - else if (act.indexOf('nextup') != -1) - Dashboard.navigate('index.html?tab=2'); - else if (act.indexOf('favorites') != -1) - Dashboard.navigate('index.html?tab=2'); - else if (act.indexOf('upcoming') != -1) - Dashboard.navigate('index.html?tab=3'); - else if (act.indexOf('nowplaying') != -1) - Dashboard.navigate('nowplaying.html'); - else - Dashboard.navigate('index.html'); - } - else - Dashboard.navigate('index.html'); - case 'group': - break; - default: - result.success = false; - return; - } - - } -}); \ No newline at end of file diff --git a/dashboard-ui/voice/voice.js b/dashboard-ui/voice/voice.js deleted file mode 100644 index 6d38fc2684..0000000000 --- a/dashboard-ui/voice/voice.js +++ /dev/null @@ -1,28 +0,0 @@ -define([], function () { - - return { - - isSupported: function () { - - if (AppInfo.isNativeApp) { - // Crashes on some amazon devices - if (window.device && (device.platform || '').toLowerCase().indexOf('amazon') != -1) { - return false; - } - } - - return window.SpeechRecognition || - window.webkitSpeechRecognition || - window.mozSpeechRecognition || - window.oSpeechRecognition || - window.msSpeechRecognition; - }, - - showDialog: function () { - require(['voice/voicedialog'], function (voicedialog) { - voicedialog.showDialog(); - }); - } - }; - -}); \ No newline at end of file