PHP Class App\services\YouTube

Show file Open project: phanan/koel Class Usage Examples

Public Methods

Method Description
__construct ( string $key = null, Client $client = null ) Construct an instance of YouTube service.
enabled ( ) : boolean Determine if our application is using YouTube.
search ( string $q, string $pageToken = '', integer $perPage = 10 ) : object | false Search for YouTube videos by a query string.
searchVideosRelatedToSong ( Song $song, string $pageToken = '' ) : object | false Search for YouTube videos related to a song.

Method Details

__construct() public method

Construct an instance of YouTube service.
public __construct ( string $key = null, Client $client = null )
$key string The YouTube API key
$client GuzzleHttp\Client The Guzzle HTTP client

enabled() public method

Determine if our application is using YouTube.
public enabled ( ) : boolean
return boolean

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