search method
Enumerates videos returned by the specified search query (from the video search page). The videos are sent in batch of 20 videos. You VideoSearchList.nextPage to get the next batch of videos.
Implementation
Future<VideoSearchList> search(
String searchQuery, {
SearchFilter filter = TypeFilters.video,
}) async {
final page = await SearchPage.get(_httpClient, searchQuery, filter: filter);
return VideoSearchList(
page.searchContent
.whereType<SearchVideo>()
.map(
(e) => Video(
e.id,
e.title,
e.author,
ChannelId(e.channelId),
e.uploadDate.toDateTime(),
e.uploadDate?.toString(),
null,
e.description,
e.duration.toDuration(),
ThumbnailSet(e.id.value),
null,
Engagement(e.viewCount, null, null),
e.isLive,
),
)
.toList(),
page,
_httpClient,
);
}