ios - iOS : Autoplay with sound on click only 上的视频 HTML5
<p><p>我尝试在我的网站上集成一个视频 (MP4),它会在没有声音的情况下自动启动(自动播放),但是当您单击视频放大观看时,您必须能够有声音。</p >
<p>我做不到,是禁止的吗?</p>
<p>PS:我读到了这个:<a href="https://webkit.org/blog/6784/new-video-policies-for-ios/" rel="noreferrer noopener nofollow">https://webkit.org/blog/6784/new-video-policies-for-ios/</a> </p>
<p>使用下面的这段代码,自动播放可以工作,但是当我点击视频时,iPad 上没有声音。 </p>
<pre><code><video id="video-autoplay" src="videos/animaux_720x404.mp4" autoplay muted controls="controls" playsinline>
Votre navigateur ne supporte pas les vidéos au format HTML5.<br>
Veuillez mettre à jour votre navigateur ou utilisez Mozilla Firefox.
</video>
</code></pre></p>
<br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
<p><p>尝试使用它来切换 <code>静音</code> 属性。</p>
<pre><code>$("video").click( function (){
$(this).prop("muted", !$(this).prop("muted"));
});
</code></pre>
<p>另见 <a href="http://blog.millermedeiros.com/unsolved-html5-video-issues-on-ios/" rel="noreferrer noopener nofollow">this post</a>了解 iOS 或官方 <a href="https://developer.apple.com/reference/webkitjs/htmlmediaelement" rel="noreferrer noopener nofollow">Apple doc on HTMLMediaElement</a> 上的功能.</p></p>
<p style="font-size: 20px;">关于ios - iOS : Autoplay with sound on click only 上的视频 HTML5,我们在Stack Overflow上找到一个类似的问题:
<a href="https://stackoverflow.com/questions/43468113/" rel="noreferrer noopener nofollow" style="color: red;">
https://stackoverflow.com/questions/43468113/
</a>
</p>
页:
[1]