1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Merge branch 'master' into fix_long_getItems_request_URL

This commit is contained in:
dann-merlin 2023-03-10 01:31:42 +00:00 committed by GitHub
commit 7858e524eb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 28 additions and 4 deletions

View file

@ -1743,6 +1743,7 @@ class PlaybackManager {
const streamInfo = createStreamInfo(apiClient, currentItem.MediaType, currentItem, currentMediaSource, ticks, player); const streamInfo = createStreamInfo(apiClient, currentItem.MediaType, currentItem, currentMediaSource, ticks, player);
streamInfo.fullscreen = currentPlayOptions.fullscreen; streamInfo.fullscreen = currentPlayOptions.fullscreen;
streamInfo.lastMediaInfoQuery = lastMediaInfoQuery; streamInfo.lastMediaInfoQuery = lastMediaInfoQuery;
streamInfo.resetSubtitleOffset = false;
if (!streamInfo.url) { if (!streamInfo.url) {
showPlaybackInfoErrorMessage(self, 'PlaybackErrorNoCompatibleStream'); showPlaybackInfoErrorMessage(self, 'PlaybackErrorNoCompatibleStream');

View file

@ -68,7 +68,7 @@ function renderPackage(pkg, installedPlugins, page) {
if (installedPlugin) { if (installedPlugin) {
const currentVersionText = globalize.translate('MessageYouHaveVersionInstalled', '<strong>' + installedPlugin.Version + '</strong>'); const currentVersionText = globalize.translate('MessageYouHaveVersionInstalled', '<strong>' + installedPlugin.Version + '</strong>');
$('#pCurrentVersion', page).show().text(currentVersionText); $('#pCurrentVersion', page).show().html(currentVersionText);
} else { } else {
$('#pCurrentVersion', page).hide().text(''); $('#pCurrentVersion', page).hide().text('');
} }

View file

@ -382,7 +382,7 @@ function tryRemoveElement(elem) {
this.#currentTime = null; this.#currentTime = null;
this.resetSubtitleOffset(); if (options.resetSubtitleOffset !== false) this.resetSubtitleOffset();
return this.createMediaElement(options).then(elem => { return this.createMediaElement(options).then(elem => {
return this.updateVideoUrl(options).then(() => { return this.updateVideoUrl(options).then(() => {

View file

@ -50,6 +50,11 @@ const NavigationKeys = ['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown'];
*/ */
const InteractiveElements = ['INPUT', 'TEXTAREA']; const InteractiveElements = ['INPUT', 'TEXTAREA'];
/**
* Types of INPUT element for which navigation shouldn't be constrained.
*/
const NonInteractiveInputElements = ['button', 'checkbox', 'color', 'file', 'hidden', 'image', 'radio', 'reset', 'submit'];
let hasFieldKey = false; let hasFieldKey = false;
try { try {
hasFieldKey = 'key' in new KeyboardEvent('keydown'); hasFieldKey = 'key' in new KeyboardEvent('keydown');
@ -84,6 +89,24 @@ export function isNavigationKey(key) {
return NavigationKeys.indexOf(key) != -1; return NavigationKeys.indexOf(key) != -1;
} }
/**
* Returns _true_ if the element is interactive.
*
* @param {Element} element - Element.
* @return {boolean} _true_ if the element is interactive.
*/
export function isInteractiveElement(element) {
if (element && InteractiveElements.includes(element.tagName)) {
if (element.tagName === 'INPUT') {
return !NonInteractiveInputElements.includes(element.type);
}
return true;
}
return false;
}
export function enable() { export function enable() {
window.addEventListener('keydown', function (e) { window.addEventListener('keydown', function (e) {
const key = getKeyName(e); const key = getKeyName(e);
@ -97,7 +120,7 @@ export function enable() {
switch (key) { switch (key) {
case 'ArrowLeft': case 'ArrowLeft':
if (!InteractiveElements.includes(document.activeElement?.tagName)) { if (!isInteractiveElement(document.activeElement)) {
inputManager.handleCommand('left'); inputManager.handleCommand('left');
} else { } else {
capture = false; capture = false;
@ -107,7 +130,7 @@ export function enable() {
inputManager.handleCommand('up'); inputManager.handleCommand('up');
break; break;
case 'ArrowRight': case 'ArrowRight':
if (!InteractiveElements.includes(document.activeElement?.tagName)) { if (!isInteractiveElement(document.activeElement)) {
inputManager.handleCommand('right'); inputManager.handleCommand('right');
} else { } else {
capture = false; capture = false;