Module: Yt::Annotations::For

Included in:
Yt::Annotations
Defined in:
lib/yt/annotations/for.rb

Overview

Provides a method to fetch annotations and cards for a YouTube video.

Instance Method Summary collapse

Instance Method Details

#for(video_id) ⇒ Array<Yt::Annotation>

Returns the annotations/end cards of the video.

Parameters:

  • video_id (String)

    the unique ID of a YouTube video.

Returns:

  • (Array<Yt::Annotation>)

    the annotations/end cards of the video.



20
21
22
# File 'lib/yt/annotations/for.rb', line 20

def for(video_id)
  (annotations(video_id) + end_screens(video_id)).sort_by(&:starts_at)
end