Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- jQuery(function( $ ){
- var BV = new $.BigVideo({container: $('.home-hero'), useFlashForFirefox:false, doLoop: true});
- BV.init();
- BV.show([
- { type: "video/mp4", src: "http://cleanpagedevelopment.co.uk/big-tank/videos/bigtank.mp4" },
- { type: "video/webm", src: "http://cleanpagedevelopment.co.uk/big-tank/videos/bigtank.webm" },
- { type: "video/ogg", src: "http://cleanpagedevelopment.co.uk/big-tank/videos/bigtank.ogv" }
- ],{ambient:true});
- // Fade in the video background after the video is fully loaded
- BV.getPlayer().on('durationchange',function(){
- $('#big-video-wrap').fadeIn();
- });
- // Use this to toggle
- var iframe = $('#pPlayer')[0];
- var player = $f(iframe);
- player.addEvent('ready', function() {});
- function addEvent(element, eventName, callback) {
- if (element.addEventListener) {
- element.addEventListener(eventName, callback, false);
- } else {
- element.attachEvent(eventName, callback, false);
- }
- }
- $('#play').on('click', function(evt) {
- evt.preventDefault();
- $('.popup-video').addClass('shown');
- $('.popup-video, .mask').fadeIn('slow', function() {
- player.api('play')
- });
- $('.mask').on('click', function() {
- player.api('pause');
- $('.popup-video, .mask').fadeOut('slow', function() {
- $('.popup-video').removeClass('shown');
- });
- });
- });
- // Set home hero content height to viewport height
- var windowHeight = $( window ).height();
- $( '#home-hero-content' ) .css({'height': windowHeight +'px'});
- $( window ).resize(function(){
- var windowHeight = $( window ).height();
- $( '#home-hero-content' ) .css({'height': windowHeight +'px'});
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement