mirror of
https://github.com/koel/koel
synced 2024-12-23 19:13:06 +00:00
23 lines
549 B
PHP
23 lines
549 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\API;
|
|
|
|
use App\Models\Song;
|
|
use Illuminate\Http\Request;
|
|
use YouTube;
|
|
|
|
class YouTubeController extends Controller
|
|
{
|
|
/**
|
|
* 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));
|
|
}
|
|
}
|