Sha256: 7a71b80301a497acbbaaed847ab75db3215f8cd17e637e43033a9ccb78d51330

Contents?: true

Size: 499 Bytes

Versions: 16

Compression:

Stored size: 499 Bytes

Contents

# frozen_string_literal: true

module Lcms
  module Engine
    module MediaHelper
      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

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

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
lcms-engine-0.5.5 app/helpers/lcms/engine/media_helper.rb
lcms-engine-0.5.4 app/helpers/lcms/engine/media_helper.rb
lcms-engine-0.5.3 app/helpers/lcms/engine/media_helper.rb
lcms-engine-0.5.2 app/helpers/lcms/engine/media_helper.rb
lcms-engine-0.5.1 app/helpers/lcms/engine/media_helper.rb
lcms-engine-0.5.0 app/helpers/lcms/engine/media_helper.rb
lcms-engine-0.4.2 app/helpers/lcms/engine/media_helper.rb
lcms-engine-0.4.1 app/helpers/lcms/engine/media_helper.rb
lcms-engine-0.4.0 app/helpers/lcms/engine/media_helper.rb
lcms-engine-0.3.1 app/helpers/lcms/engine/media_helper.rb
lcms-engine-0.1.4 app/helpers/lcms/engine/media_helper.rb
lcms-engine-0.3.0 app/helpers/lcms/engine/media_helper.rb
lcms-engine-0.1.3 app/helpers/lcms/engine/media_helper.rb
lcms-engine-0.2.0 app/helpers/lcms/engine/media_helper.rb
lcms-engine-0.1.2 app/helpers/lcms/engine/media_helper.rb
lcms-engine-0.1.0 app/helpers/lcms/engine/media_helper.rb