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

Merge branch 'jellyfin:master' into cast-with-localhost-server

This commit is contained in:
Sky High 2023-09-10 20:28:15 +02:00 committed by GitHub
commit 61a6d6e8f0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
56 changed files with 1079 additions and 370 deletions

View file

@ -1,6 +1,7 @@
import ServerConnections from '../../components/ServerConnections';
import { PluginType } from '../../types/plugin.ts';
import * as userSettings from '../../scripts/settings/userSettings';
class BackdropScreensaver {
constructor() {
@ -29,7 +30,10 @@ class BackdropScreensaver {
const newSlideShow = new Slideshow({
showTitle: true,
cover: true,
items: result.Items
items: result.Items,
autoplay: {
delay: userSettings.backdropScreensaverInterval() * 1000
}
});
newSlideShow.show();

View file

@ -379,6 +379,10 @@ class HtmlAudioPlayer {
return getDefaultProfile();
}
toggleAirPlay() {
return this.setAirPlayEnabled(!this.isAirPlayEnabled());
}
// Save this for when playback stops, because querying the time at that point might return 0
currentTime(val) {
const mediaElement = this._mediaElement;
@ -520,6 +524,33 @@ class HtmlAudioPlayer {
return false;
}
isAirPlayEnabled() {
if (document.AirPlayEnabled) {
return !!document.AirplayElement;
}
return false;
}
setAirPlayEnabled(isEnabled) {
const mediaElement = this._mediaElement;
if (mediaElement) {
if (document.AirPlayEnabled) {
if (isEnabled) {
mediaElement.requestAirPlay().catch(function(err) {
console.error('Error requesting AirPlay', err);
});
} else {
document.exitAirPLay().catch(function(err) {
console.error('Error exiting AirPlay', err);
});
}
} else {
mediaElement.webkitShowPlaybackTargetPicker();
}
}
}
supports(feature) {
if (!supportedFeatures) {
supportedFeatures = getSupportedFeatures();
@ -539,6 +570,10 @@ function getSupportedFeatures() {
list.push('PlaybackRate');
}
if (browser.safari) {
list.push('AirPlay');
}
return list;
}