diff --git a/app/views/admin/ad_images/_jplayer.html.erb b/app/views/admin/ad_images/_jplayer.html.erb index 2f969ff..97f18b0 100644 --- a/app/views/admin/ad_images/_jplayer.html.erb +++ b/app/views/admin/ad_images/_jplayer.html.erb @@ -231,6 +231,23 @@ <% if @hide_video_tools %> ad_audio_button(this,false); <% end %> + var is_frontend = <%= @is_frontend ? true : false %>; + if(is_frontend){ + var cyclediv = $(this).parents("div.cycle-slideshow").eq(0); + if(cyclediv.height() == 0 || cyclediv.data("auto-height")){ + cyclediv.data("auto-height",true); + var video_block = cyclediv.find('video')[0]; + if(video_block != undefined){ + cyclediv.height(cyclediv.width() * video_block.videoHeight / video_block.videoWidth); + if(!(cyclediv.data("bind-resize"))){ + cyclediv.data("bind-resize",true); + $(window).resize(function(){ + cyclediv.height(cyclediv.width() * video_block.videoHeight / video_block.videoWidth); + }) + } + } + } + } }, click: function(){ click_jplayer_<%= i %>(); @@ -257,6 +274,7 @@ <% if @apply_autoplay_script %> var is_frontend = <%= @is_frontend ? true : false %>; var cyclediv = $(this).parents("div.cycle-slideshow").eq(0); + var autoHeight = cyclediv.data("auto-height"); if(!is_frontend || (is_frontend && cyclediv.find('[data-autoplay=1]').length != 0)){ cyclediv.cycle("pause").cycle("next"); var current_cycle = cyclediv.find(".cycle-slide-active");