homepage video fallback

This commit is contained in:
Metamaps on Linode 2016-03-30 22:19:29 -04:00 committed by Devin Howard
parent a176cdf231
commit 5089485da4
4 changed files with 28 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

View file

@ -16,3 +16,4 @@
//= require_directory ./lib
//= require ./webpacked/metamaps.bundle
//= require ./Metamaps.ServerData
//= require homepageVimeoFallback

View file

@ -0,0 +1,27 @@
$(document).ready(function () {
if (window.location.pathname == "/") {
$.ajax({
type: "GET",
url: '//player.vimeo.com',
error: function(e) {
$('.homeVideo').hide();
$('.homeVideo').replaceWith($('<video/>', {
poster: '/assets/metamaps-intro-poster.webp',
width: '560',
height: '315',
class: 'homeVideo',
controls: ''
}));
$('.homeVideo').append($('<source/>', {
src: '//metamaps.cc/videos/metamaps-intro.mp4',
type: 'video/mp4'
}));
$('.homeVideo').append(
'<p>You can watch our instruction video at ' +
'<a href="https://metamaps.cc/videos/metamaps-intro.mp4">' +
'https://metamaps.cc/videos/metamaps-intro.mp4</a>.'
);
}
});
}//if
});

Binary file not shown.