2020-07-26 22:45:00 +02:00
|
|
|
// TODO: This seems like a good candidate for deprecation
|
|
|
|
export default {
|
2020-07-28 23:54:27 +02:00
|
|
|
enableFullscreen: function() {
|
2021-05-04 17:35:38 -04:00
|
|
|
if (window.NativeShell?.enableFullscreen) {
|
2021-04-10 21:53:32 -04:00
|
|
|
window.NativeShell.enableFullscreen();
|
|
|
|
}
|
2020-07-28 23:54:27 +02:00
|
|
|
},
|
|
|
|
disableFullscreen: function() {
|
2021-05-04 17:35:38 -04:00
|
|
|
if (window.NativeShell?.disableFullscreen) {
|
2021-04-10 21:53:32 -04:00
|
|
|
window.NativeShell.disableFullscreen();
|
|
|
|
}
|
2020-07-28 23:54:27 +02:00
|
|
|
},
|
|
|
|
openUrl: function(url, target) {
|
2021-05-04 17:35:38 -04:00
|
|
|
if (window.NativeShell?.openUrl) {
|
2020-07-26 22:45:00 +02:00
|
|
|
window.NativeShell.openUrl(url, target);
|
|
|
|
} else {
|
|
|
|
window.open(url, target || '_blank');
|
|
|
|
}
|
|
|
|
},
|
2020-07-28 23:54:27 +02:00
|
|
|
updateMediaSession(mediaInfo) {
|
2021-05-04 17:35:38 -04:00
|
|
|
if (window.NativeShell?.updateMediaSession) {
|
2021-04-10 21:53:32 -04:00
|
|
|
window.NativeShell.updateMediaSession(mediaInfo);
|
|
|
|
}
|
2020-07-28 23:54:27 +02:00
|
|
|
},
|
|
|
|
hideMediaSession() {
|
2021-05-04 17:35:38 -04:00
|
|
|
if (window.NativeShell?.hideMediaSession) {
|
2021-04-10 21:53:32 -04:00
|
|
|
window.NativeShell.hideMediaSession();
|
|
|
|
}
|
2020-07-28 23:54:27 +02:00
|
|
|
},
|
|
|
|
/**
|
|
|
|
* Notify the NativeShell about volume level changes.
|
|
|
|
* Useful for e.g. remote playback.
|
|
|
|
*/
|
|
|
|
updateVolumeLevel(volume) {
|
2021-05-04 17:35:38 -04:00
|
|
|
if (window.NativeShell?.updateVolumeLevel) {
|
2021-04-10 21:53:32 -04:00
|
|
|
window.NativeShell.updateVolumeLevel(volume);
|
|
|
|
}
|
2020-07-26 22:45:00 +02:00
|
|
|
},
|
2020-07-28 23:54:27 +02:00
|
|
|
/**
|
|
|
|
* Download specified files with NativeShell if possible
|
|
|
|
*
|
|
|
|
* @returns true on success
|
|
|
|
*/
|
|
|
|
downloadFiles(items) {
|
2021-05-04 17:35:38 -04:00
|
|
|
if (window.NativeShell?.downloadFile) {
|
2022-10-11 01:37:33 -04:00
|
|
|
items.forEach(item => {
|
|
|
|
window.NativeShell.downloadFile(item);
|
|
|
|
});
|
2020-07-28 23:54:27 +02:00
|
|
|
return true;
|
2018-10-23 01:05:09 +03:00
|
|
|
}
|
2020-07-28 23:54:27 +02:00
|
|
|
return false;
|
2020-07-26 22:45:00 +02:00
|
|
|
}
|
|
|
|
};
|