![]() |
![]() |
![]() |
GData Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Properties |
#include <gdata/services/youtube/gdata-youtube-service.h> GDataYouTubeService; GDataYouTubeServiceClass; enum GDataYouTubeServiceError; enum GDataYouTubeStandardFeedType; GDataYouTubeService * gdata_youtube_service_new (const gchar *developer_key, const gchar *client_id); GDataFeed * gdata_youtube_service_query_videos (GDataYouTubeService *self, GDataQuery *query, GCancellable *cancellable, GDataQueryProgressCallback progress_callback, gpointer progress_user_data, GError **error); void gdata_youtube_service_query_videos_async (GDataYouTubeService *self, GDataQuery *query, GCancellable *cancellable, GDataQueryProgressCallback progress_callback, gpointer progress_user_data, GAsyncReadyCallback callback, gpointer user_data); GDataYouTubeVideo * gdata_youtube_service_query_single_video (GDataYouTubeService *self, GDataQuery *query, const gchar *video_id, GCancellable *cancellable, GError **error); void gdata_youtube_service_query_single_video_async (GDataYouTubeService *self, GDataQuery *query, const gchar *video_id, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); GDataYouTubeVideo * gdata_youtube_service_query_single_video_finish (GDataYouTubeService *self, GAsyncResult *async_result, GError **error); GDataFeed * gdata_youtube_service_query_related (GDataYouTubeService *self, GDataYouTubeVideo *video, GDataQuery *query, GCancellable *cancellable, GDataQueryProgressCallback progress_callback, gpointer progress_user_data, GError **error); void gdata_youtube_service_query_related_async (GDataYouTubeService *self, GDataYouTubeVideo *video, GDataQuery *query, GCancellable *cancellable, GDataQueryProgressCallback progress_callback, gpointer progress_user_data, GAsyncReadyCallback callback, gpointer user_data); GDataFeed * gdata_youtube_service_query_standard_feed (GDataYouTubeService *self, GDataYouTubeStandardFeedType feed_type, GDataQuery *query, GCancellable *cancellable, GDataQueryProgressCallback progress_callback, gpointer progress_user_data, GError **error); void gdata_youtube_service_query_standard_feed_async (GDataYouTubeService *self, GDataYouTubeStandardFeedType feed_type, GDataQuery *query, GCancellable *cancellable, GDataQueryProgressCallback progress_callback, gpointer progress_user_data, GAsyncReadyCallback callback, gpointer user_data); GDataYouTubeVideo * gdata_youtube_service_upload_video (GDataYouTubeService *self, GDataYouTubeVideo *video, GFile *video_file, GCancellable *cancellable, GError **error); const gchar * gdata_youtube_service_get_developer_key (GDataYouTubeService *self); const gchar * gdata_youtube_service_get_youtube_user (GDataYouTubeService *self);
GDataYouTubeService is a subclass of GDataService for communicating with the GData API of YouTube. It supports querying for and uploading videos.
For more details of YouTube's GData API, see the online documentation.
typedef struct _GDataYouTubeService GDataYouTubeService;
All the fields in the GDataYouTubeService structure are private and should never be accessed directly.
typedef struct { } GDataYouTubeServiceClass;
All the fields in the GDataYouTubeServiceClass structure are private and should never be accessed directly.
typedef enum { GDATA_YOUTUBE_SERVICE_ERROR_API_QUOTA_EXCEEDED, GDATA_YOUTUBE_SERVICE_ERROR_ENTRY_QUOTA_EXCEEDED } GDataYouTubeServiceError;
Error codes for GDataYouTubeService operations.
typedef enum { GDATA_YOUTUBE_TOP_RATED_FEED, GDATA_YOUTUBE_TOP_FAVORITES_FEED, GDATA_YOUTUBE_MOST_VIEWED_FEED, GDATA_YOUTUBE_MOST_POPULAR_FEED, GDATA_YOUTUBE_MOST_RECENT_FEED, GDATA_YOUTUBE_MOST_DISCUSSED_FEED, GDATA_YOUTUBE_MOST_LINKED_FEED, GDATA_YOUTUBE_MOST_RESPONDED_FEED, GDATA_YOUTUBE_RECENTLY_FEATURED_FEED, GDATA_YOUTUBE_WATCH_ON_MOBILE_FEED } GDataYouTubeStandardFeedType;
Standard feed types for standard feed queries with gata_youtube_service_query_standard_feed()
. For more information, see
the online documentation.
This feed contains the most highly rated YouTube videos. | |
This feed contains videos most frequently flagged as favorite videos. | |
This feed contains the most frequently watched YouTube videos. | |
This feed contains the most popular YouTube videos, selected using an algorithm that combines many different signals to determine overall popularity. | |
This feed contains the videos most recently submitted to YouTube. | |
This feed contains the YouTube videos that have received the most comments. | |
This feed contains the YouTube videos that receive the most links from other websites. | |
This feed contains YouTube videos that receive the most video responses. | |
This feed contains videos recently featured on the YouTube home page or featured videos tab. | |
This feed contains videos suitable for playback on mobile devices. |
GDataYouTubeService * gdata_youtube_service_new (const gchar *developer_key, const gchar *client_id);
Creates a new GDataYouTubeService. The developer_key
and client_id
must be unique for your application, and as
registered with Google.
|
your application's developer API key |
|
your application's client ID |
Returns : |
a new GDataYouTubeService, or NULL
|
GDataFeed * gdata_youtube_service_query_videos (GDataYouTubeService *self, GDataQuery *query, GCancellable *cancellable, GDataQueryProgressCallback progress_callback, gpointer progress_user_data, GError **error);
Queries the service for videos matching the parameters set on the GDataQuery. This searches site-wide, and imposes no other restrictions or parameters on the query.
Parameters and errors are as for gdata_service_query()
.
|
a GDataYouTubeService |
|
a GDataQuery with the query parameters, or NULL
|
|
optional GCancellable object, or NULL
|
|
a GDataQueryProgressCallback to call when an entry is loaded, or NULL
|
|
data to pass to the progress_callback function
|
|
a GError, or NULL
|
Returns : |
a GDataFeed of query results; unref with g_object_unref()
|
void gdata_youtube_service_query_videos_async (GDataYouTubeService *self, GDataQuery *query, GCancellable *cancellable, GDataQueryProgressCallback progress_callback, gpointer progress_user_data, GAsyncReadyCallback callback, gpointer user_data);
Queries the service for videos matching the parameters set on the GDataQuery. This searches site-wide, and imposes no other restrictions or
parameters on the query. self
and query
are both reffed when this function is called, so can safely be freed after this function returns.
For more details, see gdata_youtube_service_query_videos()
, which is the synchronous version of this function.
When the operation is finished, callback
will be called. You can then call gdata_service_query_finish()
to get the results of the operation.
|
a GDataService |
|
a GDataQuery with the query parameters, or NULL
|
|
optional GCancellable object, or NULL
|
|
a GDataQueryProgressCallback to call when an entry is loaded, or NULL
|
|
data to pass to the progress_callback function
|
|
a GAsyncReadyCallback to call when authentication is finished |
|
data to pass to the callback function
|
GDataYouTubeVideo * gdata_youtube_service_query_single_video (GDataYouTubeService *self, GDataQuery *query, const gchar *video_id, GCancellable *cancellable, GError **error);
Retrieves information about the single video with the given video_id
. video_id
should be as returned by
gdata_youtube_video_get_video_id()
or as extracted from a YouTube URI.
Parameters and errors are as for gdata_service_query()
.
|
a GDataYouTubeService |
|
a GDataQuery with the query parameters, or NULL
|
|
the video ID of the desired video |
|
a GCancellable, or NULL
|
|
a GError, or NULL
|
Returns : |
a GDataYouTubeVideo, or NULL ; unref with g_object_unref()
|
Since 0.4.0
void gdata_youtube_service_query_single_video_async (GDataYouTubeService *self, GDataQuery *query, const gchar *video_id, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data);
Retrieves information about the single video with the given video_id
. video_id
should be as returned by
gdata_youtube_video_get_video_id()
or as extracted from a YouTube URI. self
, query
and video_id
are reffed/copied when this
function is called, so can safely be freed after this function returns.
For more details, see gdata_youtube_service_query_single_video()
, which is the synchronous version of this function.
When the operation is finished, callback
will be called. You can then call gdata_youtube_service_query_single_video_finish()
to get the results of the operation.
|
a GDataService |
|
a GDataQuery with the query parameters, or NULL
|
|
the video ID of the desired video |
|
optional GCancellable object, or NULL
|
|
a GAsyncReadyCallback to call when authentication is finished |
|
data to pass to the callback function
|
Since 0.4.0
GDataYouTubeVideo * gdata_youtube_service_query_single_video_finish (GDataYouTubeService *self, GAsyncResult *async_result, GError **error);
Finishes an asynchronous query operation for a single video, as started with gdata_youtube_service_query_single_video_async()
.
|
a GDataYouTubeService |
|
a GAsyncResult |
|
a GError, or NULL
|
Returns : |
a GDataYouTubeVideo, or NULL ; unref with g_object_unref()
|
Since 0.4.0
GDataFeed * gdata_youtube_service_query_related (GDataYouTubeService *self, GDataYouTubeVideo *video, GDataQuery *query, GCancellable *cancellable, GDataQueryProgressCallback progress_callback, gpointer progress_user_data, GError **error);
Queries the service for videos related to video
. The algorithm determining which videos are related is on the server side.
If video
does not have a link with rel value http://gdata.youtube.com/schemas/2007video.related
, a
GDATA_SERVICE_ERROR_PROTOCOL_ERROR
error will be thrown. Parameters and other errors are as for gdata_service_query()
.
|
a GDataYouTubeService |
|
a GDataYouTubeVideo for which to find related videos |
|
a GDataQuery with the query parameters, or NULL
|
|
optional GCancellable object, or NULL
|
|
a GDataQueryProgressCallback to call when an entry is loaded, or NULL
|
|
data to pass to the progress_callback function
|
|
a GError, or NULL
|
Returns : |
a GDataFeed of query results; unref with g_object_unref()
|
void gdata_youtube_service_query_related_async (GDataYouTubeService *self, GDataYouTubeVideo *video, GDataQuery *query, GCancellable *cancellable, GDataQueryProgressCallback progress_callback, gpointer progress_user_data, GAsyncReadyCallback callback, gpointer user_data);
Queries the service for videos related to video
. The algorithm determining which videos are related is on the server side.
self
and query
are both reffed when this function is called, so can safely be freed after this function returns.
For more details, see gdata_youtube_service_query_related()
, which is the synchronous version of this function.
When the operation is finished, callback
will be called. You can then call gdata_service_query_finish()
to get the results of the operation.
|
a GDataService |
|
a GDataYouTubeVideo for which to find related videos |
|
a GDataQuery with the query parameters, or NULL
|
|
optional GCancellable object, or NULL
|
|
a GDataQueryProgressCallback to call when an entry is loaded, or NULL
|
|
data to pass to the progress_callback function
|
|
a GAsyncReadyCallback to call when authentication is finished |
|
data to pass to the callback function
|
GDataFeed * gdata_youtube_service_query_standard_feed (GDataYouTubeService *self, GDataYouTubeStandardFeedType feed_type, GDataQuery *query, GCancellable *cancellable, GDataQueryProgressCallback progress_callback, gpointer progress_user_data, GError **error);
Queries the service's standard feed_type
feed to build a GDataFeed.
Parameters and errors are as for gdata_service_query()
.
|
a GDataYouTubeService |
|
the feed type to query, from GDataYouTubeStandardFeedType |
|
a GDataQuery with the query parameters, or NULL
|
|
optional GCancellable object, or NULL
|
|
a GDataQueryProgressCallback to call when an entry is loaded, or NULL
|
|
data to pass to the progress_callback function
|
|
a GError, or NULL
|
Returns : |
a GDataFeed of query results; unref with g_object_unref()
|
void gdata_youtube_service_query_standard_feed_async (GDataYouTubeService *self, GDataYouTubeStandardFeedType feed_type, GDataQuery *query, GCancellable *cancellable, GDataQueryProgressCallback progress_callback, gpointer progress_user_data, GAsyncReadyCallback callback, gpointer user_data);
Queries the service's standard feed_type
feed to build a GDataFeed. self
and
query
are both reffed when this function is called, so can safely be freed after this function returns.
For more details, see gdata_youtube_service_query_standard_feed()
, which is the synchronous version of this function.
When the operation is finished, callback
will be called. You can then call gdata_service_query_finish()
to get the results of the operation.
|
a GDataService |
|
the feed type to query, from GDataYouTubeStandardFeedType |
|
a GDataQuery with the query parameters, or NULL
|
|
optional GCancellable object, or NULL
|
|
a GDataQueryProgressCallback to call when an entry is loaded, or NULL
|
|
data to pass to the progress_callback function
|
|
a GAsyncReadyCallback to call when authentication is finished |
|
data to pass to the callback function
|
GDataYouTubeVideo * gdata_youtube_service_upload_video (GDataYouTubeService *self, GDataYouTubeVideo *video, GFile *video_file, GCancellable *cancellable, GError **error);
Uploads a video to YouTube, using the properties from video
and the video file pointed to by video_file
.
If video
has already been inserted, a GDATA_SERVICE_ERROR_ENTRY_ALREADY_INSERTED
error will be returned. If no user is authenticated
with the service, GDATA_SERVICE_ERROR_AUTHENTICATION_REQUIRED
will be returned.
If there is a problem reading video_file
, an error from g_file_load_contents()
or g_file_query_info()
will be returned. Other errors from
GDataServiceError can be returned for other exceptional conditions, as determined by the server.
|
a GDataYouTubeService |
|
a GDataYouTubeVideo to insert |
|
the video file to upload |
|
optional GCancellable object, or NULL
|
|
a GError, or NULL
|
Returns : |
the inserted GDataYouTubeVideo with updated properties from video ; unref with g_object_unref()
|
const gchar * gdata_youtube_service_get_developer_key (GDataYouTubeService *self);
Gets the "developer-key" property from the GDataYouTubeService.
|
a GDataYouTubeService |
Returns : |
the developer key property |
"developer-key"
property"developer-key" gchar* : Read / Write / Construct Only
The developer key your application has registered with the YouTube API. For more information, see the online documentation.
The matching "client-id" property belongs to GDataService.
Default value: NULL