Reactjs 中 iPhone 上的视频自动播放无法正常工作

3

我正在使用Reactjs和nextjs,我的网站上有一个视频,在安卓手机上可以正常工作/显示,但在iPhone上无法工作。我该如何解决这个问题?我尝试了以下代码:

<video   loop autoplay='' muted>
                   <source src= { 'https://xxxxxxxxxxxx.vercel.app/img/video.mp4
' } type="video/mp4" />Your browser does not support the video tag. I suggest you upgrade your browser.
                   <source src={ 'https://xxxxxxxxxxxxxxxxx/img/video.mp4
' } type="video/ogg" />Your browser does not support the video tag. I suggest you upgrade your browser.
               </video>
1个回答

0

playsinline属性有帮助吗?

以下是我所拥有的:

<video autoplay loop muted playsinline class="video-background ">
  <source src="videos/intro-video3.mp4" type="video/mp4">
</video>

甚至在网站上也无法工作。 - Jenny
先生,还是不行。 - Jenny
你的iOS版本是什么? - korayaggul
https://360-reader.com/fix-cant-stop-safari-auto-playing-videos-ios-16-iphone-ipad/ - korayaggul
如果你的项目是ReactJS,那么请使用playsInline而不是playsinline - undefined
显示剩余2条评论

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接