App\services\YouTube::searchVideosRelatedToSong PHP Method

searchVideosRelatedToSong() public method

Search for YouTube videos related to a song.
public searchVideosRelatedToSong ( Song $song, string $pageToken = '' ) : object | false
$song app\models\Song
$pageToken string
return object | false
    public function searchVideosRelatedToSong(Song $song, $pageToken = '')
    {
        $q = $song->title;
        // If the artist is worth noticing, include them into the search.
        if (!$song->artist->isUnknown() && !$song->artist->isVarious()) {
            $q .= ' ' . $song->artist->name;
        }
        return $this->search($q, $pageToken);
    }