Class: HLS::ApplicationVideo::PosterDeclaration

Inherits:
Data
  • Object
show all
Defined in:
lib/hls/application_video.rb

Overview

A poster declaration. Resolved against an input at instance time to a concrete dimension pair. Filename is ‘<name>.jpg`.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#heightObject (readonly)

Returns the value of attribute height

Returns:

  • (Object)

    the current value of height



72
73
74
# File 'lib/hls/application_video.rb', line 72

def height
  @height
end

#nameObject (readonly)

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



72
73
74
# File 'lib/hls/application_video.rb', line 72

def name
  @name
end

#scaleObject (readonly)

Returns the value of attribute scale

Returns:

  • (Object)

    the current value of scale



72
73
74
# File 'lib/hls/application_video.rb', line 72

def scale
  @scale
end

#widthObject (readonly)

Returns the value of attribute width

Returns:

  • (Object)

    the current value of width



72
73
74
# File 'lib/hls/application_video.rb', line 72

def width
  @width
end

Instance Method Details

#filenameObject



73
74
75
# File 'lib/hls/application_video.rb', line 73

def filename
  "#{name}.jpg"
end

#resolve(input:) ⇒ Object



77
78
79
80
81
82
83
84
85
# File 'lib/hls/application_video.rb', line 77

def resolve(input:)
  if scale
    w = (input.width  * scale).floor
    h = (input.height * scale).floor
    [w, h]
  else
    [width, height]
  end
end