diff --git a/src/components/playback/playbackmanager.js b/src/components/playback/playbackmanager.js index ad33aa40e8..01501923f3 100644 --- a/src/components/playback/playbackmanager.js +++ b/src/components/playback/playbackmanager.js @@ -1743,6 +1743,7 @@ class PlaybackManager { const streamInfo = createStreamInfo(apiClient, currentItem.MediaType, currentItem, currentMediaSource, ticks, player); streamInfo.fullscreen = currentPlayOptions.fullscreen; streamInfo.lastMediaInfoQuery = lastMediaInfoQuery; + streamInfo.resetSubtitleOffset = false; if (!streamInfo.url) { showPlaybackInfoErrorMessage(self, 'PlaybackErrorNoCompatibleStream'); diff --git a/src/controllers/dashboard/plugins/add/index.js b/src/controllers/dashboard/plugins/add/index.js index 5e0a2d3f14..150fe3e1fd 100644 --- a/src/controllers/dashboard/plugins/add/index.js +++ b/src/controllers/dashboard/plugins/add/index.js @@ -68,7 +68,7 @@ function renderPackage(pkg, installedPlugins, page) { if (installedPlugin) { const currentVersionText = globalize.translate('MessageYouHaveVersionInstalled', '' + installedPlugin.Version + ''); - $('#pCurrentVersion', page).show().text(currentVersionText); + $('#pCurrentVersion', page).show().html(currentVersionText); } else { $('#pCurrentVersion', page).hide().text(''); } diff --git a/src/plugins/htmlVideoPlayer/plugin.js b/src/plugins/htmlVideoPlayer/plugin.js index 2582785f8e..a4f512768f 100644 --- a/src/plugins/htmlVideoPlayer/plugin.js +++ b/src/plugins/htmlVideoPlayer/plugin.js @@ -382,7 +382,7 @@ function tryRemoveElement(elem) { this.#currentTime = null; - this.resetSubtitleOffset(); + if (options.resetSubtitleOffset !== false) this.resetSubtitleOffset(); return this.createMediaElement(options).then(elem => { return this.updateVideoUrl(options).then(() => { diff --git a/src/scripts/keyboardNavigation.js b/src/scripts/keyboardNavigation.js index feef180630..39c187479d 100644 --- a/src/scripts/keyboardNavigation.js +++ b/src/scripts/keyboardNavigation.js @@ -50,6 +50,11 @@ const NavigationKeys = ['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown']; */ 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; try { hasFieldKey = 'key' in new KeyboardEvent('keydown'); @@ -84,6 +89,24 @@ export function isNavigationKey(key) { 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() { window.addEventListener('keydown', function (e) { const key = getKeyName(e); @@ -97,7 +120,7 @@ export function enable() { switch (key) { case 'ArrowLeft': - if (!InteractiveElements.includes(document.activeElement?.tagName)) { + if (!isInteractiveElement(document.activeElement)) { inputManager.handleCommand('left'); } else { capture = false; @@ -107,7 +130,7 @@ export function enable() { inputManager.handleCommand('up'); break; case 'ArrowRight': - if (!InteractiveElements.includes(document.activeElement?.tagName)) { + if (!isInteractiveElement(document.activeElement)) { inputManager.handleCommand('right'); } else { capture = false;