homepage video fallback
This commit is contained in:
parent
a176cdf231
commit
5089485da4
4 changed files with 28 additions and 0 deletions
BIN
app/assets/images/metamaps-intro-poster.webp
Normal file
BIN
app/assets/images/metamaps-intro-poster.webp
Normal file
Binary file not shown.
After Width: | Height: | Size: 32 KiB |
|
@ -16,3 +16,4 @@
|
||||||
//= require_directory ./lib
|
//= require_directory ./lib
|
||||||
//= require ./webpacked/metamaps.bundle
|
//= require ./webpacked/metamaps.bundle
|
||||||
//= require ./Metamaps.ServerData
|
//= require ./Metamaps.ServerData
|
||||||
|
//= require homepageVimeoFallback
|
||||||
|
|
27
app/assets/javascripts/homepageVimeoFallback.js
Normal file
27
app/assets/javascripts/homepageVimeoFallback.js
Normal 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
|
||||||
|
});
|
BIN
app/assets/videos/metamaps-intro.mp4
Normal file
BIN
app/assets/videos/metamaps-intro.mp4
Normal file
Binary file not shown.
Loading…
Add table
Reference in a new issue