admin管理员组文章数量:1406943
I want to add into the body a video (local video) that should be on auto play Any easy solution for that?
<!DOCTYPE html>
<html>
<head>
<link href="fuctions/style.css" rel="stylesheet" media="screen" type="text/css" />
<script type="text/javascript" charset="utf-8" src="fuctions/cordova-2.3.0.js"></script>
<script type="text/javascript" charset="utf-8" src="fuctions/functions.js"></script>
</head>
<body onload="onBodyLoad()">
<script type="text/javascript">
checkFirstRun();
</script>
</body>
</html>
I want to add into the body a video (local video) that should be on auto play Any easy solution for that?
<!DOCTYPE html>
<html>
<head>
<link href="fuctions/style.css" rel="stylesheet" media="screen" type="text/css" />
<script type="text/javascript" charset="utf-8" src="fuctions/cordova-2.3.0.js"></script>
<script type="text/javascript" charset="utf-8" src="fuctions/functions.js"></script>
</head>
<body onload="onBodyLoad()">
<script type="text/javascript">
checkFirstRun();
</script>
</body>
</html>
Share
asked Jan 23, 2013 at 13:05
Fabian BoulegueFabian Boulegue
6,60814 gold badges51 silver badges72 bronze badges
2 Answers
Reset to default 6There is a property on UIWebView called mediaPlaybackRequiresUserAction which defaults to YES. Change it to NO.
Apple and Google decided to allow autoplay in their mobile browsers. But only if videos are muted. On iOS you also have to set the playsinline attribute, because by default videos will play fullscreen.
To get autoplay use the following setup:
<video controls autoplay loop muted playsinline>
<source src="video.mp4" type="video/mp4">
<source src="video.webm" type="video/webm">
</video>
本文标签: javascriptiOS Autoplay Video WebViewStack Overflow
版权声明:本文标题:javascript - iOS Autoplay Video WebView - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745049303a2639553.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论