ClutterGst.Playback

g ClutterGst.Playback ClutterGst.Playback ClutterGst.Player ClutterGst.Player ClutterGst.Player->ClutterGst.Playback GObject.GInterface GObject.GInterface GObject.GInterface->ClutterGst.Player GObject.Object GObject.Object GObject.Object->ClutterGst.Playback

Subclasses:

None

Methods

Inherited:

GObject.Object (37), ClutterGst.Player (8)

Structs:

GObject.ObjectClass (5)

class

new ()

get_audio_stream ()

get_audio_streams ()

get_buffer_duration ()

get_buffer_fill ()

get_buffer_size ()

get_buffering_mode ()

get_duration ()

get_in_seek ()

get_position ()

get_progress ()

get_seek_flags ()

get_subtitle_font_name ()

get_subtitle_track ()

get_subtitle_tracks ()

get_subtitle_uri ()

get_uri ()

get_user_agent ()

is_live_media ()

set_audio_stream (index_)

set_buffer_duration (duration)

set_buffer_size (size)

set_buffering_mode (mode)

set_filename (filename)

set_progress (progress)

set_seek_flags (flags)

set_subtitle_font_name (font_name)

set_subtitle_track (index_)

set_subtitle_uri (uri)

set_uri (uri)

set_user_agent (user_agent)

Virtual Methods

Inherited:

GObject.Object (7), ClutterGst.Player (13)

do_should_buffer (query)

Properties

Inherited:

ClutterGst.Player (3)

Name

Type

Flags

Short Description

audio-stream

int

r/w

Index of the current audio stream

audio-streams

int

r

List of the audio streams of the media

buffer-fill

float

r

The fill level of the buffer

can-seek

bool

r

Whether the current stream is seekable

duration

float

r

The duration of the stream, in seconds

in-seek

bool

r

If currently seeking

progress

float

r/w

Current progress of the playback

seek-flags

ClutterGst.SeekFlags

r/w

Flags to use when seeking

subtitle-font-name

str

r/w

The font used to display subtitles

subtitle-track

int

r/w

Index of the current subtitles track

subtitle-tracks

int

r

List of the subtitles tracks of the media

subtitle-uri

str

r/w

URI of a subtitle file

uri

str

r/w

URI of a media file

user-agent

str

r/w

User Agent used with network protocols

Signals

Inherited:

GObject.Object (1), ClutterGst.Player (5)

Name

Short Description

should-buffer

The ::should-buffer signal is emitted every time the base class needs to decide whether it should continue buffering in download-buffering mode.

Fields

Inherited:

GObject.Object (1), ClutterGst.Player (5)

Name

Type

Access

Description

parent

GObject.Object

r

Class Details

class ClutterGst.Playback(**kwargs)
Bases:

GObject.Object, ClutterGst.Player

Abstract:

No

Structure:

ClutterGst.PlaybackClass

Implementation of ClutterGst.Playback that displays media streams using GStreamer.

The ClutterGst.Playback structure contains only private data and should not be accessed directly.

classmethod new()
Return type:

ClutterGst.Playback

get_audio_stream()
Returns:

the index of the current audio stream, -1 if the media has no audio stream

Return type:

int

Get the current audio stream. The number returned in the index of the audio stream playing in the list returned by ClutterGst.Playback.get_audio_streams().

New in version 1.4.

get_audio_streams()
Returns:

a list of strings describing the available audio streams

Return type:

[str]

Get the list of audio streams of the current media.

New in version 1.4.

get_buffer_duration()
Returns:

The buffer duration

Return type:

int

Retrieves the buffer duration when buffering network streams.

get_buffer_fill()
Returns:

the fill level, between 0.0 and 1.0

Return type:

float

Retrieves the amount of the stream that is buffered.

get_buffer_size()
Returns:

The buffer size

Return type:

int

Retrieves the buffer size when buffering network streams.

get_buffering_mode()
Returns:

a ClutterGst.BufferingMode

Return type:

ClutterGst.BufferingMode

New in version 1.4.

get_duration()
Returns:

the duration of the media stream, in seconds

Return type:

float

Retrieves the duration of the media stream that self represents.

get_in_seek()
Returns:

True if the player is seeking, False otherwise.

Return type:

bool

Whether the player is seeking.

New in version 1.6.

get_position()
Returns:

the position in the media stream, in seconds

Return type:

float

Retrieves the position in the media stream that self represents.

get_progress()
Returns:

the playback progress, between 0.0 and 1.0

Return type:

float

Retrieves the playback progress of self.

get_seek_flags()
Returns:

a combination of ClutterGst.SeekFlags

Return type:

ClutterGst.SeekFlags

Get the current value of the seek-flags property.

New in version 1.4.

get_subtitle_font_name()
Returns:

a string containing the font name. Use GLib.free() to free the returned string

Return type:

str

Retrieves the font name currently used.

get_subtitle_track()
Returns:

the index of the current subtitlest track, -1 if the media has no subtitles track or if the subtitles have been turned off

Return type:

int

Get the current subtitles track. The number returned is the index of the subtiles track in the list returned by ClutterGst.Playback.get_subtitle_tracks().

New in version 1.4.

get_subtitle_tracks()
Returns:

a list of strings describing the available subtitles tracks

Return type:

[str]

Get the list of subtitles tracks of the current media.

New in version 1.4.

get_subtitle_uri()
Returns:

the URI of the subtitle file. Use GLib.free() to free the returned string

Return type:

str

Retrieves the URI of the subtitle file in use.

get_uri()
Returns:

the URI of the media stream. Use GLib.free() to free the returned string

Return type:

str

Retrieves the URI from self.

get_user_agent()
Returns:

the user agent used. The returned string has to be freed with GLib.free()

Return type:

str

Retrieves the user agent used when streaming.

New in version 1.4.

is_live_media()
Returns:

True if the player is using a live media, False otherwise.

Return type:

bool

Whether the player is using a live media.

set_audio_stream(index_)
Parameters:

index (int) – the index of the audio stream

Set the audio stream to play. index_ is the index of the stream in the list returned by ClutterGst.Playback.get_audio_streams().

New in version 1.4.

set_buffer_duration(duration)
Parameters:

duration (int) – The new duration

Sets the buffer duration to be used when buffering network streams.

set_buffer_size(size)
Parameters:

size (int) – The new size

Sets the buffer size to be used when buffering network streams.

set_buffering_mode(mode)
Parameters:

mode (ClutterGst.BufferingMode) – a ClutterGst.BufferingMode

New in version 1.4.

set_filename(filename)
Parameters:

filename (str) – A filename

Sets the source of self using a file path.

set_progress(progress)
Parameters:

progress (float) – the progress of the playback, between 0.0 and 1.0

Sets the playback progress of self. The progress is a normalized value between 0.0 (begin) and 1.0 (end).

set_seek_flags(flags)
Parameters:

flags (ClutterGst.SeekFlags) – a combination of ClutterGst.SeekFlags

Seeking can be done with several trade-offs. Clutter-gst defaults to ClutterGst.SeekFlags.NONE.

New in version 1.4.

set_subtitle_font_name(font_name)
Parameters:

font_name (str) – a font name, or None to set the default font name

Sets the font used by the subtitle renderer. The font_name string must be either None, which means that the default font name of the underlying implementation will be used; or must follow the grammar recognized by Pango.FontDescription.from_string() like:

clutter_gst_playback_set_subtitle_font_name (player, "Sans 24pt");

set_subtitle_track(index_)
Parameters:

index (int) – the index of the subtitles track

Set the subtitles track to play. index_ is the index of the stream in the list returned by ClutterGst.Playback.get_subtitle_tracks().

If index_ is -1, the subtitles are turned off.

New in version 1.4.

set_subtitle_uri(uri)
Parameters:

uri (str) – the URI of a subtitle file

Sets the location of a subtitle file to display while playing self.

set_uri(uri)
Parameters:

uri (str) – the URI of the media stream

Sets the URI of self to uri.

set_user_agent(user_agent)
Parameters:

user_agent (str) – the user agent

Sets the user agent to use when streaming.

When streaming content, you might want to set a custom user agent, eg. to promote your software, make it appear in statistics or because the server requires a special user agent you want to impersonate.

New in version 1.4.

do_should_buffer(query) virtual
Parameters:

query (Gst.Query) –

Return type:

bool

Signal Details

ClutterGst.Playback.signals.should_buffer(playback, query)
Signal Name:

should-buffer

Flags:

RUN_LAST

Parameters:
Return type:

bool

The ::should-buffer signal is emitted every time the base class needs to decide whether it should continue buffering in download-buffering mode.

New in version 1.4.

Property Details

ClutterGst.Playback.props.audio_stream
Name:

audio-stream

Type:

int

Default Value:

-1

Flags:

READABLE, WRITABLE

Index of the current audio stream.

New in version 1.4.

ClutterGst.Playback.props.audio_streams
Name:

audio-streams

Type:

int

Default Value:

None

Flags:

READABLE

List of audio streams available on the current media.

New in version 1.4.

ClutterGst.Playback.props.buffer_fill
Name:

buffer-fill

Type:

float

Default Value:

0.0

Flags:

READABLE

The fill level of the buffer for the current stream, as a value between 0.0 and 1.0.

ClutterGst.Playback.props.can_seek
Name:

can-seek

Type:

bool

Default Value:

False

Flags:

READABLE

Whether the current stream is seekable.

ClutterGst.Playback.props.duration
Name:

duration

Type:

float

Default Value:

0.0

Flags:

READABLE

The duration of the current stream, in seconds

ClutterGst.Playback.props.in_seek
Name:

in-seek

Type:

bool

Default Value:

False

Flags:

READABLE

Whether or not the stream is being seeked.

New in version 1.6.

ClutterGst.Playback.props.progress
Name:

progress

Type:

float

Default Value:

0.0

Flags:

READABLE, WRITABLE

The current progress of the playback, as a normalized value between 0.0 and 1.0.

ClutterGst.Playback.props.seek_flags
Name:

seek-flags

Type:

ClutterGst.SeekFlags

Default Value:

ClutterGst.SeekFlags.NONE

Flags:

READABLE, WRITABLE

Flags to use when seeking.

New in version 1.4.

ClutterGst.Playback.props.subtitle_font_name
Name:

subtitle-font-name

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

The font used to display subtitles. The font description has to follow the same grammar as the one recognized by Pango.FontDescription.from_string().

ClutterGst.Playback.props.subtitle_track
Name:

subtitle-track

Type:

int

Default Value:

-1

Flags:

READABLE, WRITABLE

Current subtitle track being displayed.

New in version 1.4.

ClutterGst.Playback.props.subtitle_tracks
Name:

subtitle-tracks

Type:

int

Default Value:

None

Flags:

READABLE

List of subtitle tracks available.

New in version 1.4.

ClutterGst.Playback.props.subtitle_uri
Name:

subtitle-uri

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

The location of a subtitle file, expressed as a valid URI.

ClutterGst.Playback.props.uri
Name:

uri

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

The location of a media file, expressed as a valid URI.

ClutterGst.Playback.props.user_agent
Name:

user-agent

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

The User Agent used by ClutterGst.Playback with network protocols.

New in version 1.4.