自定义初始屏幕之前的空白屏幕,并且无法在Phonegap上以全屏模式播放视频 [英] Customizing the blank screen before splash screen and videos not playing in full screen on phonegap

查看:82
本文介绍了自定义初始屏幕之前的空白屏幕,并且无法在Phonegap上以全屏模式播放视频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在phonegap上构建一个显示几个链接的应用程序.当我打开应用程序时,在初始屏幕出现之前,将出现一个带有左上角的图标和标题的空白屏幕.但是我在线发现它在android中很正常,但是我们可以自定义它.有什么方法可以在phonegap中自定义它?

当用户按下链接时,它会在一个浏览器中打开该链接.一切都可以在ios上正常运行.但是,当涉及到android时,如果这些链接中有任何视频,则它们不会在全屏模式下播放,而会在ios上播放.当我按下放大按钮时,什么也没有发生.视频只是一直播放而没有在android上放大.

如果有帮助,下面是我的android config.xml.

<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="*"/>

我一直在尝试查看问题的出处,在过去的两个星期里,但徒劳无功.任何帮助,我们都感激不尽.

解决方案

您可以尝试使用出现在闪屏之前的空白屏幕"

在项目下的"platforms \ android"文件夹中,打开AndroidManifest.xml并在包含android:name="MainActivity"<activity>标记内搜索android:theme,并将默认值(即android:theme="@android:style/Theme.DeviceDefault.NoActionBar")更改为android:theme="@android:style/Theme.Translucent".保存文件并再次构建项目,灰屏消失.

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.

这篇关于自定义初始屏幕之前的空白屏幕,并且无法在Phonegap上以全屏模式播放视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆