metamaps--metamaps/app/assets/javascripts/homepageVimeoFallback.js
Devin Howard 4533a0f2fe merge changes from metamapscc instance branch (#913)
* homepage video fallback

* public/50x.html

* remove blog from public/ html pages

* remove video file since it's on metamaps.cc server

* eslint
2016-11-09 09:34:10 -05:00

30 lines
854 B
JavaScript

/* global $ */
$(document).ready(function () {
if (window.location.pathname === '/') {
$.ajax({
type: 'GET',
url: 'https://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: 'https://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
})