2016-11-09 14:34:10 +00:00
|
|
|
/* global $ */
|
|
|
|
|
2017-01-24 00:30:13 +00:00
|
|
|
$(document).ready(function() {
|
2016-11-09 14:34:10 +00:00
|
|
|
if (window.location.pathname === '/') {
|
|
|
|
$.ajax({
|
|
|
|
type: 'GET',
|
2017-03-26 20:53:59 +00:00
|
|
|
url: 'https://i.vimeocdn.com/video/',
|
2017-01-24 00:30:13 +00:00
|
|
|
error: function(e) {
|
2016-11-09 14:34:10 +00:00
|
|
|
$('.homeVideo').hide()
|
|
|
|
$('.homeVideo').replaceWith($('<video/>', {
|
2017-03-26 20:53:59 +00:00
|
|
|
poster: '<%= asset_path('metamaps-intro-poster.webp') %>',
|
2016-11-09 14:34:10 +00:00
|
|
|
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
|
|
|
|
})
|