Fix bug.
This commit is contained in:
parent
c952afb56d
commit
56a4f3a3f8
|
@ -91,9 +91,17 @@ class AdImage
|
|||
def embed_url
|
||||
uri = URI.parse(self.youtube) rescue nil
|
||||
if !uri.nil? && uri.host == "www.youtube.com"
|
||||
params = CGI.parse(uri.query)
|
||||
v = params['v'].first
|
||||
if uri.path.start_with?('/embed/')
|
||||
return self.youtube.sub(/http(s|):\/\//,'//')
|
||||
else
|
||||
params = CGI.parse(uri.query.to_s)
|
||||
v = params.blank? ? nil : params['v'].first
|
||||
if v.blank?
|
||||
return ""
|
||||
else
|
||||
return "//www.youtube.com/embed/#{v}"
|
||||
end
|
||||
end
|
||||
else
|
||||
return ""
|
||||
end
|
||||
|
|
|
@ -171,7 +171,7 @@
|
|||
$("*[data-yt-binded=0]").each(function(){
|
||||
init_yt_banner(this);
|
||||
})
|
||||
if (typeof onYouTubeIframeAPIReady !== 'function'){
|
||||
if (typeof onYouTubeIframeAPIReady !== 'function'){
|
||||
$(document).ready(function() {
|
||||
$(document).on('touchstart click mousedown',".jarallax-video-audio",function(){
|
||||
$(this).trigger('click');
|
||||
|
@ -357,7 +357,7 @@ if (typeof onYouTubeIframeAPIReady !== 'function'){
|
|||
}
|
||||
{{extra_state_chnage_script}}
|
||||
}
|
||||
}
|
||||
}
|
||||
$(document).ready(function(){
|
||||
window.onYouTubePlayerAPIReady = function() {
|
||||
onYouTubeIframeAPIReady.apply(this,arguments);
|
||||
|
|
Loading…
Reference in New Issue