Class: FLV::FLVMetaTag

Inherits:
FLVTag
  • Object
show all
Defined in:
lib/flv/meta_tag.rb

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

#eventObject

Returns the value of attribute event.



33
34
35
# File 'lib/flv/meta_tag.rb', line 33

def event
  @event
end

#meta_dataObject

Returns the value of attribute meta_data.



33
34
35
# File 'lib/flv/meta_tag.rb', line 33

def 
  @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

#add_meta_data(meta_data) ⇒ Object



51
52
53
54
# File 'lib/flv/meta_tag.rb', line 51

def ()
  return nil if .nil?
  @metadata.update 
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
     = AMFStringBuffer.new(@data)
    @event = .read__AMF_data
    @meta_data = .read__AMF_data
  else
    @event = 'onMetaData'
    @meta_data = {}
  end
end

#dataObject



56
57
58
59
60
61
# File 'lib/flv/meta_tag.rb', line 56

def data
   = AMFStringBuffer.new('')
  .write__AMF_string @event
  .write__AMF_data @meta_data
  .to_s
end

#inspectObject



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

#nameObject



47
48
49
# File 'lib/flv/meta_tag.rb', line 47

def name
  "Meta Tag (#{@event})"
end