update airplay conditions for htmlaudioplayer
This commit is contained in:
parent
070dadbc69
commit
23158a352c
1 changed files with 4 additions and 4 deletions
|
@ -502,8 +502,8 @@ class HtmlAudioPlayer {
|
|||
setAirPlayEnabled(isEnabled) {
|
||||
const mediaElement = this._mediaElement;
|
||||
|
||||
if (document.AirPlayEnabled) {
|
||||
if (mediaElement) {
|
||||
if (mediaElement) {
|
||||
if (document.AirPlayEnabled) {
|
||||
if (isEnabled) {
|
||||
mediaElement.requestAirPlay().catch(function(err) {
|
||||
console.error('Error requesting AirPlay', err);
|
||||
|
@ -513,9 +513,9 @@ class HtmlAudioPlayer {
|
|||
console.error('Error exiting AirPlay', err);
|
||||
});
|
||||
}
|
||||
} else {
|
||||
mediaElement.webkitShowPlaybackTargetPicker();
|
||||
}
|
||||
} else {
|
||||
mediaElement.webkitShowPlaybackTargetPicker();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue