mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
enable airplay for audioplayer
This commit is contained in:
parent
6fd2a606d8
commit
f3b84cadad
2 changed files with 51 additions and 0 deletions
|
@ -32,6 +32,7 @@ import { appRouter } from '../appRouter';
|
|||
let volumeSliderContainer;
|
||||
let playPauseButtons;
|
||||
let positionSlider;
|
||||
let toggleAirPlayButton;
|
||||
let toggleRepeatButton;
|
||||
let toggleRepeatButtonIcon;
|
||||
|
||||
|
@ -80,6 +81,8 @@ import { appRouter } from '../appRouter';
|
|||
html += '<input type="range" is="emby-slider" pin step="1" min="0" max="100" value="0" class="slider-medium-thumb nowPlayingBarVolumeSlider"/>';
|
||||
html += '</div>';
|
||||
|
||||
html += '<button is="paper-icon-button-light" class="btnAirPlay mediaButton"><span class="material-icons airplay" aria-hidden="true"></span></button>';
|
||||
|
||||
html += '<button is="paper-icon-button-light" class="toggleRepeatButton mediaButton"><span class="material-icons repeat" aria-hidden="true"></span></button>';
|
||||
html += '<button is="paper-icon-button-light" class="btnShuffleQueue mediaButton"><span class="material-icons shuffle" aria-hidden="true"></span></button>';
|
||||
|
||||
|
@ -190,6 +193,13 @@ import { appRouter } from '../appRouter';
|
|||
}
|
||||
});
|
||||
|
||||
toggleAirPlayButton = elem.querySelector('.btnAirPlay');
|
||||
toggleAirPlayButton.addEventListener('click', function () {
|
||||
if (currentPlayer) {
|
||||
playbackManager.toggleAirPlay(currentPlayer);
|
||||
}
|
||||
});
|
||||
|
||||
elem.querySelector('.btnShuffleQueue').addEventListener('click', function () {
|
||||
if (currentPlayer) {
|
||||
playbackManager.toggleQueueShuffleMode();
|
||||
|
@ -326,6 +336,12 @@ import { appRouter } from '../appRouter';
|
|||
toggleRepeatButton.classList.remove('hide');
|
||||
}
|
||||
|
||||
if (supportedCommands.indexOf('AirPlay') === -1) {
|
||||
toggleAirPlayButton.classList.add('hide');
|
||||
} else {
|
||||
toggleAirPlayButton.classList.remove('hide');
|
||||
}
|
||||
|
||||
updateRepeatModeDisplay(playbackManager.getRepeatMode());
|
||||
onQueueShuffleModeChange();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue