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

42 lines
1.1 KiB
JavaScript
Raw Normal View History

// TODO: This seems like a good candidate for deprecation
export default {
enableFullscreen: function() {
window.NativeShell?.enableFullscreen();
},
disableFullscreen: function() {
window.NativeShell?.disableFullscreen();
},
openUrl: function(url, target) {
if (window.NativeShell) {
window.NativeShell.openUrl(url, target);
} else {
window.open(url, target || '_blank');
}
},
updateMediaSession(mediaInfo) {
window.NativeShell?.updateMediaSession(mediaInfo);
},
hideMediaSession() {
window.NativeShell?.hideMediaSession();
},
/**
* Notify the NativeShell about volume level changes.
* Useful for e.g. remote playback.
*/
updateVolumeLevel(volume) {
window.NativeShell?.updateVolumeLevel(volume);
},
/**
* Download specified files with NativeShell if possible
*
* @returns true on success
*/
downloadFiles(items) {
if (window.NativeShell) {
2020-12-12 00:57:26 -05:00
items.forEach(item => window.NativeShell.downloadFile(item));
return true;
2018-10-23 01:05:09 +03:00
}
return false;
}
};