Video

Video

Represents a YouTube video

Constructor

new Video(youtube, data)

Source:
Parameters:
Name Type Description
youtube YouTube The YouTube instance creating this
data Object The data of the video

Members

channel :Channel

The channel this video is in.
Source:
Type:

description :string

This video's description
Source:
Type:
  • string

(nullable) duration :DurationObject

The duration of the video
Source:
Type:

durationSeconds :number

The duration of the video in seconds
Source:
Type:
  • number

full :boolean

Whether this is a full (returned from the videos API end point) or partial video (returned as part of another resource).
Source:
Type:
  • boolean

id :string

This video's ID
Source:
Type:
  • string

kind :string

The resource that this video was created from.
Source:
Type:
  • string

maxRes :object

The maxiumum available resolution thumbnail.
Source:
Type:
  • object

publishedAt :Date

The date/time this video was published
Source:
Type:
  • Date

raw :object

The raw data from the YouTube API.
Source:
Type:
  • object

shortURL :string

The short URL to this video
Source:
Type:
  • string

thumbnails :Object.<'default', 'medium', 'high', 'standard', 'maxres'>

The thumbnails of this video.
Source:
Type:
  • Object.<'default', 'medium', 'high', 'standard', 'maxres'>

title :string

This video's title
Source:
Type:
  • string

type :string

The type to filter search results
Source:
Type:
  • string

url :string

The URL to this video
Source:
Type:
  • string

youtube :YouTube

The YouTube instance that created this
Source:
Type:

Methods

(static) extractID(url) → (nullable) {string}

Get a video ID from a string (URL or ID)
Source:
Parameters:
Name Type Description
url string The string to get the ID from
Returns:
Type:
string

fetch(optionsopt) → {Video}

Fetch the full representation of this video.
Source:
Parameters:
Name Type Attributes Description
options object <optional>
Any extra query params
Returns:
Type:
Video