iandevlin.github.io icon indicating copy to clipboard operation
iandevlin.github.io copied to clipboard

Switch fullscreen iOS

Open bertyhell opened this issue 8 years ago • 1 comments

I found a way to switch between inline and fullscreen video on iOS since they added a playsinline attribute to safari mobile from iOS 10 and up.

https://webkit.org/blog/6784/new-video-policies-for-ios/

The video would have these attributes:

<video playsinline webkit-playsinline></video>

When clicking the fullscreen button on iOS you would:

vid.removeAttribute('playsinline');
vid.removeAttribute('webkit-playsinline');
vid.play();

Then when you detect the fullscreen closing:

document.addEventListener('fullscreenchange', function() {
  if (!isFullScreen ()) {
    vid.setAttribute('playsinline', '');
    vid.setAttribute('webkit-playsinline', '');
  }
}

ios-video-fullscreen

bertyhell avatar Jan 19 '17 10:01 bertyhell

I am so sorry, I didn't see this issue until now, many months later, my apologies. Thanks for the information.

iandevlin avatar Nov 02 '17 08:11 iandevlin