class VAST::LinearCreative

LinearCreative is presented before, in the middle of, or after the video content is consumed by the user, in very much the same way a TV commercial can play before, during or after the chosen program.

Public Instance Methods

click_through_url() click to toggle source

URI to open as destination page when user clicks on the video

# File lib/vast/linear_creative.rb, line 17
def click_through_url
  URI.parse source_node.at('ClickThrough').content.strip
end
click_tracking_urls() click to toggle source

An array of URIs to request for tracking purposes when user clicks on the video

# File lib/vast/linear_creative.rb, line 22
def click_tracking_urls
  source_node.xpath('.//ClickTracking').to_a.collect do |node|
    URI.parse node.content.strip
  end
end
custom_click_urls() click to toggle source

A hash of URIs to request on custom events such as hotspotted video. This library required custom click urls to identify themselves with an ‘id` attribute, which is used as the key for this hash

# File lib/vast/linear_creative.rb, line 31
def custom_click_urls
  custom_click_urls = {}
  source_node.xpath('.//CustomClick').to_a.collect do |node|
    key = underscore(node[:id]).to_sym
    custom_click_urls[key] = URI.parse(node.content.strip)
  end
  custom_click_urls
end
duration() click to toggle source

Duration of creative

# File lib/vast/linear_creative.rb, line 7
def duration
  source_node.at('Duration').content
end
icons() click to toggle source
# File lib/vast/linear_creative.rb, line 50
def icons
  source_node.xpath('.//Icon').to_a.collect do |node|
    Icon.new(node)
  end
end
mediafiles() click to toggle source

Returns mediafiles containing the information required to display the linear creative’s media

It is assumed that all mediafiles accessible represent the same creative unit with the same duration, Ad-ID (ISCI code), etc.

# File lib/vast/linear_creative.rb, line 44
def mediafiles
  source_node.xpath('.//MediaFile').to_a.collect do |node|
    Mediafile.new(node)
  end
end
skipoffset() click to toggle source

VAST 3

# File lib/vast/linear_creative.rb, line 12
def skipoffset
  source_node[:skipoffset]
end