Class: FLV::FLVMetaTag
Constant Summary
Constants inherited
from FLVTag
FLV::FLVTag::AUDIO, FLV::FLVTag::META, FLV::FLVTag::UNDEFINED, FLV::FLVTag::VIDEO
Instance Attribute Summary collapse
Attributes inherited from FLVTag
#byte_offset, #tag_type, #timestamp
Instance Method Summary
collapse
Methods inherited from FLVTag
#data_size, #info, #initialize, #serialize, #size, type2name
Constructor Details
This class inherits a constructor from FLV::FLVTag
Instance Attribute Details
#event ⇒ Object
Returns the value of attribute event.
33
34
35
|
# File 'lib/flv/meta_tag.rb', line 33
def event
@event
end
|
Returns the value of attribute meta_data.
33
34
35
|
# File 'lib/flv/meta_tag.rb', line 33
def meta_data
@meta_data
end
|
Instance Method Details
#[](key) ⇒ Object
63
64
65
|
# File 'lib/flv/meta_tag.rb', line 63
def [](key)
@meta_data[key]
end
|
#[]=(key, value) ⇒ Object
67
68
69
|
# File 'lib/flv/meta_tag.rb', line 67
def []=(key, value)
@meta_data[key] = value
end
|
51
52
53
54
|
# File 'lib/flv/meta_tag.rb', line 51
def add_meta_data(meta_data)
return nil if meta_data.nil?
@metadata.update meta_data
end
|
#after_initialize(new_object) ⇒ Object
35
36
37
38
39
40
41
42
43
44
45
|
# File 'lib/flv/meta_tag.rb', line 35
def after_initialize(new_object)
@tag_type = META
unless new_object
meta_data_stream = AMFStringBuffer.new(@data)
@event = meta_data_stream.read__AMF_data
@meta_data = meta_data_stream.read__AMF_data
else
@event = 'onMetaData'
@meta_data = {}
end
end
|
#data ⇒ Object
56
57
58
59
60
61
|
# File 'lib/flv/meta_tag.rb', line 56
def data
meta_data_stream = AMFStringBuffer.new('')
meta_data_stream.write__AMF_string @event
meta_data_stream.write__AMF_data @meta_data
meta_data_stream.to_s
end
|
#inspect ⇒ Object
71
72
73
74
75
76
|
# File 'lib/flv/meta_tag.rb', line 71
def inspect
out = super
out << "event: #{@event}"
out << "meta_data:\n #{MiYAML.dump(@meta_data, :indent => 2, :boundaries => false)}"
out
end
|
#name ⇒ Object
47
48
49
|
# File 'lib/flv/meta_tag.rb', line 47
def name
"Meta Tag (#{@event})"
end
|