diff --git a/eslint.config.mjs b/eslint.config.mjs index 6aec0e4e91..1f3a5a1489 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -224,7 +224,6 @@ export default tseslint.config( 'Emby': 'readonly', 'Hls': 'readonly', 'LibraryMenu': 'readonly', - 'Windows': 'readonly', // Build time definitions __COMMIT_SHA__: 'readonly', __JF_BUILD_VERSION__: 'readonly', diff --git a/src/components/htmlMediaHelper.js b/src/components/htmlMediaHelper.js index bcdc285bbf..fe7e74a169 100644 --- a/src/components/htmlMediaHelper.js +++ b/src/components/htmlMediaHelper.js @@ -167,24 +167,6 @@ export function seekOnPlaybackStart(instance, element, ticks, onMediaReady) { } } -export function applySrc(elem, src, options) { - if (window.Windows && options.mediaSource?.IsLocal) { - return Windows.Storage.StorageFile.getFileFromPathAsync(options.url).then(function (file) { - const playlist = new Windows.Media.Playback.MediaPlaybackList(); - - const source1 = Windows.Media.Core.MediaSource.createFromStorageFile(file); - const startTime = (options.playerStartPositionTicks || 0) / 10000; - playlist.items.append(new Windows.Media.Playback.MediaPlaybackItem(source1, startTime)); - elem.src = URL.createObjectURL(playlist, { oneTimeOnly: true }); - return Promise.resolve(); - }); - } else { - elem.src = src; - } - - return Promise.resolve(); -} - export function resetSrc(elem) { elem.src = ''; elem.innerHTML = ''; diff --git a/src/plugins/htmlAudioPlayer/plugin.js b/src/plugins/htmlAudioPlayer/plugin.js index 53a80de2b4..cceb602127 100644 --- a/src/plugins/htmlAudioPlayer/plugin.js +++ b/src/plugins/htmlAudioPlayer/plugin.js @@ -204,11 +204,8 @@ class HtmlAudioPlayer { elem.crossOrigin = 'use-credentials'; } - return htmlMediaHelper.applySrc(elem, val, options).then(function () { - self._currentSrc = val; - - return htmlMediaHelper.playWithPromise(elem, onError); - }); + elem.src = val; + return htmlMediaHelper.playWithPromise(elem, onError); }); } diff --git a/src/plugins/htmlVideoPlayer/plugin.js b/src/plugins/htmlVideoPlayer/plugin.js index 4a5951b47b..a7cb2917b8 100644 --- a/src/plugins/htmlVideoPlayer/plugin.js +++ b/src/plugins/htmlVideoPlayer/plugin.js @@ -24,7 +24,6 @@ import { destroyCastPlayer, getCrossOriginValue, enableHlsJsPlayerForCodecs, - applySrc, resetSrc, playWithPromise, onEndedInternal, @@ -657,11 +656,8 @@ export class HtmlVideoPlayer { elem.crossOrigin = 'use-credentials'; } - return applySrc(elem, val, options).then(() => { - this.#currentSrc = val; - - return playWithPromise(elem, this.onError); - }); + elem.src = val; + return playWithPromise(elem, this.onError); } } @@ -1323,25 +1319,10 @@ export class HtmlVideoPlayer { this.#currentBitmapSubRenderer = null; } - /** - * @private - */ - fetchSubtitlesUwp(track) { - return Windows.Storage.StorageFile.getFileFromPathAsync(track.Path).then(function (storageFile) { - return Windows.Storage.FileIO.readTextAsync(storageFile); - }).then(function (text) { - return JSON.parse(text); - }); - } - /** * @private */ async fetchSubtitles(track, item) { - if (window.Windows && itemHelper.isLocalItem(item)) { - return this.fetchSubtitlesUwp(track, item); - } - this.incrementFetchQueue(); try { const response = await fetch(getTextTrackUrl(track, item, '.js')); @@ -1950,10 +1931,6 @@ export class HtmlVideoPlayer { if ( // Check non-standard Safari PiP support typeof video.webkitSupportsPresentationMode === 'function' && video.webkitSupportsPresentationMode('picture-in-picture') && typeof video.webkitSetPresentationMode === 'function' - // Check non-standard Windows PiP support - || (window.Windows - && Windows.UI.ViewManagement.ApplicationView.getForCurrentView() - .isViewModeSupported(Windows.UI.ViewManagement.ApplicationViewMode.compactOverlay)) // Check standard PiP support || document.pictureInPictureEnabled ) { @@ -2037,13 +2014,6 @@ export class HtmlVideoPlayer { document.exitPictureInPicture().catch(HtmlVideoPlayer.onPictureInPictureError); } } - } else if (window.Windows) { - this.isPip = isEnabled; - if (isEnabled) { - Windows.UI.ViewManagement.ApplicationView.getForCurrentView().tryEnterViewModeAsync(Windows.UI.ViewManagement.ApplicationViewMode.compactOverlay); - } else { - Windows.UI.ViewManagement.ApplicationView.getForCurrentView().tryEnterViewModeAsync(Windows.UI.ViewManagement.ApplicationViewMode.default); - } } else if (video?.webkitSupportsPresentationMode && typeof video.webkitSetPresentationMode === 'function') { video.webkitSetPresentationMode(isEnabled ? 'picture-in-picture' : 'inline'); }