## ClutterGstPlayback ClutterGstPlayback — A ClutterGstPlayback to play media streams |

## Functions

ClutterGstPlayback * | clutter_gst_playback_new ()
gint | clutter_gst_playback_get_audio_stream ()
GList * | clutter_gst_playback_get_audio_streams ()
gint64 | clutter_gst_playback_get_buffer_duration ()
gdouble | clutter_gst_playback_get_buffer_fill ()
ClutterGstBufferingMode | clutter_gst_playback_get_buffering_mode ()
gint | clutter_gst_playback_get_buffer_size ()
gdouble | clutter_gst_playback_get_duration ()
gboolean | clutter_gst_playback_get_in_seek ()
gdouble | clutter_gst_playback_get_position ()
gdouble | clutter_gst_playback_get_progress ()
ClutterGstSeekFlags | clutter_gst_playback_get_seek_flags ()
gchar * | clutter_gst_playback_get_subtitle_font_name ()
gint | clutter_gst_playback_get_subtitle_track ()
GList * | clutter_gst_playback_get_subtitle_tracks ()
gchar * | clutter_gst_playback_get_subtitle_uri ()
gchar * | clutter_gst_playback_get_uri ()
gchar * | clutter_gst_playback_get_user_agent ()
gboolean | clutter_gst_playback_is_live_media ()
void | clutter_gst_playback_set_audio_stream ()
void | clutter_gst_playback_set_buffer_duration ()
void | clutter_gst_playback_set_buffering_mode ()
void | clutter_gst_playback_set_buffer_size ()
void | clutter_gst_playback_set_filename ()
void | clutter_gst_playback_set_progress ()
void | clutter_gst_playback_set_seek_flags ()
void | clutter_gst_playback_set_subtitle_font_name ()
void | clutter_gst_playback_set_subtitle_track ()
void | clutter_gst_playback_set_subtitle_uri ()
void | clutter_gst_playback_set_uri ()
void | clutter_gst_playback_set_user_agent ()

## Properties

gint | audio-stream | Read / Write
gpointer | audio-streams | Read
gdouble | buffer-fill | Read
gboolean | can-seek | Read
gdouble | duration | Read
gboolean | in-seek | Read
gdouble | progress | Read / Write
ClutterGstSeekFlags | seek-flags | Read / Write
gchar * | subtitle-font-name | Read / Write
gint | subtitle-track | Read / Write
gpointer | subtitle-tracks | Read
gchar * | subtitle-uri | Read / Write
gchar * | uri | Read / Write
gchar * | user-agent | Read / Write

## Signals

gboolean | should-buffer | Run Last

## Types and Values

struct | ClutterGstPlayback
struct | ClutterGstPlaybackClass

## Object Hierarchy

        GObject
        ╰── ClutterGstPlayback

## Implemented Interfaces

ClutterGstPlayback implements ClutterGstPlayer.

## Description

ClutterGstPlayback implements ClutterGstPlayer.

## Functions

### clutter_gst_playback_new ()

    ClutterGstPlayback *
    clutter_gst_playback_new (void);

#### Returns

### clutter_gst_playback_get_audio_stream ()

    gint
    clutter_gst_playback_get_audio_stream (ClutterGstPlayback *self);

Get the current audio stream. The number returned in the index of the audio stream playing in the list returned by `clutter_gst_playback_get_audio_streams()`.

#### Parameters

self | a ClutterGstPlayback |

#### Returns

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

Since 1.4

### clutter_gst_playback_get_audio_streams ()

    GList *
    clutter_gst_playback_get_audio_streams
                                   (ClutterGstPlayback *self);

Get the list of audio streams of the current media.

#### Parameters

self | a ClutterGstPlayback |

#### Returns

a list of strings describing the available audio streams.

[transfer none][element-type utf8]

Since 1.4

### clutter_gst_playback_get_buffer_duration ()

    gint64
    clutter_gst_playback_get_buffer_duration
                                   (ClutterGstPlayback *self);

Retrieves the buffer duration when buffering network streams.

#### Parameters

self | a ClutterGstPlayback |

#### Returns

The buffer duration

### clutter_gst_playback_get_buffer_fill ()

    gdouble
    clutter_gst_playback_get_buffer_fill (ClutterGstPlayback *self);

Retrieves the amount of the stream that is buffered.

#### Parameters

self | a ClutterGstPlayback |

#### Returns

the fill level, between 0.0 and 1.0

### clutter_gst_playback_get_buffering_mode ()

    ClutterGstBufferingMode
    clutter_gst_playback_get_buffering_mode
                                   (ClutterGstPlayback *self);

#### Parameters

self | a ClutterGstPlayback |

#### Returns

a ClutterGstBufferingMode

Since 1.4

### clutter_gst_playback_get_buffer_size ()

    gint
    clutter_gst_playback_get_buffer_size (ClutterGstPlayback *self);

Retrieves the buffer size when buffering network streams.

#### Parameters

self | a ClutterGstPlayback |

#### Returns

The buffer size

### clutter_gst_playback_get_duration ()

    gdouble
    clutter_gst_playback_get_duration (ClutterGstPlayback *self);

Retrieves the duration of the media stream that `self` represents.

#### Parameters

self | a ClutterGstPlayback |

#### Returns

the duration of the media stream, in seconds

### clutter_gst_playback_get_in_seek ()

    gboolean
    clutter_gst_playback_get_in_seek (ClutterGstPlayback *self);

Whether the player is seeking.

#### Parameters

self | a ClutterGstPlayback |

#### Returns

TRUE if the player is seeking, FALSE otherwise.

Since 1.6

### clutter_gst_playback_get_position ()

    gdouble
    clutter_gst_playback_get_position (ClutterGstPlayback *self);

Retrieves the position in the media stream that `self` represents.

#### Parameters

self | a ClutterGstPlayback |

#### Returns

the position in the media stream, in seconds

### clutter_gst_playback_get_progress ()

    gdouble
    clutter_gst_playback_get_progress (ClutterGstPlayback *self);

Retrieves the playback progress of `self` .

#### Parameters

self | a ClutterGstPlayback |

#### Returns

the playback progress, between 0.0 and 1.0

### clutter_gst_playback_get_seek_flags ()

    ClutterGstSeekFlags
    clutter_gst_playback_get_seek_flags (ClutterGstPlayback *self);

Get the current value of the seek-flags property.

#### Parameters

self | a ClutterGstPlayback |

#### Returns

a combination of ClutterGstSeekFlags

Since 1.4

### clutter_gst_playback_get_subtitle_font_name ()

    gchar *
    clutter_gst_playback_get_subtitle_font_name
                                   (ClutterGstPlayback *self);

Retrieves the font name currently used.

#### Parameters

self | a ClutterGstPlayback |

#### Returns

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

### clutter_gst_playback_get_subtitle_track ()

    gint
    clutter_gst_playback_get_subtitle_track
                                   (ClutterGstPlayback *self);

Get the current subtitles track. The number returned is the index of the subtiles track in the list returned by `clutter_gst_playback_get_subtitle_tracks()`.

#### Parameters

self | a ClutterGstPlayback |

#### Returns

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

Since 1.4

### clutter_gst_playback_get_subtitle_tracks ()

    GList *
    clutter_gst_playback_get_subtitle_tracks
                                   (ClutterGstPlayback *self);

Get the list of subtitles tracks of the current media.

#### Parameters

self | a ClutterGstPlayback |

#### Returns

a list of strings describing the available subtitles tracks.

[transfer none][element-type utf8]

Since 1.4

### clutter_gst_playback_get_subtitle_uri ()

    gchar *
    clutter_gst_playback_get_subtitle_uri (ClutterGstPlayback *self);

Retrieves the URI of the subtitle file in use.

#### Parameters

self | a ClutterGstPlayback |

#### Returns

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

### clutter_gst_playback_get_uri ()

    gchar *
    clutter_gst_playback_get_uri (ClutterGstPlayback *self);

Retrieves the URI from `self` .

#### Parameters

self | a ClutterGstPlayback |

#### Returns

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

### clutter_gst_playback_get_user_agent ()

    gchar *
    clutter_gst_playback_get_user_agent (ClutterGstPlayback *self);

Retrieves the user agent used when streaming.

#### Parameters

self | a ClutterGstPlayback |

#### Returns

the user agent used. The returned string has to be freed with `g_free()`

Since 1.4

### clutter_gst_playback_is_live_media ()

    gboolean
    clutter_gst_playback_is_live_media (ClutterGstPlayback *self);

Whether the player is using a live media.

#### Parameters

self | a ClutterGstPlayback |

#### Returns

TRUE if the player is using a live media, FALSE otherwise.

### clutter_gst_playback_set_audio_stream ()

    void
    clutter_gst_playback_set_audio_stream (ClutterGstPlayback *self,
                                           gint index_);

Set the audio stream to play. `index_` is the index of the stream in the list returned by `clutter_gst_playback_get_audio_streams()`.

#### Parameters

self | a ClutterGstPlayback |
index_ | the index of the audio stream |

Since 1.4

### clutter_gst_playback_set_buffer_duration ()

    void
    clutter_gst_playback_set_buffer_duration
                                   (ClutterGstPlayback *self,
                                    gint64 duration);

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

#### Parameters

self | a ClutterGstPlayback |
duration | The new duration |

### clutter_gst_playback_set_buffering_mode ()

    void
    clutter_gst_playback_set_buffering_mode
                                   (ClutterGstPlayback *self,
                                    ClutterGstBufferingMode mode);

#### Parameters

self | a ClutterGstPlayback |
mode | a ClutterGstBufferingMode |

Since 1.4

### clutter_gst_playback_set_buffer_size ()

    void
    clutter_gst_playback_set_buffer_size (ClutterGstPlayback *self,
                                          gint size);

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

#### Parameters

self | a ClutterGstPlayback |
size | The new size |

### clutter_gst_playback_set_filename ()

    void
    clutter_gst_playback_set_filename (ClutterGstPlayback *self,
                                       const gchar *filename);

Sets the source of `self` using a file path.

#### Parameters

self | a ClutterGstPlayback |
filename | A filename |

### clutter_gst_playback_set_progress ()

    void
    clutter_gst_playback_set_progress (ClutterGstPlayback *self,
                                       gdouble progress);

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

#### Parameters

self | a ClutterGstPlayback |
progress | the progress of the playback, between 0.0 and 1.0 |

### clutter_gst_playback_set_seek_flags ()

    void
    clutter_gst_playback_set_seek_flags (ClutterGstPlayback *self,
                                         ClutterGstSeekFlags flags);

Seeking can be done with several trade-offs. Clutter-gst defaults to `CLUTTER_GST_SEEK_FLAG_NONE`.

#### Parameters

self | a ClutterGstPlayback |
flags | a combination of ClutterGstSeekFlags |

Since 1.4

### clutter_gst_playback_set_subtitle_font_name ()

    void
    clutter_gst_playback_set_subtitle_font_name
                                   (ClutterGstPlayback *self,
                                    const char *font_name);

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

    1
    clutter_gst_playback_set_subtitle_font_name (player, "Sans 24pt");

#### Parameters

self | a ClutterGstPlayback |
font_name | a font name, or `NULL` to set the default font name |

### clutter_gst_playback_set_subtitle_track ()

    void
    clutter_gst_playback_set_subtitle_track
                                   (ClutterGstPlayback *self,
                                    gint index_);

Set the subtitles track to play. `index_` is the index of the stream in the list returned by `clutter_gst_playback_get_subtitle_tracks()`.

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

#### Parameters

self | a ClutterGstPlayback |
index_ | the index of the subtitles track |

Since 1.4

### clutter_gst_playback_set_subtitle_uri ()

    void
    clutter_gst_playback_set_subtitle_uri (ClutterGstPlayback *self,
                                           const gchar *uri);

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

#### Parameters

self | a ClutterGstPlayback |
uri | the URI of a subtitle file |

### clutter_gst_playback_set_uri ()

    void
    clutter_gst_playback_set_uri (ClutterGstPlayback *self,
                                  const gchar *uri);

Sets the URI of `self` to `uri` .

#### Parameters

self | a ClutterGstPlayback |
uri | the URI of the media stream |

### clutter_gst_playback_set_user_agent ()

    void
    clutter_gst_playback_set_user_agent (ClutterGstPlayback *self,
                                         const gchar *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.

#### Parameters

self | a ClutterGstPlayback |
user_agent | the user agent |

Since 1.4

## Types and Values

### struct ClutterGstPlayback

    struct ClutterGstPlayback;

Implementation of ClutterGstPlayback that displays media streams using GStreamer.

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

### struct ClutterGstPlaybackClass

    struct ClutterGstPlaybackClass {
      /* signals */
      gboolean (* should_buffer)  (ClutterGstPlayback *self,
                                    GstQuery *query);
    };

Base class for ClutterGstPlayback.

## Property Details

### The `“audio-stream”` property

      “audio-stream”             gint

Index of the current audio stream.

Flags: Read / Write

Allowed values: >= -1

Default value: -1

Since 1.4

### The `“audio-streams”` property

      “audio-streams”            gpointer

List of audio streams available on the current media.

Flags: Read

Since 1.4

### The `“buffer-fill”` property

      “buffer-fill”              gdouble

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

Flags: Read

Allowed values: [0,1]

Default value: 0

### The `“can-seek”` property

      “can-seek”                 gboolean

Whether the current stream is seekable.

Flags: Read

Default value: FALSE

### The `“duration”` property

      “duration”                 gdouble

The duration of the current stream, in seconds

Flags: Read

Allowed values: >= 0

Default value: 0

### The `“in-seek”` property

      “in-seek”                  gboolean

Whether or not the stream is being seeked.

Flags: Read

Default value: FALSE

Since 1.6

### The `“progress”` property

      “progress”                 gdouble

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

Flags: Read / Write

Allowed values: [0,1]

Default value: 0

### The `“seek-flags”` property

      “seek-flags”               ClutterGstSeekFlags

Flags to use when seeking.

Flags: Read / Write

Since 1.4

### The `“subtitle-font-name”` property

      “subtitle-font-name”       gchar *

The font used to display subtitles. The font description has to follow the same grammar as the one recognized by `pango_font_description_from_string()`.

Flags: Read / Write

Default value: NULL

### The `“subtitle-track”` property

      “subtitle-track”           gint

Current subtitle track being displayed.

Flags: Read / Write

Allowed values: >= -1

Default value: -1

Since 1.4

### The `“subtitle-tracks”` property

      “subtitle-tracks”          gpointer

List of subtitle tracks available.

Flags: Read

Since 1.4

### The `“subtitle-uri”` property

      “subtitle-uri”             gchar *

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

Flags: Read / Write

Default value: NULL

### The `“uri”` property

      “uri”                      gchar *

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

Flags: Read / Write

Default value: NULL

### The `“user-agent”` property

      “user-agent”               gchar *

The User Agent used by ClutterGstPlayback with network protocols.

Flags: Read / Write

Default value: NULL

Since 1.4

## Signal Details

### The `“should-buffer”` signal

    gboolean
    user_function (ClutterGstPlayback *player,
                   GstQuery           *query,
                   gpointer            user_data)

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

#### Parameters

player | the ClutterGstPlayback instance that received the signal |
query | A gst buffering query of format bytes |
user_data | user data set when the signal handler was connected. |

Flags: Run Last

Since 1.4