swfdec.ui.Player — An improved swfdec.Player
class swfdec.ui.Player(swfdec.Player): |
|
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.
swfdec.ui.Player(debugger=None)
| a SwfdecAsDebugger to debug this player or None. |
Returns : | A new
swfdec.ui.Player
|
Creates a new swfdec.ui.Player.
def get_audio_enabled()Returns : | True if audio playback is enabled. |
Queries if audio playback for player.
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.
def get_playing()Returns : | True if the player is playing. |
Queries if the player is playing.
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.
def set_audio_enabled(enabled)
| True to enable audio. |
Enables or disables automatic audio playback.
def set_missing_plugin_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.
def set_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()
def set_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.