GDataYouTubeVideo

GDataYouTubeVideo — GData YouTube video object

Stability Level

Unstable, unless otherwise indicated

Synopsis


#include <gdata/services/youtube/gdata-youtube-video.h>

                    GDataYouTubeVideo;
                    GDataYouTubeVideoClass;
GDataYouTubeVideo * gdata_youtube_video_new             (const gchar *id);
GDataYouTubeVideo * gdata_youtube_video_new_from_xml    (const gchar *xml,
                                                         gint length,
                                                         GError **error);
GDataMediaContent * gdata_youtube_video_look_up_content (GDataYouTubeVideo *self,
                                                         const gchar *type);
GList *             gdata_youtube_video_get_thumbnails  (GDataYouTubeVideo *self);
GDataMediaCategory * gdata_youtube_video_get_category   (GDataYouTubeVideo *self);
void                gdata_youtube_video_set_category    (GDataYouTubeVideo *self,
                                                         GDataMediaCategory *category);
GDataMediaCredit *  gdata_youtube_video_get_credit      (GDataYouTubeVideo *self);
const gchar *       gdata_youtube_video_get_description (GDataYouTubeVideo *self);
void                gdata_youtube_video_set_description (GDataYouTubeVideo *self,
                                                         const gchar *description);
guint               gdata_youtube_video_get_duration    (GDataYouTubeVideo *self);
const gchar *       gdata_youtube_video_get_keywords    (GDataYouTubeVideo *self);
void                gdata_youtube_video_set_keywords    (GDataYouTubeVideo *self,
                                                         const gchar *keywords);
const gchar *       gdata_youtube_video_get_location    (GDataYouTubeVideo *self);
void                gdata_youtube_video_set_location    (GDataYouTubeVideo *self,
                                                         const gchar *location);
guint               gdata_youtube_video_get_view_count  (GDataYouTubeVideo *self);
guint               gdata_youtube_video_get_favorite_count
                                                        (GDataYouTubeVideo *self);
GDataMediaRating *  gdata_youtube_video_get_media_rating
                                                        (GDataYouTubeVideo *self);
gboolean            gdata_youtube_video_get_no_embed    (GDataYouTubeVideo *self);
void                gdata_youtube_video_set_no_embed    (GDataYouTubeVideo *self,
                                                         gboolean no_embed);
const gchar *       gdata_youtube_video_get_player_uri  (GDataYouTubeVideo *self);
gboolean            gdata_youtube_video_is_private      (GDataYouTubeVideo *self);
void                gdata_youtube_video_set_is_private  (GDataYouTubeVideo *self,
                                                         gboolean is_private);
gboolean            gdata_youtube_video_is_draft        (GDataYouTubeVideo *self);
void                gdata_youtube_video_set_is_draft    (GDataYouTubeVideo *self,
                                                         gboolean is_draft);
GDataYouTubeState * gdata_youtube_video_get_state       (GDataYouTubeVideo *self);
GDataGDRating *     gdata_youtube_video_get_rating      (GDataYouTubeVideo *self);
GDataMediaRestriction * gdata_youtube_video_get_restriction
                                                        (GDataYouTubeVideo *self);
const gchar *       gdata_youtube_video_get_title       (GDataYouTubeVideo *self);
void                gdata_youtube_video_set_title       (GDataYouTubeVideo *self,
                                                         const gchar *title);
void                gdata_youtube_video_get_uploaded    (GDataYouTubeVideo *self,
                                                         GTimeVal *uploaded);
const gchar *       gdata_youtube_video_get_video_id    (GDataYouTubeVideo *self);

Object Hierarchy

  GObject
   +----GDataEntry
         +----GDataYouTubeVideo

Properties

  "category"                 gpointer              : Read / Write
  "credit"                   gpointer              : Read
  "description"              gchar*                : Read / Write
  "duration"                 guint                 : Read
  "favorite-count"           guint                 : Read
  "is-draft"                 gboolean              : Read / Write
  "is-private"               gboolean              : Read / Write
  "keywords"                 gchar*                : Read / Write
  "location"                 gchar*                : Read / Write
  "media-rating"             gpointer              : Read
  "no-embed"                 gboolean              : Read / Write
  "player-uri"               gchar*                : Read
  "rating"                   gpointer              : Read
  "restriction"              gpointer              : Read
  "state"                    gpointer              : Read
  "title"                    gchar*                : Read / Write
  "uploaded"                 GTimeVal*             : Read
  "video-id"                 gchar*                : Read
  "view-count"               guint                 : Read

Description

GDataYouTubeVideo is a subclass of GDataEntry to represent a single video on YouTube, either when uploading or querying.

For more details of YouTube's GData API, see the online documentation.

Details

GDataYouTubeVideo

typedef struct _GDataYouTubeVideo GDataYouTubeVideo;

All the fields in the GDataYouTubeVideo structure are private and should never be accessed directly.


GDataYouTubeVideoClass

typedef struct {
} GDataYouTubeVideoClass;

All the fields in the GDataYouTubeVideoClass structure are private and should never be accessed directly.


gdata_youtube_video_new ()

GDataYouTubeVideo * gdata_youtube_video_new             (const gchar *id);

Creates a new GDataYouTubeVideo with the given ID and default properties.

id :

the video's ID, or NULL

Returns :

a new GDataYouTubeVideo; unref with g_object_unref()

gdata_youtube_video_new_from_xml ()

GDataYouTubeVideo * gdata_youtube_video_new_from_xml    (const gchar *xml,
                                                         gint length,
                                                         GError **error);

Creates a new GDataYouTubeVideo from an XML string. If length is -1, the length of the string will be calculated.

Errors from GDataParserError can be returned if problems are found in the XML.

xml :

an XML string

length :

the length in characters of xml, or -1

error :

a GError, or NULL

Returns :

a new GDataYouTubeVideo, or NULL; unref with g_object_unref()

gdata_youtube_video_look_up_content ()

GDataMediaContent * gdata_youtube_video_look_up_content (GDataYouTubeVideo *self,
                                                         const gchar *type);

Looks up a GDataMediaContent from the video with the given MIME type. The video's list of contents is a list of URIs to various formats of the video itself, such as its SWF URI or RTSP stream.

self :

a GDataYouTubeVideo

type :

the MIME type of the content desired

Returns :

a GDataMediaContent matching type, or NULL

gdata_youtube_video_get_thumbnails ()

GList *             gdata_youtube_video_get_thumbnails  (GDataYouTubeVideo *self);

Gets a list of the thumbnails available for the video.

self :

a GDataYouTubeVideo

Returns :

a GList of GDataMediaThumbnails, or NULL

gdata_youtube_video_get_category ()

GDataMediaCategory * gdata_youtube_video_get_category   (GDataYouTubeVideo *self);

Gets the "category" property.

self :

a GDataYouTubeVideo

Returns :

a GDataMediaCategory giving the video's single and mandatory category

gdata_youtube_video_set_category ()

void                gdata_youtube_video_set_category    (GDataYouTubeVideo *self,
                                                         GDataMediaCategory *category);

Sets the "category" property to the new category, category.

category must not be NULL. For more information, see the online documentation.

self :

a GDataYouTubeVideo

category :

a new GDataMediaCategory

gdata_youtube_video_get_credit ()

GDataMediaCredit *  gdata_youtube_video_get_credit      (GDataYouTubeVideo *self);

Gets the "credit" property.

self :

a GDataYouTubeVideo

Returns :

a GDataMediaCredit giving information on who to credit for the video, or NULL

gdata_youtube_video_get_description ()

const gchar *       gdata_youtube_video_get_description (GDataYouTubeVideo *self);

Gets the "description" property.

self :

a GDataYouTubeVideo

Returns :

the video's long text description, or NULL

gdata_youtube_video_set_description ()

void                gdata_youtube_video_set_description (GDataYouTubeVideo *self,
                                                         const gchar *description);

Sets the "description" property to the new description, description.

Set description to NULL to unset the video's description.

self :

a GDataYouTubeVideo

description :

the video's new description

gdata_youtube_video_get_duration ()

guint               gdata_youtube_video_get_duration    (GDataYouTubeVideo *self);

Gets the "duration" property.

self :

a GDataYouTubeVideo

Returns :

the video duration in seconds, or 0 if unknown

gdata_youtube_video_get_keywords ()

const gchar *       gdata_youtube_video_get_keywords    (GDataYouTubeVideo *self);

Gets the "keywords" property.

self :

a GDataYouTubeVideo

Returns :

a comma-separated list of words associated with the video

gdata_youtube_video_set_keywords ()

void                gdata_youtube_video_set_keywords    (GDataYouTubeVideo *self,
                                                         const gchar *keywords);

Sets the "keywords" property to the new keyword list, keywords.

keywords must not be NULL. For more information, see the online documentation.

self :

a GDataYouTubeVideo

keywords :

a new comma-separated list of keywords

gdata_youtube_video_get_location ()

const gchar *       gdata_youtube_video_get_location    (GDataYouTubeVideo *self);

Gets the "location" property.

self :

a GDataYouTubeVideo

Returns :

a string describing the video's location, or NULL

gdata_youtube_video_set_location ()

void                gdata_youtube_video_set_location    (GDataYouTubeVideo *self,
                                                         const gchar *location);

Sets the "location" property to the new location string, location.

Set location to NULL to unset the property in the video.

self :

a GDataYouTubeVideo

location :

a new location, or NULL

gdata_youtube_video_get_view_count ()

guint               gdata_youtube_video_get_view_count  (GDataYouTubeVideo *self);

Gets the "view-count" property.

self :

a GDataYouTubeVideo

Returns :

the number of times the video has been viewed

gdata_youtube_video_get_favorite_count ()

guint               gdata_youtube_video_get_favorite_count
                                                        (GDataYouTubeVideo *self);

Gets the "favorite-count" property.

self :

a GDataYouTubeVideo

Returns :

the number of users who have added the video to their favorites list

gdata_youtube_video_get_media_rating ()

GDataMediaRating *  gdata_youtube_video_get_media_rating
                                                        (GDataYouTubeVideo *self);

Gets the "media-rating" property.

self :

a GDataYouTubeVideo

Returns :

a GDataMediaRating giving information about restrictions on the video, or NULL if there are none

gdata_youtube_video_get_no_embed ()

gboolean            gdata_youtube_video_get_no_embed    (GDataYouTubeVideo *self);

Gets the "no-embed" property.

self :

a GDataYouTubeVideo

Returns :

TRUE if the video cannot be embedded on web pages, FALSE otherwise

gdata_youtube_video_set_no_embed ()

void                gdata_youtube_video_set_no_embed    (GDataYouTubeVideo *self,
                                                         gboolean no_embed);

Sets the "no-embed" property to no_embed.

self :

a GDataYouTubeVideo

no_embed :

whether the video can be embedded

gdata_youtube_video_get_player_uri ()

const gchar *       gdata_youtube_video_get_player_uri  (GDataYouTubeVideo *self);

Gets the "player-uri" property.

self :

a GDataYouTubeVideo

Returns :

a URI where the video is playable in a web browser, or NULL

gdata_youtube_video_is_private ()

gboolean            gdata_youtube_video_is_private      (GDataYouTubeVideo *self);

Gets the "is-private" property.

self :

a GDataYouTubeVideo

Returns :

TRUE if the video is private, FALSE otherwise

gdata_youtube_video_set_is_private ()

void                gdata_youtube_video_set_is_private  (GDataYouTubeVideo *self,
                                                         gboolean is_private);

Sets the "is-private" property to decide whether the video is publicly viewable.

self :

a GDataYouTubeVideo

is_private :

whether the video is private

gdata_youtube_video_is_draft ()

gboolean            gdata_youtube_video_is_draft        (GDataYouTubeVideo *self);

Gets the "is-draft" property.

self :

a GDataYouTubeVideo

Returns :

TRUE if the video is a draft, FALSE otherwise

gdata_youtube_video_set_is_draft ()

void                gdata_youtube_video_set_is_draft    (GDataYouTubeVideo *self,
                                                         gboolean is_draft);

Sets the "is-draft" property to decide whether the video is a draft.

self :

a GDataYouTubeVideo

is_draft :

whether the video is a draft

gdata_youtube_video_get_state ()

GDataYouTubeState * gdata_youtube_video_get_state       (GDataYouTubeVideo *self);

Gets the "state" property.

For more information, see the online documentation.

self :

a GDataYouTubeVideo

Returns :

a GDataYouTubeState showing the state of the video, or NULL

gdata_youtube_video_get_rating ()

GDataGDRating *     gdata_youtube_video_get_rating      (GDataYouTubeVideo *self);

Gets the "rating" property.

self :

a GDataYouTubeVideo

Returns :

a GDataGDRating describing the popularity of the video, or NULL

gdata_youtube_video_get_restriction ()

GDataMediaRestriction * gdata_youtube_video_get_restriction
                                                        (GDataYouTubeVideo *self);

Gets the "restriction" property.

self :

a GDataYouTubeVideo

Returns :

a GDataMediaRestriction giving information on countries where the video is restricted, or NULL if there are none

gdata_youtube_video_get_title ()

const gchar *       gdata_youtube_video_get_title       (GDataYouTubeVideo *self);

Gets the "title" property.

self :

a GDataYouTubeVideo

Returns :

the video's title, or NULL

gdata_youtube_video_set_title ()

void                gdata_youtube_video_set_title       (GDataYouTubeVideo *self,
                                                         const gchar *title);

Sets the "title" property to the new title, title.

Set title to NULL to unset the video's title.

self :

a GDataYouTubeVideo

title :

the new video title

gdata_youtube_video_get_uploaded ()

void                gdata_youtube_video_get_uploaded    (GDataYouTubeVideo *self,
                                                         GTimeVal *uploaded);

Gets the "uploaded" property and puts it in uploaded. If the property is unset, both fields in the GTimeVal will be set to 0.

self :

a GDataYouTubeVideo

uploaded :

a GTimeVal

gdata_youtube_video_get_video_id ()

const gchar *       gdata_youtube_video_get_video_id    (GDataYouTubeVideo *self);

Gets the "video-id" property.

self :

a GDataYouTubeVideo

Returns :

the video's unique and permanent ID

Property Details

The "category" property

  "category"                 gpointer              : Read / Write

Specifies a genre or developer tag that describes the video.

For more information, see the online documentation.


The "credit" property

  "credit"                   gpointer              : Read

Identifies the owner of the video.

For more information, see the online documentation.


The "description" property

  "description"              gchar*                : Read / Write

A summary or description of the video.

For more information, see the online documentation.

Default value: NULL


The "duration" property

  "duration"                 guint                 : Read

The duration of the video in seconds.

For more information, see the online documentation.

Allowed values: <= G_MAXINT

Default value: 0


The "favorite-count" property

  "favorite-count"           guint                 : Read

The number of YouTube users who have added the video to their list of favorite videos.

For more information, see the online documentation.

Default value: 0


The "is-draft" property

  "is-draft"                 gboolean              : Read / Write

Indicates whether the video is in draft, or unpublished, status.

For more information, see the online documentation.

Default value: FALSE


The "is-private" property

  "is-private"               gboolean              : Read / Write

Indicates whether the video is private.

Default value: FALSE


The "keywords" property

  "keywords"                 gchar*                : Read / Write

A comma-separated list of words associated with the video.

For more information, see the online documentation.

Default value: NULL


The "location" property

  "location"                 gchar*                : Read / Write

Descriptive text about the location where the video was taken.

For more information, see the online documentation.

Default value: NULL


The "media-rating" property

  "media-rating"             gpointer              : Read

Indicates that the video contains restricted content, although such restrictions might not apply in your country.

It is a pointer to a GDataMediaRating.

For more information, see the online documentation.


The "no-embed" property

  "no-embed"                 gboolean              : Read / Write

Specifies whether the video may not be embedded on other websites.

For more information, see the online documentation.

Default value: FALSE


The "player-uri" property

  "player-uri"               gchar*                : Read

Specifies a URI where the full-length video is available through a media player that runs inside a web browser (i.e. the video's page on YouTube).

For more information, see the online documentation.

Default value: NULL


The "rating" property

  "rating"                   gpointer              : Read

Specifies the current average rating of the video based on aggregated YouTube user ratings.

It is a pointer to a GDataGDRating.

For more information, see the online documentation.


The "restriction" property

  "restriction"              gpointer              : Read

Identifies the country or countries where the video may or may not be played.

It is a pointer to a GDataMediaRestriction.

For more information, see the online documentation.


The "state" property

  "state"                    gpointer              : Read

Information describing the state of the video. If this is non-NULL, the video is not playable. It points to a GDataYouTubeState.

For more information, see the online documentation.


The "title" property

  "title"                    gchar*                : Read / Write

Identifies the title of the video. This field has a maximum length of 60 characters or 100 bytes, whichever is reached first.

For more information, see the online documentation.

Default value: NULL


The "uploaded" property

  "uploaded"                 GTimeVal*             : Read

Specifies the time the video was originally uploaded to YouTube.

For more information, see the online documentation.


The "video-id" property

  "video-id"                 gchar*                : Read

Specifies a unique ID which YouTube uses to identify the video. For example: qz8EfkS4KK0.

For more information, see the online documentation.

Default value: NULL


The "view-count" property

  "view-count"               guint                 : Read

The number of times the video has been viewed.

For more information, see the online documentation.

Default value: 0