toggle fullscreen via more-button

This commit is contained in:
Jan-Christoph Borchardt 2016-09-21 20:02:18 +02:00
Родитель 675649a938
Коммит c606751fb2
2 изменённых файлов: 43 добавлений и 0 удалений

Просмотреть файл

@ -84,3 +84,19 @@ video {
.nameIndicator button.video-disabled {
opacity: .5;
}
#app-content:-webkit-full-screen {
width: 100%;
}
#app-content:-moz-full-screen {
width: 100%;
}
#app-content:-ms-fullscreen {
width: 100%;
}
#app-content:full-screen {
width: 100%;
}
#app-content:fullscreen {
width: 100%;
}

Просмотреть файл

@ -47,6 +47,33 @@ $(window).load(function() {
}
});
$('#video-more').click(function() {
var fullscreenElem = document.getElementById('app-content');
if (!document.fullscreenElement && !document.mozFullScreenElement &&
!document.webkitFullscreenElement && !document.msFullscreenElement) {
if (fullscreenElem.requestFullscreen) {
fullscreenElem.requestFullscreen();
} else if (fullscreenElem.webkitRequestFullscreen) {
fullscreenElem.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);
} else if (fullscreenElem.mozRequestFullScreen) {
fullscreenElem.mozRequestFullScreen();
} else if (fullscreenElem.msRequestFullscreen) {
fullscreenElem.msRequestFullscreen();
}
} else {
if (document.exitFullscreen) {
document.exitFullscreen();
} else if (document.webkitExitFullscreen) {
document.webkitExitFullscreen();
} else if (document.mozCancelFullScreen) {
document.mozCancelFullScreen();
} else if (document.msExitFullscreen) {
document.msExitFullscreen();
}
}
});
// If the hash changes a room gets joined
$(window).on('hashchange', function() {
OCA.SpreedMe.Rooms.join(window.location.hash.substring(1));