swfdec.ui.Player

swfdec.ui.Player — An improved swfdec.Player

Synopsis

class swfdec.ui.Player(swfdec.Player):
    swfdec.ui.Player(debugger=None)
def get_audio_enabled(msecs)
def get_missing_plugin_window()
def get_playing()
def get_speed()
def set_audio_enabled(enabled)
def set_missing_plugin_window(window)
def set_playing(playing)
def set_speed(speed)

Ancestry

+-- gobject.GObject
    +-- swfdec.Player
        +-- swfdec.ui.Player

swfdec.ui.Player Properties

"audio-enabled"Read/WriteTrue if automatic audio handling is enabled. Default value: True.
"missing-plugin-window"Read/WriteThe window on which to do autmatic missing plugins installation.
"playing"Read/WriteTrue if the player is playing (d'oh). Default value: False.
"speed"Read/Writedesired playback speed. Allowed values: >= G_MINDOUBLE. Default value: 1.

Description

The swfdec.ui.Player adds common functionality to the rather barebones swfdec.Player class, such as automatic playback and audio handling. Note that by default, the player will be paused, so you need to call swfdec.ui.Player.set_playing(True) on the new player.

Constructor

    swfdec.ui.Player(debugger=None)

debugger :

a SwfdecAsDebugger to debug this player or None.

Returns :

A new swfdec.ui.Player

Creates a new swfdec.ui.Player.

Methods

swfdec.ui.Player.get_audio_enabled

    def get_audio_enabled()

Returns :

True if audio playback is enabled.

Queries if audio playback for player.

swfdec.ui.Player.get_missing_plugin_window

    def get_missing_plugin_window()

Returns :

the GdkWindow used as parent for showing missing plugin dialogs or None if automatic codec install is disabled

Gets the window used for automatic codec install. See set_missing_plugin_window for details.

swfdec.ui.Player.get_playing

    def get_playing()

Returns :

True if the player is playing.

Queries if the player is playing.

swfdec.ui.Player.get_speed

    def get_speed()

Returns :

The current playback speed.

Queries the current playback speed. If the player is currently paused, it will report the speed that it would use if playing.

swfdec.ui.Player.set_audio_enabled

    def set_audio_enabled(enabled)

enabled :

True to enable audio.

Enables or disables automatic audio playback.

swfdec.ui.Player.set_missing_plugin_window

    def set_missing_plugin_window(window)

window :

the window to use for popping up codec install dialogs or None.

Sets a given GdkWindow to be used as the reference window when popping up automatic codec install dialogs. Automatic codec install happens when Swfdec cannot find a GStreamer plugin to play back a given media file. The player will automaticcaly pause when this happens to allow the plugin install to finish and will resume playback after the codec install has completed. You can use NULL to disable this feature. It is disable by default. Note that this function takes a GdkWindow, not a GtkWindow, as its argument. This makes it slightly more inconvenient to use, as you need to call gtk_widget_show() on your GtkWindow before having access to its GdkWindow, but it allows automatic plugin installatio even when your application does not have a window. You can use gdk_get_default_root_window() to obtain a default window in that case. For details about automatic codec install, see the GStreamer documentation, in particular the function gst_install_plugins_async(). If Swfdec was compiled without GStreamer support, this function will have no effect.

swfdec.ui.Player.set_playing

    def set_playing(playing)

playing :

If the player should play or not.

Sets if player should be playing or not. If the player is playing, a timer will be attached to the default main loop that periodically calls swfdec.Player.advance()

swfdec.ui.Player.set_speed

    def set_speed(speed)

speed :

The new playback speed.

Sets the new playback speed. 1.0 means the default speed, bigger values make playback happen faster. Audio will only play back if the speed is 1.0. Note that if the player is not playing when calling this function, it will not automatically start.