Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #16785 > unrolled thread

How to detect fullscreen

Started by"jmrw" <jmrw@free.fr>
First post2012-10-22 08:24 +0200
Last post2012-10-25 00:16 +0200
Articles 4 — 4 participants

Back to article view | Back to comp.lang.javascript


Contents

  How to detect fullscreen "jmrw" <jmrw@free.fr> - 2012-10-22 08:24 +0200
    Re: How to detect fullscreen dann90038@gmail.com - 2012-10-22 13:53 -0700
    Re: How to detect fullscreen "J.R." <groups_jr-1@yahoo.com.br> - 2012-10-22 19:21 -0200
      Re: How to detect fullscreen SAM <stephanemoriaux.NoAdmin@wanadoo.fr.invalid> - 2012-10-25 00:16 +0200

#16785 — How to detect fullscreen

From"jmrw" <jmrw@free.fr>
Date2012-10-22 08:24 +0200
SubjectHow to detect fullscreen
Message-ID<5084e67d$0$16468$426a74cc@news.free.fr>
For my slideshow
http://www.jmrw.com/France/Strasbourg/diaporama/index.htm

I want the picture centered when fullscreen is used.
Is there a way to detect fullscreen?

thanks

jmrw 

[toc] | [next] | [standalone]


#16805

Fromdann90038@gmail.com
Date2012-10-22 13:53 -0700
Message-ID<c7d25952-fbab-492e-9d4d-d90905ef5899@googlegroups.com>
In reply to#16785
No need to check for fullscreen I'd think, you're judging it looks off on fullscreen from 'your' monitor/screen, it looks off for me fullscreen or not.  Anyhow,  your query I guess should have been for comp.infosystems.www.authoring.stylesheets, not here :)

check -> http://www.webdevout.net/test?01-&raw

More of a CSS matter than a js one :)

[toc] | [prev] | [next] | [standalone]


#16807

From"J.R." <groups_jr-1@yahoo.com.br>
Date2012-10-22 19:21 -0200
Message-ID<k64ddh$mm8$1@speranza.aioe.org>
In reply to#16785
On 22/10/2012 04:24, jmrw wrote:
> For my slideshow
> http://www.jmrw.com/France/Strasbourg/diaporama/index.htm
>
> I want the picture centered when fullscreen is used.
> Is there a way to detect fullscreen?

There is an experimental technology in Firefox for detecting if an 
element is in full screen mode:
<https://developer.mozilla.org/en-US/docs/DOM/document.mozFullScreenElement>

You may test in FF / Chrome console something like:

if (document.mozFullScreenElement) { // FF
   console.log('Your video is playing in fullscreen');
}

or if (document.webkitFullscreenElement) { // Chrome and Safari ? }

--
Joao Rodrigues (J.R.)

[toc] | [prev] | [next] | [standalone]


#16843

FromSAM <stephanemoriaux.NoAdmin@wanadoo.fr.invalid>
Date2012-10-25 00:16 +0200
Message-ID<508868ba$0$21234$ba4acef3@reader.news.orange.fr>
In reply to#16807
Le 22/10/12 23:21, J.R. a écrit :
> On 22/10/2012 04:24, jmrw wrote:
>> For my slideshow
>> http://www.jmrw.com/France/Strasbourg/diaporama/index.htm
>>
>> I want the picture centered when fullscreen is used.
>> Is there a way to detect fullscreen?
>
> There is an experimental technology in Firefox for detecting if an
> element is in full screen mode:
> <https://developer.mozilla.org/en-US/docs/DOM/document.mozFullScreenElement>

Ha ! Oui, super ! Je ne savais pas que ça existait.

I've found on the net a function to fullscreen and reverse with Moz, 
webkit and IE.
If somebody could make it shorter ?
Or at least tell me if that really works with IE ?

function toggleFullScreen() {
  if ( (document.fullScreenElement &&
       document.fullScreenElement !== null) ||
       // alternative standard method
       (!document.mozFullScreenElement &&
        !document.webkitFullScreenElement)) {  // current working methods
     if (document.documentElement.requestFullScreen) {
       	document.documentElement.requestFullScreen();
     	}
     else if (document.documentElement.mozRequestFullScreen) {
       	document.documentElement.mozRequestFullScreen();
     	}
     else if (document.documentElement.webkitRequestFullScreen) {
 
document.documentElement.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT);
     	}
   	else if(typeof window.ActiveXObject!="undefined") {
		// for Internet Explorer
		var wscript = new ActiveXObject("WScript.Shell");
		if (wscript!=null) { wscript.SendKeys("{F11}"); }
		}
   	}
   	else {
     if (document.cancelFullScreen) {
       	document.cancelFullScreen();
     	}
     else if (document.mozCancelFullScreen) {
       	document.mozCancelFullScreen();
     	}
     else if (document.webkitCancelFullScreen) {
       	document.webkitCancelFullScreen();
     	}
   	else if(typeof window.ActiveXObject!="undefined") {
		// for Internet Explorer
		var wscript = new ActiveXObject("WScript.Shell");
		if (wscript!=null) { wscript.SendKeys("{F11}"); }
		}
   	}
}

-- 
Stéphane Moriaux avec/with iMac-intel

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.javascript


csiph-web