Disable html5 video autoplay

前端 未结 8 1503
感情败类
感情败类 2021-02-02 07:10

How can I disable html5 video autoplay?

what I\'ve tried:

8条回答
  •  自闭症患者
    2021-02-02 07:38

    I'd remove the autoplay attribute, since if the browser encounters it, it autoplays!

    autoplay is a HTML boolean attribute, but be aware that the values true and false are not allowed. To represent a false value, you must omit the attribute.

    The values "true" and "false" are not allowed on boolean attributes. To represent a false value, the attribute has to be omitted altogether.

    Also, the type goes inside the source, like this:

    
    

    References:

    • http://www.w3.org/TR/html-markup/video.html
    • HTML Spec (boolean attributes)

提交回复
热议问题