### Class

# Clapper Player

#### Description [src]

    final class Clapper.Player : Clapper.ThreadedObject
    {
      /* No available fields */
    }

The media player object used for playback.

`ClapperPlayer` was written in an easy to use way, so no special GStreamer experience is needed to get started with making various playback applications.

Scheduling media for playback is done using a `ClapperQueue` upon which player operates.

Player uses `GStreamer` internally and handles playback on a separate thread, while serializing all events/commands between player and the thread it was created upon (usually main app thread). This makes it very easy to integrate with UI toolkits that operate on a single thread like (but not limited to) GTK.

To listen for property changes, you can connect to property “notify” signal.

#### Hierarchy

#### Ancestors

- ClapperThreadedObject
- GstObject
- GInitiallyUnowned
- GObject

#### Constructors

###### clapper_player_new

Creates a new `ClapperPlayer` instance.

#### Instance methods

###### clapper_player_add_feature

Add another `ClapperFeature` to the player.

###### clapper_player_get_audio_enabled

Get whether audio stream is enabled.

###### clapper_player_get_audio_filter

Get `GstElement` used as audio filter.

###### clapper_player_get_audio_offset

Get the currently set audio stream offset.

###### clapper_player_get_audio_sink

Get `GstElement` used as audio sink.

###### clapper_player_get_audio_streams

Get a list of audio streams within media item.

###### clapper_player_get_autoplay

Get the autoplay value.

###### clapper_player_get_current_audio_decoder

Get `GstElement` currently used as audio decoder.

###### clapper_player_get_current_video_decoder

Get `GstElement` currently used as video decoder.

###### clapper_player_get_mute

Get the mute state of the player.

###### clapper_player_get_position

Get the current player playback position.

###### clapper_player_get_queue

Get the `ClapperQueue` of the player.

###### clapper_player_get_speed

Get the speed of the player used for playback.

###### clapper_player_get_state

Get the current `ClapperPlayerState`.

###### clapper_player_get_subtitle_font_desc

Get the currently set font description used for subtitle stream rendering.

###### clapper_player_get_subtitle_offset

Get the currently set subtitle stream offset.

###### clapper_player_get_subtitle_streams

Get a list of subtitle streams within media item.

###### clapper_player_get_subtitles_enabled

Get whether subtitles are to be shown when available.

###### clapper_player_get_video_enabled

Get whether video stream is enabled.

###### clapper_player_get_video_filter

Get `GstElement` used as video filter.

###### clapper_player_get_video_sink

Get `GstElement` used as video sink.

###### clapper_player_get_video_streams

Get a list of video streams within media item.

###### clapper_player_get_volume

Get the volume of the player.

###### clapper_player_pause

Pause the playback of current media item.

###### clapper_player_play

Either start or resume the playback of current media item.

###### clapper_player_seek

Request the player to perform a seek operation.

###### clapper_player_seek_custom

Request the player to perform a seek operation.

###### clapper_player_set_audio_enabled

Set whether enable audio stream.

###### clapper_player_set_audio_filter

Set `GstElement` to be used as audio filter.

###### clapper_player_set_audio_offset

Set synchronisation offset between the audio stream and video.

###### clapper_player_set_audio_sink

Set `GstElement` to be used as audio sink.

###### clapper_player_set_autoplay

Set the autoplay state of the player.

###### clapper_player_set_mute

Set the mute state of the player.

###### clapper_player_set_speed

Set the speed multiplier of the player.

###### clapper_player_set_subtitle_font_desc

Set Pango font description to be used for subtitle stream rendering.

###### clapper_player_set_subtitle_offset

Set synchronisation offset between the subtitle stream and video.

###### clapper_player_set_subtitles_enabled

Set whether subtitles should be shown if any.

###### clapper_player_set_video_enabled

Set whether enable video stream.

###### clapper_player_set_video_filter

Set `GstElement` to be used as video filter.

###### clapper_player_set_video_sink

Set `GstElement` to be used as video sink.

###### clapper_player_set_volume

Set the volume of the player.

###### clapper_player_stop

Stop the playback of current media item.

##### Methods inherited from ClapperThreadedObject (1)

###### clapper_threaded_object_get_context

Get the `GMainContext` of the thread used by this object.

##### Methods inherited from GstObject (25)

Please see GstObject for a full list of methods.

##### Methods inherited from GObject (43)

Please see GObject for a full list of methods.

#### Properties

###### Clapper.Player:audio-enabled

Whether audio stream is enabled.

###### Clapper.Player:audio-filter

Optional audio filter to use (none by default).

###### Clapper.Player:audio-offset

Audio stream offset relative to video.

###### Clapper.Player:audio-sink

Audio sink to use (autoaudiosink by default).

###### Clapper.Player:audio-streams

List of currently available audio streams.

###### Clapper.Player:autoplay

Always try to start playback after media item changes.

###### Clapper.Player:current-audio-decoder

Currently used audio decoder.

###### Clapper.Player:current-video-decoder

Currently used video decoder.

###### Clapper.Player:mute

Mute audio without changing volume.

###### Clapper.Player:position

Current playback position as a decimal number in seconds.

###### Clapper.Player:queue

Clapper playback queue.

###### Clapper.Player:speed

Current playback speed.

###### Clapper.Player:state

Current playback state.

###### Clapper.Player:subtitle-font-desc

Subtitle stream font description.

###### Clapper.Player:subtitle-offset

Subtitle stream offset relative to video.

###### Clapper.Player:subtitle-streams

List of currently available subtitle streams.

###### Clapper.Player:subtitles-enabled

Whether subtitles stream is enabled.

###### Clapper.Player:video-enabled

Whether video stream is enabled.

###### Clapper.Player:video-filter

Optional video filter to use (none by default).

###### Clapper.Player:video-sink

Video sink to use (autovideosink by default).

###### Clapper.Player:video-streams

List of currently available video streams.

###### Clapper.Player:volume

Current volume as a decimal number (1.0 = 100%).

##### Properties inherited from GstObject (2)

###### Gst.Object:name

No description available.

###### Gst.Object:parent

The parent of the object. Please note, that when changing the ‘parent’ property, we don’t emit `GObject::notify` and `GstObject::deep-notify` signals due to locking issues. In some cases one can use `GstBin::element-added` or `GstBin::element-removed` signals on the parent to achieve a similar effect.

#### Signals

###### Clapper.Player::error

These are normal error messages. Upon emitting this signal, playback will stop due to the error.

###### Clapper.Player::missing-plugin

A `GStreamer` plugin or one of its features needed for playback is missing.

###### Clapper.Player::seek-done

A seeking operation has finished. Player is now at playback position after seek.

###### Clapper.Player::warning

These are some usually more minor error messages that should be treated like warnings. Should not generally prevent/stop playback.

##### Signals inherited from GstObject (1)

###### GstObject::deep-notify

The deep notify signal is used to be notified of property changes. It is typically attached to the toplevel bin to receive notifications from all the elements contained in that bin.

##### Signals inherited from GObject (1)

###### GObject::notify

The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

#### Class structure

    struct ClapperPlayerClass {
      ClapperThreadedObjectClass parent_class;

    }

No description available.

###### Class members

`parent_class: ClapperThreadedObjectClass`

  No description available.