Module: Lcms::Engine::MediaHelper

Defined in:
app/helpers/lcms/engine/media_helper.rb

Instance Method Summary collapse

Instance Method Details

#embed_media(resource) ⇒ Object



6
7
8
9
10
11
12
13
# File 'app/helpers/lcms/engine/media_helper.rb', line 6

def embed_media(resource)
  if resource.video?
    embed_video(resource.embed_video_url)
  elsif resource.podcast?
    embed_podcast = resource.embed_podcast
    embed_podcast.try(:html_safe) || resource.url
  end
end

#embed_video(embed_url) ⇒ Object



15
16
17
# File 'app/helpers/lcms/engine/media_helper.rb', line 15

def embed_video(embed_url)
  (:iframe, nil, src: embed_url, allowfullscreen: true, frameborder: 0)
end