Inserted a video on the site through. Autoplay turned on, sound off. Everywhere works except the Safari browser. Tell me the solution.

<video preload="metadata" muted="muted" autoplay loop> <source src="video/1080p_1.mp4" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"'> <source src="video/video.webm" type='video/webm; codecs="vp8, vorbis"'> <source src="video/video.ogv" type='video/ogg; codecs="theora, vorbis"'> </video> 

    2 answers 2

    Another possible solution for future search engines: (If your problem is not a problem with mimetics.)

    For some reason, the videos will not play on the iPad unless I set the control = "true" flag.

    Example: it worked for me on the iPhone, but not on the iPad.

     <video loop autoplay width='100%' height='100%' src='//some_video.mp4' type='video/mp4'></video> 

    And now it works on both iPad and iPhone:

     <video loop autoplay controls="true" width='100%' height='100%' src='//some_video.mp4' type='video/mp4'></video> 
    • The video is intended as a background. I don’t want to put controls at all .. But probably you can set controls = "true" only for safari? - Gregory
    • controls = "true" do not want to, but for safari it is necessary - Aram77778
    • @ Gregory, there’s no need to conceive a background video. - Qwertiy
    • It is necessary to add to the video attribute playsinline. Controls are optional. - Gregory

    The problem is solved by adding the playsinline attribute.

     <video preload="metadata" muted="muted" autoplay playsinline loop></video>