Skip to content

Commit

Permalink
Added fallback.
Browse files Browse the repository at this point in the history
  • Loading branch information
MadcowD committed Feb 14, 2018
1 parent 15590cd commit df41802
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions _includes/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@
}
});
</script>

<script type="text/javascript">
function fallback(video)
{
var img = video.querySelector('img');
if (img)
video.parentNode.replaceChild(img, video);
}
</script>

<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
Expand Down
2 changes: 1 addition & 1 deletion _layouts/paper.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ <h1 class="paper-title">{{ page.title }} [<a href={{ page.arxiv }}>arxiv</a>]</h
<div>
<video class="visual_abstract" autoplay loop muted playsinline>
<source src="/public/video.mp4" type="video/mp4">
<source src="/public/video.webm" type="video/webm">
<source src="/public/video.webm" type="video/webm" onerror="fallback(parentNode)">
<img class="visual_abstract" src="/public/algtop.png" />
</video>
</div>
Expand Down

0 comments on commit df41802

Please sign in to comment.