FIX: onebox youtube channels and handle deleted video links

This commit is contained in:
Arpit Jalan
2015-08-18 14:47:39 +05:30
parent b703af3d37
commit ecd1bfe4cb

View File

@@ -14,6 +14,7 @@ register_asset "stylesheets/lazyYT_mobile.scss", :mobile
# freedom patch YouTube Onebox # freedom patch YouTube Onebox
class Onebox::Engine::YoutubeOnebox class Onebox::Engine::YoutubeOnebox
include Onebox::Engine include Onebox::Engine
alias_method :yt_onebox_to_html, :to_html
def to_html def to_html
if video_id if video_id
@@ -23,7 +24,7 @@ class Onebox::Engine::YoutubeOnebox
# Put in the LazyYT div instead of the iframe # Put in the LazyYT div instead of the iframe
"<div class=\"lazyYT\" data-youtube-id=\"#{video_id}\" data-youtube-title=\"#{video_title}\" data-width=\"#{video_width}\" data-height=\"#{video_height}\" data-parameters=\"#{embed_params}\"></div>" "<div class=\"lazyYT\" data-youtube-id=\"#{video_id}\" data-youtube-title=\"#{video_title}\" data-width=\"#{video_width}\" data-height=\"#{video_height}\" data-parameters=\"#{embed_params}\"></div>"
else else
super yt_onebox_to_html
end end
end end