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

update airplay conditions for htmlaudioplayer

This commit is contained in:
Georgi Stamatov 2023-06-17 13:18:13 +03:00
parent 070dadbc69
commit 23158a352c

View file

@ -502,8 +502,8 @@ class HtmlAudioPlayer {
setAirPlayEnabled(isEnabled) { setAirPlayEnabled(isEnabled) {
const mediaElement = this._mediaElement; const mediaElement = this._mediaElement;
if (document.AirPlayEnabled) {
if (mediaElement) { if (mediaElement) {
if (document.AirPlayEnabled) {
if (isEnabled) { if (isEnabled) {
mediaElement.requestAirPlay().catch(function(err) { mediaElement.requestAirPlay().catch(function(err) {
console.error('Error requesting AirPlay', err); console.error('Error requesting AirPlay', err);
@ -513,11 +513,11 @@ class HtmlAudioPlayer {
console.error('Error exiting AirPlay', err); console.error('Error exiting AirPlay', err);
}); });
} }
}
} else { } else {
mediaElement.webkitShowPlaybackTargetPicker(); mediaElement.webkitShowPlaybackTargetPicker();
} }
} }
}
supports(feature) { supports(feature) {
if (!supportedFeatures) { if (!supportedFeatures) {