GData.MediaContent

g GData.MediaContent GData.MediaContent GData.Parsable GData.Parsable GData.Parsable->GData.MediaContent GObject.Object GObject.Object GObject.Object->GData.Parsable

Subclasses:

GData.YouTubeContent

Methods

Inherited:

GData.Parsable (5), GObject.Object (37)

Structs:

GObject.ObjectClass (5)

download (service, cancellable)

get_content_type ()

get_duration ()

get_expression ()

get_filesize ()

get_height ()

get_medium ()

get_uri ()

get_width ()

is_default ()

Virtual Methods

Inherited:

GData.Parsable (9), GObject.Object (7)

Properties

Inherited:

GData.Parsable (1)

Name

Type

Flags

Short Description

content-type

str

r

The standard MIME type of the object.

duration

int

r

The number of seconds for which the media object plays.

expression

GData.MediaExpression

r

Determines if the object is a sample or the full version of the object.

filesize

int

r

The number of bytes of the media object.

height

int

r

The height of the media object.

is-default

bool

r

Determines if this is the default content for the media group.

medium

GData.MediaMedium

r

The type of object.

uri

str

r

The direct URI to the media object.

width

int

r

The width of the media object.

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent

GData.Parsable

r

Class Details

class GData.MediaContent(**kwargs)
Bases:

GData.Parsable

Abstract:

No

Structure:

GData.MediaContentClass

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

download(service, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

a GData.DownloadStream to download the content with, or None; unref with GObject.Object.unref()

Return type:

GData.DownloadStream

Downloads and returns a GData.DownloadStream allowing the content represented by self to be read.

To get the content type of the downloaded data, GData.DownloadStream.get_content_type() can be called on the returned GData.DownloadStream. Calling GData.DownloadStream.get_content_length() on the stream will not return a meaningful result, however, as the stream is encoded in chunks, rather than by content length.

In order to cancel the download, a Gio.Cancellable passed in to cancellable must be cancelled using Gio.Cancellable.cancel(). Cancelling the individual Gio.InputStream operations on the GData.DownloadStream will not cancel the entire download; merely the read or close operation in question. See the GData.DownloadStream :cancellable for more details.

New in version 0.8.0.

get_content_type()
Returns:

the content’s content (MIME) type, or None

Return type:

str

Gets the GData.MediaContent :content-type property.

New in version 0.4.0.

get_duration()
Returns:

the content’s duration in seconds, or 0

Return type:

int

Gets the GData.MediaContent :duration property.

New in version 0.4.0.

get_expression()
Returns:

the content’s expression, or GData.MediaExpression.FULL

Return type:

GData.MediaExpression

Gets the GData.MediaContent :expression property.

New in version 0.4.0.

get_filesize()
Returns:

the number of bytes in the content, or 0

Return type:

int

Gets the GData.MediaContent :filesize property.

New in version 0.4.0.

get_height()
Returns:

the content’s height in pixels, or 0

Return type:

int

Gets the GData.MediaContent :height property.

New in version 0.4.0.

get_medium()
Returns:

the type of the content, or GData.MediaMedium.UNKNOWN

Return type:

GData.MediaMedium

Gets the GData.MediaContent :medium property.

New in version 0.4.0.

get_uri()
Returns:

the content’s URI

Return type:

str

Gets the GData.MediaContent :uri property.

New in version 0.4.0.

get_width()
Returns:

the content’s width in pixels, or 0

Return type:

int

Gets the GData.MediaContent :width property.

New in version 0.4.0.

is_default()
Returns:

True if the GData.MediaContent is the default content for the media group, False otherwise

Return type:

bool

Gets the GData.MediaContent :is-default property.

New in version 0.4.0.

Property Details

GData.MediaContent.props.content_type
Name:

content-type

Type:

str

Default Value:

None

Flags:

READABLE

The standard MIME type of the object.

For more information, see the Media RSS specification.

New in version 0.4.0.

GData.MediaContent.props.duration
Name:

duration

Type:

int

Default Value:

0

Flags:

READABLE

The number of seconds for which the media object plays.

For more information, see the Media RSS specification.

New in version 0.4.0.

GData.MediaContent.props.expression
Name:

expression

Type:

GData.MediaExpression

Default Value:

GData.MediaExpression.FULL

Flags:

READABLE

Determines if the object is a sample or the full version of the object, or even if it is a continuous stream.

For more information, see the Media RSS specification.

New in version 0.4.0.

GData.MediaContent.props.filesize
Name:

filesize

Type:

int

Default Value:

0

Flags:

READABLE

The number of bytes of the media object.

For more information, see the Media RSS specification.

New in version 0.4.0.

GData.MediaContent.props.height
Name:

height

Type:

int

Default Value:

0

Flags:

READABLE

The height of the media object.

For more information, see the Media RSS specification.

New in version 0.4.0.

GData.MediaContent.props.is_default
Name:

is-default

Type:

bool

Default Value:

False

Flags:

READABLE

Determines if this is the default content for the media group. There should only be one default object per media group.

For more information, see the Media RSS specification.

New in version 0.4.0.

GData.MediaContent.props.medium
Name:

medium

Type:

GData.MediaMedium

Default Value:

GData.MediaMedium.UNKNOWN

Flags:

READABLE

The type of object, complementing GData.MediaContent :content-type. It allows the consuming application to make simpler decisions between different content objects, based on whether they’re a video or audio stream, for example.

For more information, see the Media RSS specification.

New in version 0.4.0.

GData.MediaContent.props.uri
Name:

uri

Type:

str

Default Value:

None

Flags:

READABLE

The direct URI to the media object.

For more information, see the Media RSS specification.

New in version 0.4.0.

GData.MediaContent.props.width
Name:

width

Type:

int

Default Value:

0

Flags:

READABLE

The width of the media object.

For more information, see the Media RSS specification.

New in version 0.4.0.