How can I autoplay media in iOS >= 4.2.1 Mobile Safari?

后端 未结 9 971
半阙折子戏
半阙折子戏 2020-11-27 05:28

I cannot seem to get audio media to play in Mobile Safari on iOS 4.2.1 in any situation other than the handler of a click event performed by the user. Even then, if p

相关标签:
9条回答
  • 2020-11-27 06:08

    As a workaround, I tried tying the load()/play() code to a click event, and then triggering the click event programmatically. This approach worked in Desktop Safari, but not Mobile Safari.

    0 讨论(0)
  • 2020-11-27 06:10

    On my 3rd-gen iPad running IOS 6, autoplay of HTML5 tags has suddenly begun working! (I've had IOS 6 installed for a couple of weeks, and am pretty sure I tested this feature right away, but only noticed it working tonight.) I don't recall seeing any notice of this from Apple, although I did see that mobile Safari had been granted the ability to support file uploads via

    <form><input type="file" .../></form>
    

    -- another feature I needed but which Apple had withheld.

    0 讨论(0)
  • 2020-11-27 06:11

    Starting from iOS 4.2.x, the download of media will not be started if there isn’t a user-input event, like touchstart.

    So the answer is no, there is no method to autoplay media by JavaScript or something else.

    0 讨论(0)
提交回复
热议问题