VideoId constructor

VideoId(
  1. String idOrUrl
)

Initializes an instance of VideoId with a url or video id.

Implementation

factory VideoId(String idOrUrl) {
  final id = parseVideoId(idOrUrl);

  if (id == null) {
    throw ArgumentError.value(
        idOrUrl, 'urlOrUrl', 'Invalid YouTube video ID or URL');
  }
  return VideoId._internal(id);
}