getRelatedYouTubeVideos() public method

Get the YouTube videos related to this song.
public getRelatedYouTubeVideos ( string $youTubePageToken = '' ) : object | false
$youTubePageToken string The YouTube page token, for pagination purpose.
return object | false
Example #1
0
 /**
  * Get extra information about a song via Last.fm.
  *
  * @param Song $song
  *
  * @return \Illuminate\Http\JsonResponse
  */
 public function show(Song $song)
 {
     return response()->json(['lyrics' => $song->lyrics, 'album_info' => $song->album->getInfo(), 'artist_info' => $song->artist->getInfo(), 'youtube' => $song->getRelatedYouTubeVideos()]);
 }
Example #2
0
 /**
  * Search for YouTube videos related to a song (using its title and artist name).
  *
  * @param Request $request
  * @param Song    $song
  *
  * @return \Illuminate\Http\JsonResponse
  */
 public function searchVideosRelatedToSong(Request $request, Song $song)
 {
     return response()->json($song->getRelatedYouTubeVideos($request->pageToken));
 }