Screen.Orientation IPhone

Welcome! Forums Unity Plugins In-App Web Browser Screen.Orientation IPhone

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #267
    Zeldarck
    Participant

    Hi,

    I have a game force in portait mode. I use the browser to play video on youtube, before open the browser i switch landscape and I back portrait when I closed the browser

        protected IEnumerator PlayBackRoutine()
        {
            yield return new WaitForSeconds(1);
    
            UICommander.HideAll();
    
            Screen.orientation = ScreenOrientation.Landscape;
            while (Screen.currentResolution.height > Screen.currentResolution.width)
            {
                yield return null;
            }
    
            InAppBrowser.DisplayOptions displayOption = new InAppBrowser.DisplayOptions();
            displayOption.displayURLAsPageTitle = false;
            displayOption.hidesTopBar = true;
            InAppBrowser.LoadHTML("<div style='position:absolute;left:0;right:0;top:0px;bottom:0;overflow:auto;'><iframe id=\"ytplayer\" type=\"text/html\" width=\"640\" height=\"360\"  src=\"http://www.youtube.com/embed/kQye2uNafk0?autoplay=1&controls=0&rel=0&showinfo=0&cc_load_policy=1&hl=ru&fs=1\"  frameborder=\"0\" style=\"margin:0px;padding:0px;\"/></div>", displayOption);
    
        }
    
        protected IEnumerator Close()
        {
            Screen.orientation = ScreenOrientation.Portrait;
            while (Screen.currentResolution.height > Screen.currentResolution.width)
            {
                yield return null;
            }
    
            UICommander.ShowAll();
    
        }
    

    When I am in the browser (only on IOs), the screen orientation is not freeze in landscape. (I didn’t test if after leave browser it’s freeze in portrait or if I didn’t switch to landscape before open the browser it’s do shit too, but I will maybe try in th eweek )

    Do you know if it’s a know problem of your asset? 🙂

    #288
    PiotrPiotr
    Keymaster

    Do not count on plugin listening to Unity orientation settings 🙂
    I will add an API so you could force browser to be in portrait or landscape orientation.
    Will send you it in a bit so you can test it out.

    #289
    PiotrPiotr
    Keymaster

    Ok, check your email please.
    If it works I think I’ll add it in next plugin release.
    Also please confirm that it’s working correctly on Android or I have to make some changes there as well.

    #290
    Zeldarck
    Participant

    Hi, thank you, yes it work well 🙂
    I didn’t test to set shouldStickToPortrait and shouldStickToLandscape to true both.
    On android it’s ok with orientation in unity

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.