Class: FormatParser::Video

Inherits:
Object
  • Object
show all
Includes:
AttributesJSON
Defined in:
lib/video.rb

Constant Summary collapse

NATURE =
:video

Constants included from AttributesJSON

AttributesJSON::MAXIMUM_JSON_NESTING_WHEN_SANITIZING

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from AttributesJSON

_sanitize_json_value, #as_json, #to_json

Constructor Details

#initialize(**attributes) ⇒ Video

Only permits assignments via defined accessors



34
35
36
# File 'lib/video.rb', line 34

def initialize(**attributes)
  attributes.map { |(k, v)| public_send("#{k}=", v) }
end

Instance Attribute Details

#codecsObject

Returns the value of attribute codecs.



16
17
18
# File 'lib/video.rb', line 16

def codecs
  @codecs
end

#content_typeObject

The MIME type of the video



31
32
33
# File 'lib/video.rb', line 31

def content_type
  @content_type
end

#formatObject

Type of the file (e.g :mp3)



14
15
16
# File 'lib/video.rb', line 14

def format
  @format
end

#frame_rateObject

Returns the value of attribute frame_rate.



11
12
13
# File 'lib/video.rb', line 11

def frame_rate
  @frame_rate
end

#height_pxObject

Returns the value of attribute height_px.



9
10
11
# File 'lib/video.rb', line 9

def height_px
  @height_px
end

#intrinsicsObject

If a parser wants to provide any extra information to the caller it can be placed here



28
29
30
# File 'lib/video.rb', line 28

def intrinsics
  @intrinsics
end

#media_duration_framesObject

Duration of the media object in addressable frames or samples, as an Integer



24
25
26
# File 'lib/video.rb', line 24

def media_duration_frames
  @media_duration_frames
end

#media_duration_secondsObject

Duration of the media object (be it audio or video) in seconds, as a Float



20
21
22
# File 'lib/video.rb', line 20

def media_duration_seconds
  @media_duration_seconds
end

#width_pxObject

Returns the value of attribute width_px.



7
8
9
# File 'lib/video.rb', line 7

def width_px
  @width_px
end

Instance Method Details

#natureObject



38
39
40
# File 'lib/video.rb', line 38

def nature
  NATURE
end