apache / cordova-plugin-statusbar

Apache Cordova Status Bar Plugin
https://cordova.apache.org/
Apache License 2.0
618 stars 480 forks source link

Playing video on iOS and shifting from landscape to portrait messes up status bar #268

Open sithwarrior opened 6 months ago

sithwarrior commented 6 months ago

Bug Report

Playing video on iOS and shifting from landscape to portrait messes up status bar

same as #221

Problem

What is expected to happen?

Statusbar stays in place

What does actually happen?

Content slides up under status bar

Information

Watching a video in an iOS Webview, defaults to fullscreen, if you rotate your phone to landscape, then back to portrait and exit the video, the status bar is then off

our settings is

<preference name="StatusBarOverlaysWebView" value="false" />

And we only allow portrait orientation, but watching videos is done in a native iOS player by default, which allows rotating.

As the backbutton now is "behind" the status bar, my workaround has been setting the eventlistener on statusTap and then doing

window.StatusBar.overlaysWebView(true);
window.StatusBar.overlaysWebView(false);

I don't know exactly what causing this, but it seems like the resetup of the statusbar isn't called in this situation.

Command or Code

see above

Environment, Platform, Device

iOS <preference name="StatusBarOverlaysWebView" value="false" /> only allow portrait orientation

Version information

Newest Cordova, Cordova IOS, Cordova ionic WKWebview and newest Statusbar Plugin

Checklist

Heshyo commented 3 months ago

I guess I have the same issue. My app is also portrait only, except when playing a video where the player allows both portrait and landscape.

If I open a video in portrait, and stays in portrait, then no problem.

If I open a video in portrait, go to landscape, then close the video, then no problem.

The issue arises when opening the video in portrait, going to landscape, then portrait again, then closing the video. The app is now on top of the status bar, and simply calling window.StatusBar.overlaysWebView(false); does not help. As @sithwarrior mentioned, you have to change the overlay to true then false:

window.StatusBar.overlaysWebView(true);
window.StatusBar.overlaysWebView(false);

I call this in the webkitendfullscreen event.

Heshyo commented 3 months ago

Another way to make the problem appear:

open a video in portrait, then close the player by swiping it down.

The app is now on top of the status bar. The issue with this one is that the webkitendfullscreen event is never called and I don't notice that I must call overlaysWebView.

jcesarmobile commented 3 months ago

can you provide a sample app that reproduces the issue?

Heshyo commented 3 months ago

@jcesarmobile @sithwarrior I'm away from a Mac for some time, but it'll try to provide a sample app in a week or two.