1
Fork 0
mirror of https://github.com/jech/galene.git synced 2024-11-22 16:45:58 +01:00

Make fullscreen work on Safari.

This commit is contained in:
Juliusz Chroboczek 2020-12-05 14:13:30 +01:00
parent 9bb2499b85
commit b6a6165650

View file

@ -1195,11 +1195,17 @@ function registerControlHandlers(media, container) {
let fs = getVideoButton(container, 'fullscreen'); let fs = getVideoButton(container, 'fullscreen');
if(fs) { if(fs) {
if(HTMLVideoElement.prototype.requestFullscreen) { if(HTMLVideoElement.prototype.requestFullscreen ||
/** @ts-ignore */
HTMLVideoElement.prototype.webkitRequestFullscreen) {
fs.onclick = function(e) { fs.onclick = function(e) {
e.preventDefault(); e.preventDefault();
if(media.requestFullscreen) { if(media.requestFullscreen) {
media.requestFullscreen(); media.requestFullscreen();
/** @ts-ignore */
} else if(media.webkitRequestFullscreen) {
/** @ts-ignore */
media.webkitRequestFullscreen();
} else { } else {
displayWarning('Full screen not supported!'); displayWarning('Full screen not supported!');
} }