gpt4 book ai didi

wordpress - 为什么 WordPress 视频在没有自动播放的情况下也不能播放?

转载 作者:行者123 更新时间:2023-12-03 17:22:32 24 4
gpt4 key购买 nike

在我的网页上只有一个视频。它在 Edge 上运行良好,但在移动设备和 Chrome 上运行不佳。

  • 视频是.mp4
  • 自动播放已禁用
  • 我正在使用 OceanWP 主题,但我也尝试了 Astra 主题,但没有成功
  • 我正在使用 Elementor 编辑页面

  • 关于这个主题有很多问题,但没有一个可以解决我的问题。

    enter image description here

    编辑

    enter image description here

    最佳答案

    来自官方 Apple WebKit 文档 (iOS):

    Starting in iOS 10, WebKit relaxes its inline and autoplay policies to make these presentations possible, but still keeps in mind sites’ bandwidth and users’ batteries.

    By default, WebKit will have the following policies:

    • video elements will be allowed to autoplay without a user gesture if their source media contains no audio tracks.
    • video muted elements will also be allowed to autoplay without a user gesture. If a element gains an audio track or becomes un-muted without a user gesture, playback will pause.


    https://webkit.org/blog/6784/new-video-policies-for-ios/

    至于移动 Chrome (Android):

    Muted autoplay for video is supported by Chrome for Android as of version 53. Playback will start automatically for a video element once it comes into view if both autoplay and muted are set, and playback of muted videos can be initiated progamatically with play(). Previously, playback on mobile had to be initiated by a user gesture, regardless of the muted state.



    https://developers.google.com/web/updates/2016/07/autoplay

    例子:
     <video id="myVideo"muted defaultMuted autoplay playsinline controls>
    <source src="myVideo.mp4" type="video/mp4">
    </video>

    关于wordpress - 为什么 WordPress 视频在没有自动播放的情况下也不能播放?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59697053/

    24 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com