mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-17 19:08:18 -07:00
add fullscreen button
This commit is contained in:
parent
5516e8b168
commit
fa50a882d3
@ -38,5 +38,14 @@ define([], function () {
|
||||
return document.fullscreen || document.mozFullScreen || document.webkitIsFullScreen || document.msFullscreenElement ? true : false;
|
||||
};
|
||||
|
||||
fullscreenManager.prototype.toggleFullscreen = function () {
|
||||
|
||||
if (this.isFullScreen()) {
|
||||
this.exitFullscreen();
|
||||
} else {
|
||||
this.requestFullscreen();
|
||||
}
|
||||
};
|
||||
|
||||
return new fullscreenManager();
|
||||
});
|
@ -1,4 +1,4 @@
|
||||
define(['playbackManager', 'dom', 'inputmanager', 'datetime', 'itemHelper', 'mediaInfo', 'focusManager', 'imageLoader', 'scrollHelper', 'events', 'connectionManager', 'browser', 'globalize', 'apphost', 'scrollStyles', 'emby-slider'], function (playbackManager, dom, inputManager, datetime, itemHelper, mediaInfo, focusManager, imageLoader, scrollHelper, events, connectionManager, browser, globalize, appHost) {
|
||||
define(['playbackManager', 'dom', 'inputmanager', 'datetime', 'itemHelper', 'mediaInfo', 'focusManager', 'imageLoader', 'scrollHelper', 'events', 'connectionManager', 'browser', 'globalize', 'apphost', 'fullscreenManager', 'scrollStyles', 'emby-slider'], function (playbackManager, dom, inputManager, datetime, itemHelper, mediaInfo, focusManager, imageLoader, scrollHelper, events, connectionManager, browser, globalize, appHost, fullscreenManager) {
|
||||
'use strict';
|
||||
|
||||
function seriesImageUrl(item, options) {
|
||||
@ -378,6 +378,14 @@
|
||||
}
|
||||
}
|
||||
|
||||
function updateFullscreenIcon() {
|
||||
if (fullscreenManager.isFullScreen()) {
|
||||
view.querySelector('.btnFullscreen i').innerHTML = '';
|
||||
} else {
|
||||
view.querySelector('.btnFullscreen i').innerHTML = '';
|
||||
}
|
||||
}
|
||||
|
||||
view.addEventListener('viewbeforeshow', function (e) {
|
||||
|
||||
getHeaderElement().classList.add('osdHeader');
|
||||
@ -395,6 +403,7 @@
|
||||
showOsd();
|
||||
|
||||
inputManager.on(window, onInputCommand);
|
||||
updateFullscreenIcon();
|
||||
});
|
||||
|
||||
view.addEventListener('viewbeforehide', function () {
|
||||
@ -412,6 +421,10 @@
|
||||
view.querySelector('.btnCast').classList.remove('hide');
|
||||
}
|
||||
|
||||
if (appHost.supports('fullscreenchange')) {
|
||||
view.querySelector('.btnFullscreen').classList.remove('hide');
|
||||
}
|
||||
|
||||
view.querySelector('.btnCast').addEventListener('click', function () {
|
||||
var btn = this;
|
||||
require(['playerSelectionMenu'], function (playerSelectionMenu) {
|
||||
@ -419,6 +432,10 @@
|
||||
});
|
||||
});
|
||||
|
||||
view.querySelector('.btnFullscreen').addEventListener('click', function () {
|
||||
fullscreenManager.toggleFullscreen();
|
||||
});
|
||||
|
||||
view.querySelector('.btnSettings').addEventListener('click', onSettingsButtonClick);
|
||||
|
||||
function onPlayerChange() {
|
||||
|
@ -210,6 +210,9 @@
|
||||
<button is="paper-icon-button-light" class="btnSettings hide autoSize">
|
||||
<i class="largePaperIconButton md-icon"></i>
|
||||
</button>
|
||||
<button is="paper-icon-button-light" class="btnFullscreen hide autoSize">
|
||||
<i class="xlargePaperIconButton md-icon"></i>
|
||||
</button>
|
||||
|
||||
<div class="osdTimeText"><span class="osdPositionText"></span><span class="osdDurationText"></span><span class="endsAtText"></span></div>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user