简体   繁体   中英

Customizing the blank screen before splash screen and videos not playing in full screen on phonegap

I am building an app on phonegap that displays several links. A blank screen with the icon and title on the left top appears before the splash screen appears when I open the app. However I found online that it is normal in android but we can customize it. Is there any way I can customize it in phonegap and if so how?

When a user presses a link, it opens the link in an inappbrowser. Everything works accordingly on ios. However when it comes to android, if there are any videos in those links, they do not play on fullscreen but they do on ios. When I press the enlarge button, nothing happens. The video just keeps playing without enlarging on the android.

Below is my config.xml for android if it helps.

<preference name="orientation" value="portrait" />
    <preference name="fullscreen" value="true" />
    <preference name="target-device" value="universal" />

    <preference name="prerendered-icon" value="true" />
    <preference name="stay-in-webview" value="false" />

    <preference name="detect-data-types" value="true" />
    <preference name="exit-on-suspend" value="false" />
    <preference name="show-splash-screen-spinner" value="false" />
    <preference name="auto-hide-splash-screen" value="true" />
    <preference name="EnableViewportScale" value="true" />
    <preference name="MediaPlaybackRequiresUserAction" value="true" />
    <preference name="AllowInlineMediaPlayback" value="true" />
    <preference name="BackupWebStorage" value="local" />
    <preference name="TopActivityIndicator" value="gray" />
    <preference name="HideKeyboardFormAccessoryBar" value="false" />
    <preference name="android-minSdkVersion" value="15" />
    <preference name="android-targetSdkVersion" value="22" /> 

    <preference name="android-installLocation" value="auto" />
    <preference name="SplashScreenDelay" value="5000" /> 
    <preference name="ErrorUrl" value=""/>
    <preference name="BackgroundColor" value="0x000000"/>
    <preference name="KeepRunning" value="true"/>
    <preference name="DisallowOverscroll" value="true"/>
    <preference name="LoadingDialog" value=","/> 
    <preference name="LoadUrlTimeoutValue" value="20000" />
    <preference name="disable-cursor" value="false" />

    <gap:platform name="android" />

    <feature name="http://api.phonegap.com/1.0/battery"/>
    <feature name="http://api.phonegap.com/1.0/geolocation"/>
    <feature name="http://api.phonegap.com/1.0/network"/>
    <feature name="http://api.phonegap.com/1.0/notification"/>
    <feature name="http://api.phonegap.com/1.0/geolocation"/>
    <feature name="http://api.phonegap.com/1.0/network"/>
    <gap:plugin name="org.apache.cordova.battery-status"  />
    <gap:plugin name="org.apache.cordova.device-motion"  />
    <gap:plugin name="org.apache.cordova.dialogs"  />
    <gap:plugin name="org.apache.cordova.geolocation"  />

    <gap:plugin name="org.apache.cordova.dialogs" />
    <gap:plugin name="org.apache.cordova.inappbrowser" />
    <gap:plugin name="org.apache.cordova.media"  />
    <gap:plugin name="org.apache.cordova.network-information"  />
    <gap:plugin name="org.apache.cordova.splashscreen"  />
    <gap:plugin name="org.apache.cordova.vibration"  />


    <icon src="res/icon/android/icon-36-ldpi.png" gap:platform="android" gap:density="ldpi" />
    <icon src="res/icon/android/icon-48-mdpi.png" gap:platform="android" gap:density="mdpi" />
    <icon src="res/icon/android/icon-72-hdpi.png" gap:platform="android" gap:density="hdpi" />
    <icon src="res/icon/android/icon-96-xhdpi.png" gap:platform="android" gap:density="xhdpi" />
    <icon src="res/icon/android/icon-xxhdpi.png" gap:platform="android" gap:density="xxhdpi" />
    <icon src="res/icon/android/icon-xxxhdpi.png" gap:platform="android" gap:density="xxxhdpi" />

    <icon src="icon.png" />

    <gap:splash src="res/screen/android/screen-ldpi-potrait.png" gap:platform="android" gap:density="ldpi" />
    <gap:splash src="res/screen/android/screen-mdpi-potrait.png" gap:platform="android" gap:density="mdpi" />
    <gap:splash src="res/screen/android/screen-hdpi-potrait.png" gap:platform="android" gap:density="hdpi" />
    <gap:splash src="res/screen/android/screen-xhdpi-potrait.png" gap:platform="android" gap:density="xhdpi" />
    <gap:splash src="res/screen/windows-phone/screen-portrait.png" gap:platform="winphone" />
    <access origin="*"/>

I have been trying to see where the problem is for the last two weeks but in vain. Any help is truly appreciated.

You could try this for the "blank screen that appears before the splash"

In the "platforms\\android" folder under your project, open the AndroidManifest.xml and search for android:theme inside the <activity> tag that contains android:name="MainActivity" and change the default value (that is android:theme="@android:style/Theme.DeviceDefault.NoActionBar" ) to android:theme="@android:style/Theme.Translucent" . Save the file and build your project again, the grey screen should desapear.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM