javascript - Fullscreen is not working on Iphone 6s and 5s -
i got problem fullscreen mode on iphone 6s , 5s - not work in chrome , safari others have no idea. don not have apple devices cannot reproduce myself - reported 1 of customers. have installed mac os siera on vmware , tested project safari - fine. going install xcode, internet weak long process... work fullscreen use such stuff:
/** @namespace */ const threex = threex || {}; threex.fullscreen = threex.fullscreen || {}; export default threex.fullscreen; /** * test if possible have fullscreen * * @returns {boolean} true if fullscreen api available, false otherwise */ threex.fullscreen.available = function() { return this._haswebkitfullscreen || this._hasmozfullscreen; } /** * test if fullscreen activated * * @returns {boolean} true if fullscreen activated, false otherwise */ threex.fullscreen.activated = function() { if( this._haswebkitfullscreen ){ return document.webkitisfullscreen; }else if( this._hasmozfullscreen ){ return document.mozfullscreen; }else{ console.assert(false); } } threex.fullscreen.addeventlistener = function(element, handler) { if (element.addeventlistener) { element.addeventlistener('webkitfullscreenchange', handler, false); element.addeventlistener('mozfullscreenchange', handler, false); element.addeventlistener('fullscreenchange', handler, false); element.addeventlistener('msfullscreenchange', handler, false); } } threex.fullscreen.removeeventlistener = function(element, handler) { if (element.removeeventlistener) { element.removeeventlistener('webkitfullscreenchange', handler, false); element.removeeventlistener('mozfullscreenchange', handler, false); element.removeeventlistener('fullscreenchange', handler, false); element.removeeventlistener('msfullscreenchange', handler, false); } } function exithandler() { if (document.webkitisfullscreen || document.mozfullscreen || document.msfullscreenelement !== null) { /* run code on exit */ } } /** * request fullscreen on given element * @param {domelement} element make fullscreen. optional. default document.body */ threex.fullscreen.request = function(element) { element = element || document.body; if( this._haswebkitfullscreen ){ element.webkitrequestfullscreen(); }else if( this._hasmozfullscreen ){ element.mozrequestfullscreen(); }else{ console.assert(false); } } /** * cancel fullscreen */ threex.fullscreen.cancel = function() { if( this._haswebkitfullscreen ){ document.webkitcancelfullscreen(); }else if( this._hasmozfullscreen ){ document.mozcancelfullscreen(); }else{ console.assert(false); } } threex.fullscreen._haswebkitfullscreen = 'webkitcancelfullscreen' in document ? true : false; threex.fullscreen._hasmozfullscreen = 'mozcancelfullscreen' in document ? true : false;
the confusing thing is working device huawei honor 6 (android 4.4.2, chrome , firefox) , chrome dev tools emulation. problem? ios? why working android chrome , not ios chrome?
if see project or has iphone , can test - go http://3dflipbook.net, there jquery or wordpress plugin demos. pleasant details.
thanks in advance!
it seems found answer on question: ios safari not support fullscreen api http://caniuse.com/#feat=fullscreen. ios chrome more ios safari chrome http://www.mobilexweb.com/blog/chrome-ios-android-4-1-jelly-bean-html5.
Comments
Post a Comment