mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
add new voice commands
This commit is contained in:
parent
ab9c6f4ac2
commit
998cbefa8a
13 changed files with 259 additions and 71 deletions
|
@ -1,16 +1,5 @@
|
|||
(function ($, window) {
|
||||
|
||||
function setMirrorModeEnabled(enabled) {
|
||||
|
||||
var val = enabled ? '1' : '0';
|
||||
|
||||
appStorage.setItem('displaymirror--' + Dashboard.getCurrentUserId(), val);
|
||||
|
||||
}
|
||||
function isMirrorModeEnabled() {
|
||||
return (appStorage.getItem('displaymirror--' + Dashboard.getCurrentUserId()) || '') != '0';
|
||||
}
|
||||
|
||||
var currentDisplayInfo;
|
||||
function mirrorItem(info) {
|
||||
|
||||
|
@ -25,9 +14,11 @@
|
|||
});
|
||||
}
|
||||
|
||||
function mirrorIfEnabled(info) {
|
||||
function mirrorIfEnabled() {
|
||||
|
||||
if (isMirrorModeEnabled()) {
|
||||
var info = currentDisplayInfo;
|
||||
|
||||
if (info && MediaController.enableDisplayMirroring()) {
|
||||
|
||||
var player = MediaController.getPlayerInfo();
|
||||
|
||||
|
@ -110,9 +101,9 @@
|
|||
|
||||
html += '<p class="fieldDescription">' + Globalize.translate('LabelAllPlaysSentToPlayer') + '</p>';
|
||||
|
||||
checkedHtml = isMirrorModeEnabled() ? ' checked="checked"' : '';
|
||||
checkedHtml = MediaController.enableDisplayMirroring() ? ' checked="checked"' : '';
|
||||
|
||||
html += '<div style="margin-top:1.5em;" class="fldMirrorMode"><label for="chkEnableMirrorMode">Enable display mirroring</label><input type="checkbox" class="chkEnableMirrorMode" id="chkEnableMirrorMode" data-mini="true"' + checkedHtml + ' /></div>';
|
||||
html += '<div style="margin-top:1.5em;" class="fldMirrorMode"><label for="chkEnableMirrorMode">' + Globalize.translate('OptionEnableDisplayMirroring') + '</label><input type="checkbox" class="chkEnableMirrorMode" id="chkEnableMirrorMode" data-mini="true"' + checkedHtml + ' /></div>';
|
||||
|
||||
html += '</form>';
|
||||
|
||||
|
@ -146,13 +137,7 @@
|
|||
$('.players', elem).html(getTargetsHtml(targets)).trigger('create');
|
||||
|
||||
$('.chkEnableMirrorMode', elem).on('change', function () {
|
||||
setMirrorModeEnabled(this.checked);
|
||||
|
||||
if (this.checked && currentDisplayInfo) {
|
||||
|
||||
mirrorItem(currentDisplayInfo);
|
||||
|
||||
}
|
||||
MediaController.enableDisplayMirroring(this.checked);
|
||||
|
||||
});
|
||||
|
||||
|
@ -182,10 +167,7 @@
|
|||
|
||||
});
|
||||
|
||||
if (currentDisplayInfo) {
|
||||
|
||||
mirrorIfEnabled(currentDisplayInfo);
|
||||
}
|
||||
mirrorIfEnabled();
|
||||
|
||||
});
|
||||
|
||||
|
@ -343,6 +325,27 @@
|
|||
});
|
||||
};
|
||||
|
||||
self.trySetActiveDeviceName = function (name) {
|
||||
|
||||
function normalizeName(t) {
|
||||
return t.toLowerCase().replace(' ', '');
|
||||
}
|
||||
|
||||
name = normalizeName(name);
|
||||
|
||||
self.getTargets().done(function (result) {
|
||||
|
||||
var target = result.filter(function (p) {
|
||||
return normalizeName(p.name) == name;
|
||||
})[0];
|
||||
|
||||
if (target) {
|
||||
self.trySetActivePlayer(target.playerName, target);
|
||||
}
|
||||
|
||||
});
|
||||
};
|
||||
|
||||
self.setDefaultPlayerActive = function () {
|
||||
|
||||
var player = self.getDefaultPlayer();
|
||||
|
@ -417,6 +420,26 @@
|
|||
});
|
||||
}
|
||||
|
||||
self.toggleDisplayMirroring = function () {
|
||||
self.enableDisplayMirroring(!self.enableDisplayMirroring());
|
||||
};
|
||||
|
||||
self.enableDisplayMirroring = function (enabled) {
|
||||
|
||||
if (enabled != null) {
|
||||
|
||||
var val = enabled ? '1' : '0';
|
||||
appStorage.setItem('displaymirror--' + Dashboard.getCurrentUserId(), val);
|
||||
|
||||
if (enabled) {
|
||||
mirrorIfEnabled();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
return (appStorage.getItem('displaymirror--' + Dashboard.getCurrentUserId()) || '') != '0';
|
||||
};
|
||||
|
||||
self.play = function (options) {
|
||||
|
||||
doWithPlaybackValidation(function () {
|
||||
|
|
|
@ -123,13 +123,6 @@
|
|||
var isVlc = AppInfo.isNativeApp && $.browser.android;
|
||||
var bitrateSetting = AppSettings.maxStreamingBitrate();
|
||||
|
||||
if (isVlc) {
|
||||
// Work around vlc 1080p stutter for now
|
||||
if ((maxHeight || 1080) >= 1080) {
|
||||
bitrateSetting = Math.min(bitrateSetting, 4000002);
|
||||
}
|
||||
}
|
||||
|
||||
var canPlayWebm = self.canPlayWebm();
|
||||
|
||||
var profile = {};
|
||||
|
|
|
@ -521,10 +521,8 @@
|
|||
|
||||
if (item && item.MediaType == 'Audio') {
|
||||
$('.buttonsRow2', page).hide();
|
||||
$('.buttonsRow3', page).hide();
|
||||
} else {
|
||||
$('.buttonsRow2', page).show();
|
||||
$('.buttonsRow3', page).show();
|
||||
}
|
||||
|
||||
var toggleRepeatButton = page.querySelector('.repeatToggleButton');
|
||||
|
@ -751,7 +749,7 @@
|
|||
|
||||
$('.requiresJqmCreate', this).trigger('create');
|
||||
|
||||
var tabs = page.querySelectorAll('paper-tabs')[0];
|
||||
var tabs = page.querySelector('paper-tabs');
|
||||
tabs.alignBottom = true;
|
||||
|
||||
LibraryBrowser.configureSwipeTabs(page, tabs, page.querySelectorAll('neon-animated-pages')[0]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue