xiaohantx
V2EX  ›  问与答

安卓内嵌网页,请问下网页中的音频还有办法可以自动播放嘛(没有任何交互接触)~

  •  
  •   xiaohantx · Dec 11, 2020 · 1366 views
    This topic created in 2180 days ago, the information mentioned may be changed or developed.
    谷歌标准是禁用了自动播放
    2 replies  •  2020-12-11 20:15:09 +08:00
    lisianthus
    lisianthus
    Dec 11, 2020
    1
    跟浏览器有关吧。
    chrome 可以静音自动播放,以前的版本好像可以通过 js 设置 audio.muted = false 来取消静音,但现在取消静音的同时会取消播放。
    crystom
    crystom
    Dec 11, 2020
    2
    webview 设置一下不行吗 myWebView.getSettings().setMediaPlaybackRequiresUserGesture(false);
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2808 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 10:22 · PVG 18:22 · LAX 02:22 · JFK 05:22
    ♥ Do have faith in what you're doing.