Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by yosh · Aug 24, 2011 at 06:43 AM · fullscreenhtmlcommunication

Webplayer: Switch to fullscreen via HTML-Button?

Hi,

any known workarounds so i can switch the unity content to fullscreen when i press a HTML Button? When i pressed, i want to call a javascript function that communicates via "GetUnity.SendMessage("GameObject, "StringHTML", "test");

In that "StringHTML"-function there´s my fullscreen switch function: Screen.SetResolution(1024, 768, true);

When i call this function from a unity gui button, the screen switches to fullscreen. When press the html-button, any guitext in the unity content gets updated but the "SetResolution" doesn´t switch to fullscreen.

Any ideas how to force that? Thanks for your time...

Comment
Add comment · Show 5
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image tomekkie2 · Aug 24, 2011 at 09:23 AM 1
Share

Have you seen, what the docs say? http://unity3d.com/support/documentation/ScriptReference/Screen.SetResolution.html

"In the web player you may only switch resolutions after the user has clicked on the content. The recommended way of doing it is to switch resolutions only when the user clicks on a designated button. "

avatar image tomekkie2 · Aug 24, 2011 at 09:42 AM 0
Share

Possibly you could try to do fullbrowser through manipulating the embedding javascript on the web page.

avatar image yosh · Aug 24, 2011 at 11:02 AM 0
Share

Hey tomekkie2, yeah i´ve read that. Therefore i asked for "workarounds" ;) I´ve tested to manipulate the unitycontent div via jquery but with no success..

avatar image Bunny83 · Aug 24, 2011 at 11:41 AM 2
Share

I guess it's not possible because a website should not be able to put you in fullscreen mode when the Unity content isn't focused.

Otherwise it could switch you into fullscreen even when the website is in a hidden tab. That would be a real pain and heaven for advert-creators.

avatar image yosh · Aug 24, 2011 at 12:50 PM 0
Share

Thanks for your infomation...

1 Reply

· Add your reply
  • Sort: 
avatar image
2
Best Answer

Answer by BerggreenDK · Aug 24, 2011 at 12:55 PM

I think its a security issue, because if the browser could spawn the fullscreen, then someone could use this to fake another screen/interface when you open the website.

So my answer would be "no, you shouldnt be able to go into fullscreen from HTML/embedded javascript on a webpage"

The same thing goes for Flash which also has a fullscreen mode. I believe this was made a standard among browser developers to ensure that noone could fake a bank or transaction using some browser plugin.

I believe this also is why every fullscreen can be exited pressing ESC.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Possible to communicate from HTML to unity standalone app? 3 Answers

Unity 3.0 Webplayer at 100% 7 Answers

(WebGL) Activate Unity Functions with HTML/Javascript 1 Answer

Flash to html communication 1 Answer

How to wait for unity webplayer to load and then invoke its function? 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges