samedi 23 juillet 2016

Random Video not working into Chrome

Hy

Sorry my English Google Translate is helping me ;-) I use this Code to display a random Movie on my Page. It works perfect into Firefox.

But into Google Chrom its not workig.

var randomVid; randomVid = function() { var mp4, randomMp4SrcList, randomWebMSrcList, srcMp4, srcWebM, webM; randomMp4SrcList = [ "files/random_movies/video1.mp4", "files/random_movies/video2.mp4", "files/random_movies/video3.mp4", "files/random_movies/video4.mp4", "files/random_movies/video5.mp4", "files/random_movies/video6.mp4", ]; randomWebMSrcList = [ "http://ift.tt/2ajRsTq", "http://ift.tt/2alvvQK"]; mp4 = randomMp4SrcList[Math.floor(Math.random() * randomMp4SrcList.length)]; webM = randomWebMSrcList[Math.floor(Math.random() * randomWebMSrcList.length)]; srcMp4 = document.querySelectorAll("#bgvideo > source")[0]; srcWebM = document.querySelectorAll("#bgvideo > source")[1]; srcMp4.src=mp4; srcWebM.src=webM; return; };
        <div class="background-video-holder">
            <video id="bgvideo" class="background-video hidden-xs" preload="auto" autoplay="autoplay" loop="loop">
                <source src=" " type="video/mp4">
                    <source src=" " type="video/webm">
                        <script>
                            randomVid();
                        </script>
            </video>

Any Ideas? What i have to Change to see a Random Video into any Browsers?

Thanks Guys!




Aucun commentaire:

Enregistrer un commentaire