lundi 15 juillet 2019

Background autoplaying video not working on mobile, solutions?

I did set up a background video for this site:

agriturismocascinatrevo.it

and it's not working on mobile. I read a looked for answers but I can find just issues of 2017 and maybe there are now solutions. Idk, I'm just hoping for an answer aha

Moreover, I'm completely open to suggestions to improve the code since I'm not a cs student

I tried to use some scripts I've found but none worked as expected but I've deleted them so I cannot repost them here I'm sorry.

<!DOCTYPE html>
<html>
    <head>
        <style>
            /* Sezione introduttiva (video + titolo e overlay) */
            video {position: fixed;
                top: 50%;
                left: 50%;
                overflow: hidden;
                min-width: 100%;
                min-height: 100%;
                width: auto;
                height: auto;
                z-index: -100;
                -ms-transform: translateX(-50%) translateY(-50%);
                -moz-transform: translateX(-50%) translateY(-50%);
                -webkit-transform: translateX(-50%) translateY(-50%);
                transform: translateX(-50%) translateY(-50%);}
        </style>
    </head>
    <body>        
        <video id="myVideo" playsinline muted autoplay poster="./media/bgSito v2 - Preview.jpg">
            <source src="./media/CascinaSemplice.mp4" type="video/mp4">
        </video>
        </body>
</html>

I'd like the video to be able to autoplay on the background also on the mobile 'rendering' of the site.

If needed the full code, the lates version is online so you can reach it directly there




Aucun commentaire:

Enregistrer un commentaire