Revision ecffd938

b/cloudcms/static/cloudcms/js/common.js
1
function isIpadIphone(){
2
  var flag = false;
3
    var isiPhone = navigator.userAgent.toLowerCase().indexOf("iphone");
4
    var isiPad = navigator.userAgent.toLowerCase().indexOf("ipad");
5
    if(isiPhone > -1) { flag = true; }
6
    if(isiPad > -1) { flag = true; }
7
    return flag;
8
}
9

  
1 10
function setContainerMinHeight( applicableDiv){
2 11
	
3 12
    if ( $(applicableDiv).length > 0 ) {
b/cloudcms/static/cloudcms/js/youtube.js
1 1
function  YouTube(options) {
2 2
  this.options = options;
3 3
  this.wrapper = options.wrapper;
4
  this.link = this.wrapper.find('a');
4
  this.alink = this.wrapper.find('a');
5 5
  this.image = this.wrapper.find('img');
6 6
  this.videoEl = this.wrapper.find('.player-placeholder');
7 7
  this.currwidth = this.wrapper.width();
......
31 31
      this.currheight = parseInt(458* (this.currwidth/816));
32 32
      this.wrapper.css('height',this.currheight)
33 33
    }
34
    
35 34
  }, this));
36

  
37 35
  this.initEvents();
38

  
39 36
}
40 37

  
41 38

  
42 39
YouTube.prototype.initEvents = function() {
43 40
  var self = this;
44
  this.link.click(function(e){
41
  this.alink.click(function(e){
45 42
      e.preventDefault();
46 43
      self.image.fadeOut({duration:2500,easing:'easeOutCirc'}); 
47
      $(self.player.a).hide().fadeIn({duration:3500,easing:'easeOutCirc'}); 
48 44
      self.wrapper.animate({
49 45
        height: self.currheight
50 46
      },1000, function(){
51 47
        self.close.css('visibility','visible');
52
        self.link.hide();
53
        self.player.setPlaybackQuality('hd720');
54
        self.player.playVideo(); 
48
        self.alink.hide();
49
        if (!(isIpadIphone())) {
50
           self.player.playVideo();
51
        }
55 52
      })
56 53
  });
57 54
  this.close.click(function(e){
58 55
    e.preventDefault();
59
    self.player.stopVideo(); 
60 56
    self.endEvents();
61 57
  })
62 58
}
63 59

  
64 60
YouTube.prototype.endEvents = function() {
65 61
  var self = this;
62
  self.player.pauseVideo();
66 63
  self.close.css('visibility','hidden');
67 64
  self.image.fadeIn({duration:1500,easing:'easeOutCirc'}); 
68
  $(self.player.a).show().fadeIn({duration:1500,easing:'easeOutCirc'}); 
69 65
  self.wrapper.animate({
70 66
    height:'282'
71 67
  },1000, function(){
72
    self.link.show();
68
    self.alink.show();
73 69
  })
74
}
70
}

Also available in: Unified diff