(cross-posting from my answer on the github issue...)
Modernizr.touch
has been renamed to Modernizr.touchevents
, becuase that what it really is - a detect for touchevents. And as you can see in #448,
Sometimes you have a touch device.. Sometimes you have webkit touch events. Sometimes you have MS pointer events..
So, in this case, you would also want to be doing (Modernizr.touchevents || Modernizr.pointerevents)
.
Unfortunately, the pointerevents detect is not in the 2.* branch, as it is built around 3.0, which is unreleased. You would need to either build your modernizr build from the current master branch (instructions are included in the readme), or manually add the pointerevents detect to your modernizr build.
That being said, a touch screen is a poor indicator for mobile. A lot of new windows 8 tablets are touch enabled, and would get your static background.
What you are really doing is really checking if autoplay is supported. We have a detect for that, but you would need to back port it.
cheers
Now that that is covered, on yo your question...
BV.show
doesn't accept a function as an argument.
If you are only using it in this one place, you really don't need to be having your visitors download an entirely separate library (vegas) to scale a picture. You can recreate what they are doing by looking at the css that is generated for that element, and adding it to your page. Then, instead of the BV.show(vegasstuff)
that you are doing now, you can toggle a class on the HTML element (just like how Modernizr adds it's classes) to optionally hide it or show it.
something like...
<script>
if (Modernizr.touch) {
$('html').addClass('showOverlay');
}
else {
// do the video
}
</script>
<style>
.overlay {
display: none;
margin: 0;
padding: 0;
position: fixed;
left: 0;
top: 0;
width: 100%;
height: 100%;
}
.showOverlay .overlay {
display: block;
background-image: url(/img/background-dock.jpg);
}
</style>