Phonegap iOS HTML5视频打开播放器 [英] Phonegap iOS HTML5 Video Opens Player

查看:275
本文介绍了Phonegap iOS HTML5视频打开播放器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的Phonegap网页非常简单:

I am using Phonegap with a very simple landing page:

<div>
    <video playsinline autoplay muted loop id='bgvid'>
        <source src='vid/localvid.mp4' type='video/mp4'>
    </video>
</div>

目的是让视频在后台播放,其中一些内容叠加在顶部。该视频确实开始播放,但在iOS上它启动原生全屏视频播放器,而不是在div中播放。

The intent is to have the video playing in the background with some content overlayed on top. The video does indeed start playing, but on iOS it launches the native full screen video player rather than playing it in the div itself.

任何想法如何防止它发布原生视频播放器?

Any idea how to keep it from launching the native video player?

谢谢!

推荐答案

实际需要两件事,它可以在iPhone上运行:

It actually takes two things and it DOES work on the iPhone:

将此添加到config.xml
< preference name =AllowInlineMediaPlayback值=true/>

Add this to config.xml <preference name="AllowInlineMediaPlayback" value="true" />

在HTML中,您必须包含 webkit-playsinline

And in the HTML you must include webkit-playsinline

< video webkit-playsinline playsinline autoplay muted loop>< source src ='vid / vid.mp4'type ='video / mp4'>< / video>

这篇关于Phonegap iOS HTML5视频打开播放器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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