mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Add initial AirPlay support (#659)
This commit is contained in:
parent
86bf6ab8d2
commit
21066f06f0
4 changed files with 53 additions and 0 deletions
|
@ -1523,6 +1523,10 @@ define(['browser', 'require', 'events', 'apphost', 'loading', 'dom', 'playbackMa
|
|||
}
|
||||
}
|
||||
|
||||
if (browser.safari || browser.iOS || browser.iPad) {
|
||||
list.push('AirPlay')
|
||||
}
|
||||
|
||||
list.push('SetBrightness');
|
||||
list.push("SetAspectRatio")
|
||||
|
||||
|
@ -1631,6 +1635,31 @@ define(['browser', 'require', 'events', 'apphost', 'loading', 'dom', 'playbackMa
|
|||
return false;
|
||||
};
|
||||
|
||||
HtmlVideoPlayer.prototype.isAirPlayEnabled = function () {
|
||||
|
||||
if (document.AirPlayEnabled) {
|
||||
return document.AirplayElement ? true : false;
|
||||
}
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
HtmlVideoPlayer.prototype.setAirPlayEnabled = function (isEnabled) {
|
||||
var video = this._mediaElement;
|
||||
|
||||
if (document.AirPlayEnabled) {
|
||||
if (video) {
|
||||
if (isEnabled) {
|
||||
video.requestAirPlay().catch(onAirPlayError);
|
||||
} else {
|
||||
document.exitAirPLay().catch(onAirPlayError);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
video.webkitShowPlaybackTargetPicker();
|
||||
}
|
||||
};
|
||||
|
||||
HtmlVideoPlayer.prototype.setBrightness = function (val) {
|
||||
|
||||
var elem = this._mediaElement;
|
||||
|
@ -1784,6 +1813,10 @@ define(['browser', 'require', 'events', 'apphost', 'loading', 'dom', 'playbackMa
|
|||
return this.setPictureInPictureEnabled(!this.isPictureInPictureEnabled());
|
||||
};
|
||||
|
||||
HtmlVideoPlayer.prototype.toggleAirPlay = function () {
|
||||
return this.setAirPlayEnabled(!this.isAirPlayEnabled());
|
||||
};
|
||||
|
||||
HtmlVideoPlayer.prototype.getBufferedRanges = function () {
|
||||
var mediaElement = this._mediaElement;
|
||||
if (mediaElement) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue