home: fix video playback in chrome

git-svn-id: svn+ssh://atelier.inf.usi.ch/home/bevilj/group-1@245 a672b425-5310-4d7a-af5c-997e18724b81
This commit is contained in:
bevilj 2018-11-17 14:00:32 +00:00
parent a1aa9597ad
commit 77722b9440
2 changed files with 3 additions and 4 deletions

View File

@ -83,12 +83,11 @@ function write(position){
}
var isChrome = /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor);
var homeVideo = document.getElementById('videoHome');
if (!isChrome) {
homeVideo.play();
if (isChrome) {
document.getElementById('foolChrome').remove();
var homeVideo = document.getElementById('videoHome');
homeVideo.muted = true;
homeVideo.play();
}

View File

@ -8,7 +8,7 @@ title: Home page
<iframe id="foolChrome" src="{{ site.baseurl }}/assets/style/silence.mp3" allow="autoplay" style="display:none"></iframe>
<video id="videoHome">
<video autoplay id="videoHome">
<source src="assets/front/hero_video.mp4" type="video/mp4">
</video>