Class: VAST::Mediafile

Inherits:
Element show all
Defined in:
lib/vast/mediafile.rb

Overview

Any number of Mediafile objects can be provided for a single Ad, but it is assumed that all Mediafiles belongs to a single Ad object represent the same creative unit with the same duration, Ad-ID (ISCI code), etc.

Instance Attribute Summary

Attributes inherited from Element

#source_node

Instance Method Summary collapse

Methods inherited from Element

#initialize

Constructor Details

This class inherits a constructor from VAST::Element

Instance Method Details

#api_frameworkObject

Defines the method to use for communication with the companion



42
43
44
# File 'lib/vast/mediafile.rb', line 42

def api_framework
  source_node[:apiFramework]
end

#bitrateObject

Bitrate of encoded video in Kbps



27
28
29
# File 'lib/vast/mediafile.rb', line 27

def bitrate
  source_node[:bitrate].to_i
end

#deliveryObject

Method of delivery of ad, either “streaming” or “progressive”



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

def delivery
  source_node[:delivery]
end

#heightObject

Pixel dimensions of video height



37
38
39
# File 'lib/vast/mediafile.rb', line 37

def height
  source_node[:height].to_i
end

#idObject



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

def id
  source_node[:id]
end

#maintain_aspect_ratio?Boolean

Whether the mediafile must have its aspect ratio maintained when scaled

Returns:

  • (Boolean)


52
53
54
# File 'lib/vast/mediafile.rb', line 52

def maintain_aspect_ratio?
  source_node[:maintainAspectRatio]=="true"
end

#scalable?Boolean

Whether it is acceptable to scale the mediafile.

Returns:

  • (Boolean)


47
48
49
# File 'lib/vast/mediafile.rb', line 47

def scalable?
  source_node[:scalable]=="true"
end

#typeObject

MIME type. Popular MIME types include, but are not limited to “video/x-ms-wmv” for Windows Media, and “video/x-flv” for Flash Video.



22
23
24
# File 'lib/vast/mediafile.rb', line 22

def type
  source_node[:type]
end

#urlObject

Location of linear file



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

def url
  URI.parse source_node.content
end

#widthObject

Pixel dimensions of video width



32
33
34
# File 'lib/vast/mediafile.rb', line 32

def width
  source_node[:width].to_i
end