Class: Components::Renderers::VideoTag

Inherits:
Base
  • Object
show all
Defined in:
app/components/renderers/video_tag.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.supports?(file) ⇒ Boolean

Returns:

  • (Boolean)


2
3
4
# File 'app/components/renderers/video_tag.rb', line 2

def self.supports?(file)
  FileHandlers::VideoTag.can_load? file&.mime_type
end

Instance Method Details

#view_template ⇒ Object



6
7
8
9
10
11
12
13
# File 'app/components/renderers/video_tag.rb', line 6

def view_template
  video(
    src: model_model_file_raw_path(@file.model, @file.filename),
    alt: @file.name,
    style: "width: 100%",
    controls: true
  )
end