Last active
August 29, 2015 14:19
-
-
Save moladukes/263472d415adc4caf7d7 to your computer and use it in GitHub Desktop.
Fullscreen Vimeo background
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.video { | |
position: fixed; | |
right: 0; | |
bottom: 0; | |
min-width: 100%; | |
min-height: 100%; | |
width: auto; | |
height: auto; | |
z-index: -100; | |
transition: 1s opacity; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Set START TIME in iframe url params. Set stop time in onPlayProgress() --> | |
<iframe id="vimeo_player" src="//player.vimeo.com/video/121528721?title=0&byline=0&portrait=0&autoplay=1&loop=0&player_id=vimeo_player#t=1m18s" width="100%" height="100%" class="video hide-on-mobile" frameborder="0" webkitallowfullscreen="" mozallowfullscreen="" allowfullscreen=""></iframe> | |
<script src="//f.vimeocdn.com/js/froogaloop2.min.js"></script> | |
<script type="text/javascript"> | |
var player = $f(document.getElementById('vimeo_player')); | |
player.addEvent('ready', function() { | |
player.api('setVolume', 0); | |
player.addEvent('playProgress', onPlayProgress); | |
}); | |
function onPlayProgress(data, id) { | |
if (data.seconds > 110) { | |
player.api('pause', true); | |
} | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment