Advertisement
srikat

Untitled

Feb 25th, 2016
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.64 KB | None | 0 0
  1. jQuery(function( $ ){
  2.  
  3. var BV = new $.BigVideo({container: $('.home-hero'), useFlashForFirefox:false, doLoop: true});
  4. BV.init();
  5. BV.show([
  6. { type: "video/mp4", src: "http://cleanpagedevelopment.co.uk/big-tank/videos/bigtank.mp4" },
  7. { type: "video/webm", src: "http://cleanpagedevelopment.co.uk/big-tank/videos/bigtank.webm" },
  8. { type: "video/ogg", src: "http://cleanpagedevelopment.co.uk/big-tank/videos/bigtank.ogv" }
  9. ],{ambient:true});
  10.  
  11. // Fade in the video background after the video is fully loaded
  12. BV.getPlayer().on('durationchange',function(){
  13. $('#big-video-wrap').fadeIn();
  14. });
  15.  
  16. // Use this to toggle
  17. var iframe = $('#pPlayer')[0];
  18. var player = $f(iframe);
  19. player.addEvent('ready', function() {});
  20.  
  21. function addEvent(element, eventName, callback) {
  22. if (element.addEventListener) {
  23. element.addEventListener(eventName, callback, false);
  24. } else {
  25. element.attachEvent(eventName, callback, false);
  26. }
  27. }
  28.  
  29. $('#play').on('click', function(evt) {
  30. evt.preventDefault();
  31. $('.popup-video').addClass('shown');
  32. $('.popup-video, .mask').fadeIn('slow', function() {
  33. player.api('play')
  34. });
  35. $('.mask').on('click', function() {
  36. player.api('pause');
  37. $('.popup-video, .mask').fadeOut('slow', function() {
  38. $('.popup-video').removeClass('shown');
  39. });
  40. });
  41. });
  42.  
  43. // Set home hero content height to viewport height
  44. var windowHeight = $( window ).height();
  45.  
  46. $( '#home-hero-content' ) .css({'height': windowHeight +'px'});
  47.  
  48. $( window ).resize(function(){
  49.  
  50. var windowHeight = $( window ).height();
  51.  
  52. $( '#home-hero-content' ) .css({'height': windowHeight +'px'});
  53.  
  54. });
  55.  
  56. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement