Functions
Function | Description |
---|---|
createActivity |
Creates a bulletin and posts it to the authenticated user's channel. |
createPlaylist |
Creates a new playlist for the authenticated user. |
createPlaylistItem |
Adds a video to a playlist. |
deletePlaylist |
Deletes a playlist owned by the authenticated user. |
deletePlaylistItem |
Deletes a playlist item owned by the authenticated user. |
deleteVideo |
Deletes a video (must be owned by the authenticated user). |
getActivities |
Returns a list of activities for a channel. |
getCategories |
Returns a list of YouTube categories. |
getChannel |
Returns channel information for a given ID or username. |
getChannelVideos |
Returns the videos for a given channel ID. |
getPlaylist |
Returns a playlist with the given ID. |
getPlaylists |
Returns playlists for a given channel (or the authenticated user's playlist if user is not specified) |
getPlaylistItems |
Returns the videos in a given playlist. |
getSubscribers |
Returns a list of channel IDs that are subscribed to the authenticated user. |
getSubscriptions |
Returns a list of channels the authenticated user is subscribed to. |
getVideo |
Gets information about a given video ID. |
rateVideo |
Causes the authenticated user to set/clear a rating on a video. |
searchChannels |
Searches YouTube for channels |
searchVideos |
Searches YouTube for videos |
subscribe |
Subscribes the authenticated user to a given channel ID. |
timeJoin |
Joins a time object made by timeSplit into one readable by the YouTube API. |
timeSplit |
Splits a YouTube video time length into an object. |
unsubscribe |
Unsubscribes the authenticated user from a given channel ID. |
updatePlaylist |
Updates a playlist that is owned by the authenticated user. |
updatePlaylistItem |
Updates the details of an item in a playlist. |
createActivity
Creates a bulletin and posts it to the authenticated user's channel.
Return Value: A BigTreeYouTubeActivity object on success.
createActivity($bulletin)
Parameter | Description |
---|---|
$bulletin |
The message to post |
createPlaylist
Creates a new playlist for the authenticated user.
Return Value: A BigTreeYouTubePlaylist object on success.
createPlaylist($title, $description, $privacy, $tags)
Parameter | Description |
---|---|
$title |
The title of the playlist |
$description |
The description of the playlist (optional) |
$privacy |
The privacy status of the playlist (optional, defaults to public) |
$tags |
An array of tags to tag to the playlist (optional) |
createPlaylistItem
Adds a video to a playlist.
Authenticated user must be the owner of the playlist.
*Currently note/start_at/end_at do not seem to be supported by the YouTube API.
Return Value: A BigTreeYouTubePlaylistItem object on success.
createPlaylistItem($playlist, $video, $position = false, $note = false, $start_at = false, $end_at = false)
Parameter | Description |
---|---|
$playlist |
The ID of the playlist to add the video to |
$video |
The ID of the video to add |
$position |
Position to place the video in the playlist (optional) |
$note |
A note to attach to the video (optional) |
$start_at |
Time object (stdClass with Hours, Minutes, Seconds properties) to set as the start point for the video (optional) |
$end_at |
Time object (stdClass with Hours, Minutes, Seconds properties) to set as the end point for the video (optional) |
deletePlaylist
Deletes a playlist owned by the authenticated user.
deletePlaylist($id)
Parameter | Description |
---|---|
$id |
The ID of the playlist to delete. |
deletePlaylistItem
Deletes a playlist item owned by the authenticated user.
deletePlaylistItem($id)
Parameter | Description |
---|---|
$id |
The ID of the playlist item to delete. |
deleteVideo
Deletes a video (must be owned by the authenticated user).
deleteVideo($id)
Parameter | Description |
---|---|
$id |
The ID of the video to delete. |
getActivities
Returns a list of activities for a channel.
Return Value: A BigTreeGoogleResultSet of BigTreeYouTubeActivity objects.
getActivities($channel, $count, $params)
Parameter | Description |
---|---|
$channel |
A channel ID or "home" (default) for all the channels the authenticated user follows or "mine" for the authenticated user's activities |
$count |
The number of activities to return (default 10, max 50) |
$params |
Additional parameters to pass to the activities API call. |
getCategories
Returns a list of YouTube categories.
Return Value: A key/value array of id => category name.
getCategories($region = "US")
Parameter | Description |
---|---|
$region |
ISO 3166 country code (defaults to US) |
getChannel
Returns channel information for a given ID or username.
If neither a username or password is provided, the authenticated user's channel is returned.
Return Value: A BigTreeYouTubeChannel object.
getChannel($username = false, $id = false)
Parameter | Description |
---|---|
$username |
The channel username (optional) |
$id |
The channel ID (optional) |
getChannelVideos
Returns the videos for a given channel ID.
Return Value: A BigTreeGoogleResultSet of BigTreeYouTubeVideo objects.
getChannelVideos($channel, $count, $order, $params)
Parameter | Description |
---|---|
$channel |
The channel ID to retrieve videos for. |
$count |
Number of videos to return (defaults to 10). |
$order |
The order to sort by (options are date, rating, relevance, title, viewCount) — defaults to date. |
$params |
Additional parameters to pass to the search API call. |
getPlaylist
Returns a playlist with the given ID.
Return Value: A BigTreeYouTubePlaylist object.
getPlaylist($id)
Parameter | Description |
---|---|
$id |
The ID of the playlist to return. |
getPlaylists
Returns playlists for a given channel (or the authenticated user's playlist if user is not specified)
Return Value: A BigTreeGoogleResultSet of BigTreeYouTubePlaylist objects.
getPlaylists($channel, $count, $params)
Parameter | Description |
---|---|
$channel |
The channel ID to pull playlists for (or false to use the authenticated user's) |
$count |
The number of results to return per page (defaults to 50, max 50) |
$params |
Additional parameters to pass to the subscriptions API call. |
getPlaylistItems
Returns the videos in a given playlist.
getPlaylistItems($playlist, $count, $params, $Return:, $A BigTreeGoogleResultSet of BigTreeYouTubePlaylistItem objects.)
Parameter | Description |
---|---|
$playlist |
The playlist ID to retrieve videos for. |
$count |
The number of results to return per page (defaults to 50, max 50) |
$params |
Additional parameters to pass to the playlistItems API call. |
$Return: |
|
$A BigTreeGoogleResultSet of BigTreeYouTubePlaylistItem objects. |
getSubscribers
Returns a list of channel IDs that are subscribed to the authenticated user.
Return Value: A BigTreeGoogleResultSet of channel IDs.
getSubscribers($count, $order, $params)
Parameter | Description |
---|---|
$count |
The number of results to return per page (defaults to 50, max 50) |
$order |
Sort order (options are "alphabetical", "relevance", "unread" — defaults to "relevance") |
$params |
Additional parameters to pass to the subscriptions API call. |
getSubscriptions
Returns a list of channels the authenticated user is subscribed to.
Return Value: A BigTreeGoogleResultSet of BigTreeYouTubeSubscription objects.
getSubscriptions($count, $order, $params)
Parameter | Description |
---|---|
$count |
The number of results to return per page (defaults to 50, max 50) |
$order |
Sort order (options are "alphabetical", "relevance", "unread" — defaults to "relevance") |
$params |
Additional parameters to pass to the videos API call. |
getVideo
Gets information about a given video ID.
Return Value: A BigTreeYouTubeVideo object.
getVideo($id, $params)
Parameter | Description |
---|---|
$id |
The video ID to retrieve information for. |
$params |
Additional parameters to pass to the videos API call. |
rateVideo
Causes the authenticated user to set/clear a rating on a video.
Return Value: true on success.
rateVideo($id, $rating)
Parameter | Description |
---|---|
$id |
The video ID to rate. |
$rating |
"like", "dislike", or "none" (for clearing an existing rating) |
searchChannels
Searches YouTube for channels
searchChannels($query, $order, $count, $params)
Parameter | Description |
---|---|
$query |
A string to search for. |
$order |
The order to sort by (options are date, rating, relevance, title, videoCount, viewCount) — defaults to relevance. |
$count |
Number of videos to return (defaults to 10). |
$params |
Additional parameters to pass to the search API call. |
searchVideos
Searches YouTube for videos
searchVideos($query, $order, $count, $params)
Parameter | Description |
---|---|
$query |
A string to search for. |
$order |
The order to sort by (options are date, rating, relevance, title, viewCount) — defaults to relevance. |
$count |
Number of videos to return (defaults to 10). |
$params |
Additional parameters to pass to the search API call. |
subscribe
Subscribes the authenticated user to a given channel ID.
subscribe($channel)
Parameter | Description |
---|---|
$channel |
Channel ID to subscribe to. |
timeJoin
Joins a time object made by timeSplit into one readable by the YouTube API.
timeJoin()
timeSplit
Splits a YouTube video time length into an object.
timeSplit()
unsubscribe
Unsubscribes the authenticated user from a given channel ID.
unsubscribe($channel)
Parameter | Description |
---|---|
$channel |
Channel ID to unsubscribe from. |
updatePlaylist
Updates a playlist that is owned by the authenticated user.
Return Value: true on success.
updatePlaylist($id, $title, $description, $privacy, $tags)
Parameter | Description |
---|---|
$id |
The ID of the playlist. |
$title |
The new title for the playlist. |
$description |
The new description for the playlist (optional). |
$privacy |
The new privacy status for the playlist (optional, defaults to public). |
$tags |
The new tags for the playlist (optional, array). |
updatePlaylistItem
Updates the details of an item in a playlist.
Authenticated user must be the owner of the playlist.
*Currently note/start_at/end_at do not seem to be supported by the YouTube API.
Return Value: A BigTreeYouTubePlaylistItem object on success.
updatePlaylistItem($item, $playlist, $video, $position = false, $note = false, $start_at = false, $end_at = false)
Parameter | Description |
---|---|
$item |
The ID of the playlist item to update |
$playlist |
The ID of the playlist this item is in |
$video |
The video ID for this playlist item |
$position |
Position to place the video in the playlist (optional) |
$note |
A note to attach to the video (optional) |
$start_at |
Time object (stdClass with Hours, Minutes, Seconds properties) to set as the start point for the video (optional) |
$end_at |
Time object (stdClass with Hours, Minutes, Seconds properties) to set as the end point for the video (optional) |