Class: FLV::Tag
- Inherits:
-
Object
- Object
- FLV::Tag
- Defined in:
- lib/flv/tag.rb,
lib/flv/tag/data.rb,
lib/flv/tag/audio.rb,
lib/flv/tag/video.rb
Defined Under Namespace
Constant Summary collapse
- METADATA_TYPE =
0x12
- AUDIO_TYPE =
0x08
- VIDEO_TYPE =
0x09
Instance Attribute Summary collapse
-
#footer ⇒ Object
readonly
Returns the value of attribute footer.
-
#length ⇒ Object
readonly
Returns the value of attribute length.
-
#raw_data ⇒ Object
readonly
Returns the value of attribute raw_data.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(io) ⇒ Tag
constructor
A new instance of Tag.
- #inspect ⇒ Object
Constructor Details
#initialize(io) ⇒ Tag
Returns a new instance of Tag.
23 24 25 26 |
# File 'lib/flv/tag.rb', line 23 def initialize(io) @reader = StreamReader.new(io) read end |
Instance Attribute Details
#footer ⇒ Object (readonly)
Returns the value of attribute footer.
13 14 15 |
# File 'lib/flv/tag.rb', line 13 def @footer end |
#length ⇒ Object (readonly)
Returns the value of attribute length.
13 14 15 |
# File 'lib/flv/tag.rb', line 13 def length @length end |
#raw_data ⇒ Object (readonly)
Returns the value of attribute raw_data.
13 14 15 |
# File 'lib/flv/tag.rb', line 13 def raw_data @raw_data end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
13 14 15 |
# File 'lib/flv/tag.rb', line 13 def @timestamp end |
Class Method Details
.read(io) ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/flv/tag.rb', line 15 def self.read(io) case io.readbyte when METADATA_TYPE then Data.new(io) when AUDIO_TYPE then Audio.new(io) when VIDEO_TYPE then Video.new(io) end end |
Instance Method Details
#inspect ⇒ Object
28 29 30 |
# File 'lib/flv/tag.rb', line 28 def inspect "#<#{self.class}>" end |