Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS exit fullscreen API

I'm trying to force exit fullscreen video, when the movie is done. Nothing seems to work for iPad iOS.

video[0].onended = function() {
  video[0].pause();
  video[0].currentTime = 0;
  if ($('body').hasClass('fullscreen_mode')) {
    var exitFullScreen = document.exitFullscreen || document.msExitFullscreen || document.mozCancelFullScreen || document.webkitExitFullscreen;
    exitFullScreen.call(document);
    $('body').removeClass('fullscreen_mode');
  }
}
like image 386
user2587454 Avatar asked Feb 03 '26 11:02

user2587454


1 Answers

Fullscreen API does not work on iOS. That means the user will have to use the native controls to exit a fullscreen video.

Someone has a more complete reply herE: https://stackoverflow.com/a/50832682/2114953

Also, CanIUse shows the compatibility chart for Fullscreen API and iOS is all red: https://caniuse.com/#feat=fullscreen

like image 161
Manuel Cheța Avatar answered Feb 06 '26 00:02

Manuel Cheța