Commit b6a61656 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Make fullscreen work on Safari.

parent 9bb2499b
...@@ -1195,11 +1195,17 @@ function registerControlHandlers(media, container) { ...@@ -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!');
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment