Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How to make fullscreen view directly (HTML5)

Explorer ,
Sep 30, 2022 Sep 30, 2022

How to make fullscreen directly when I test movie in animate CC ?

I try this script, but it seems doesnt work :

//here's the code

this.on("tick", full.bind(this));

var ancs = 0

function full(e) {
fullscreen()
}

var isInFullScreen = (document.fullscreenElement && document.fullscreenElement !== null) ||
(document.webkitFullscreenElement && document.webkitFullscreenElement !== null) ||
(document.mozFullScreenElement && document.mozFullScreenElement !== null) ||
(document.msFullscreenElement && document.msFullscreenElement !== null);

var docElm = document.documentElement;

function fullscreen() {

if (!isInFullScreen) {
if (docElm.requestFullscreen) {
docElm.requestFullscreen();
} else if (docElm.mozRequestFullScreen) {
docElm.mozRequestFullScreen();
} else if (docElm.webkitRequestFullScreen) {
docElm.webkitRequestFullScreen();
} else if (docElm.msRequestFullscreen) {
docElm.msRequestFullscreen();
}

}
}

//end of code

I need some help, please...

1.0K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Sep 30, 2022 Sep 30, 2022

you can't do that. (thankfully) browsers prevent that.  you must have user interaction with a browser displayed stage.

Translate
Community Expert ,
Sep 30, 2022 Sep 30, 2022

put something on stage to click (it can have alpha = 0).

 

and you probably want to edit your publish settings to center your stage and possibly make your stage responsive and fit.  ie, test the various settings to get the effect you want.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 30, 2022 Sep 30, 2022

Hi, Kglad...

I want my project directly in fullscreen view, without any click of button. The 'tick' function seems not working.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 30, 2022 Sep 30, 2022

you can't do that. (thankfully) browsers prevent that.  you must have user interaction with a browser displayed stage.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 30, 2022 Sep 30, 2022

Oh, I didn't know browsers prevent that.

Thanks anyway... Kglad. You're the best

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 30, 2022 Sep 30, 2022
LATEST

you're welcome.

 

(and think how would you like opening some web page and finding an ad on that page caused your browser to go fullscreen and all you see is that ad until you press the esc key.)

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines