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
コード例 #1
0
ファイル: SongController.php プロジェクト: phanan/koel
 /**
  * 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()]);
 }
コード例 #2
0
ファイル: YouTubeController.php プロジェクト: phanan/koel
 /**
  * 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));
 }