Class: Yt::Annotations::EndScreen

Inherits:
Base
  • Object
show all
Defined in:
lib/yt/annotations/end_screen.rb

Overview

An end screen annotation shows in the last 5 to seconds of the video.

Instance Attribute Summary

Attributes inherited from Base

#ends_at, #link, #starts_at, #text

Instance Method Summary collapse

Constructor Details

#initialize(json = {}) ⇒ EndScreen

Returns a new instance of EndScreen.

Parameters:

  • json (Hash) (defaults to: {})

    the Hash representation of the XML data returned by YouTube for each end screen of a video.



9
10
11
12
13
14
# File 'lib/yt/annotations/end_screen.rb', line 9

def initialize(json = {})
  @text = text_in json
  @starts_at = json['startMs'].to_i / 1000.0
  @ends_at = ends_at_in json
  @link = to_link json
end