在类似phone gap/cordova的混合应用中,像当前的Ubber App一样,可以使用视频mp4或任何格式作为启动画面。
在类似phone gap/cordova的混合应用中,像当前的Ubber App一样,可以使用视频mp4或任何格式作为启动画面。
<div id="splashVid" class="centerpage" style="overflow:hidden; display:block">
<video width="100%" autoplay onended="splashEnd();">
<source src="BT-logo-splash.mov" type="video/mp4">
Your browser does not support the video tag.
</video>
</div>
This is your splashscreen.html and splashscreen.js,include them in your app and redirect on home page after video playing is completed by setting setTimeout time
$(document).ready(function(){
var url = $('iframe').attr('src');
url = url+'?autoplay=1';
$('iframe').attr('src', url);
setTimeout(function(){
//location.href="home.html";//redirect to home from here,you can set timeout to the video length
alert("video Completed");
},5000);
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<body style="margin:0px;padding:0px;overflow:hidden">
<iframe src="http://www.youtube.com/embed/XGSy3_Czz8k" frameborder="0" style="overflow:hidden;height:150%;width:150%" height="150%" width="150%"></iframe>
</body>
Cordova启动画面是一个本地对话框,它在Webview中加载混合应用程序时显示。至少这应该是正确的用法。
关于显示HTML视频/动画等的任何解决方案都是关于在Webview中显示它们。所以这完全没有用。
最好的解决方案是分叉Cordova启动画面插件并添加视频支持。
在 phonegap/Cordova 中无法将 mp4 或 gif 文件作为启动画面。您可以直接加载 index.html 页面,在那里您可以播放视频并导航到下一页。
希望这能帮到您。