Remove legacy Windows UWP app global

This commit is contained in:
Bill Thornton committed 2026-09-23 11:20:36 -04:00
1 parent dfe1d47e2f
commit aae78f742a
4 files changed
+4 -56

No files matched your search

-1
View File
@@ -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',
-18
View File
@@ -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 = '';
+2 -5
View File
@@ -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);
});
}
+2 -32
View File
@@ -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');
}