SwfdecPlayer3SWFDEC LibrarySwfdecPlayermain playback objectFunctionsvoidswfdec_init ()SwfdecPlayer *
swfdec_player_new ()gbooleanswfdec_player_is_initialized ()const SwfdecURL *
swfdec_player_get_url ()voidswfdec_player_set_url ()const SwfdecURL *
swfdec_player_get_base_url ()voidswfdec_player_set_base_url ()const char *
swfdec_player_get_variables ()voidswfdec_player_set_variables ()doubleswfdec_player_get_rate ()voidswfdec_player_get_default_size ()voidswfdec_player_get_size ()voidswfdec_player_set_size ()glongswfdec_player_get_next_event ()guintswfdec_player_get_background_color ()SwfdecScaleModeswfdec_player_get_scale_mode ()voidswfdec_player_set_scale_mode ()SwfdecAlignmentswfdec_player_get_alignment ()voidswfdec_player_set_alignment ()SwfdecPlayerScripting *
swfdec_player_get_scripting ()voidswfdec_player_set_scripting ()gbooleanswfdec_player_get_allow_fullscreen ()voidswfdec_player_set_allow_fullscreen ()gbooleanswfdec_player_get_fullscreen ()SwfdecRenderer *
swfdec_player_get_renderer ()voidswfdec_player_set_renderer ()voidswfdec_player_render ()voidswfdec_player_render_with_renderer ()gulongswfdec_player_advance ()gbooleanswfdec_player_mouse_move ()gbooleanswfdec_player_mouse_press ()gbooleanswfdec_player_mouse_release ()gbooleanswfdec_player_key_press ()gbooleanswfdec_player_key_release ()gbooleanswfdec_player_get_focus ()voidswfdec_player_set_focus ()const char *
swfdec_player_get_selection ()const GList *
swfdec_player_get_audio ()gulongswfdec_player_get_maximum_runtime ()voidswfdec_player_set_maximum_runtime ()PropertiesSwfdecAlignmentalignmentRead / Writegbooleanallow-fullscreenRead / Writeguintbackground-colorReadSwfdecURL *base-urlRead / Writegulongcache-sizeRead / Writeguintdefault-heightReadguintdefault-widthReadgbooleanfocusRead / WritegbooleanfullscreenReadgintheightRead / WritegbooleaninitializedReadGType *loader-typeRead / Write / Construct Onlygulongmax-runtimeRead / WriteSwfdecMouseCursormouse-cursorReadglongnext-eventReadgdoublerateReadSwfdecRenderer *rendererRead / Write / ConstructSwfdecScaleModescale-modeRead / WriteSwfdecPlayerScripting *scriptingRead / Writegchar *selectionReadGType *socket-typeRead / Write / Construct OnlySwfdecTimeVal *start-timeWrite / Construct OnlySwfdecSystem *systemRead / WriteSwfdecURL *urlReadgchar *variablesRead / WritegintwidthRead / WriteSignalsvoidadvanceRun Lastvoidaudio-addedRun Lastvoidaudio-removedRun LastvoidfscommandRun Lastgbooleanhandle-keyRun Lastgbooleanhandle-mouseRun LastvoidinvalidateRun LastvoidlaunchRun Lastvoidmissing-pluginsRun Lastgbooleanquery-sizeRun LastTypes and ValuesstructSwfdecPlayerObject Hierarchy GObject
╰── SwfdecAsContext
╰── SwfdecPlayer
╰── SwfdecGtkPlayer
Includes#include <swfdec/swfdec.h>
DescriptionA SwfdecPlayer is the main object used for playing back Flash files through
Swfdec.A player interacts with the outside world in a multitude of ways. The most
important ones are described below.Input is handled via the
SwfdecLoader class. A
SwfdecLoader is set on a new player using swfdec_player_set_loader().When the loader has provided enough data, you can start playing the file.
This is done in steps by calling swfdec_player_advance() - preferrably as
often as swfdec_player_get_next_event() indicates. Or you can provide user input
to the player by calling for example swfdec_player_handle_mouse().You can use swfdec_player_render() to draw the current state of the player.
After that, connect to the SwfdecPlayer:invalidate signal to be notified of
changes.Audio output is handled via the
SwfdecAudio class. One
SwfdecAudio object is created for every output using the
SwfdecPlayer::audio-added signal.Functionsswfdec_init ()swfdec_initvoid
swfdec_init (void);Initializes the Swfdec library.swfdec_player_new ()swfdec_player_newSwfdecPlayer *
swfdec_player_new (SwfdecAsDebugger *debugger);Creates a new player. This function is supposed to be used for testing.
Because of this, the created player will behave as predictable as possible.
For example, it will generate the same random number sequence every time.
The function calls swfdec_init() for you if it wasn't called before.ParametersdebuggerNULL or a SwfdecAsDebugger to use for debugging this player.Returns The new playerswfdec_player_is_initialized ()swfdec_player_is_initializedgboolean
swfdec_player_is_initialized (SwfdecPlayer *player);Determines if the player
is initalized yet. An initialized player is able
to provide basic values like width, height or rate. A player may not be
initialized if the loader it was started with does not reference a Flash
resources or it did not provide enough data yet. If a player is initialized,
it will never be uninitialized again.Parametersplayera SwfdecPlayerReturns TRUE if the basic values are known.swfdec_player_get_url ()swfdec_player_get_urlconst SwfdecURL *
swfdec_player_get_url (SwfdecPlayer *player);Gets the URL of the resource that is currently played back. If no URL has
been set on the player
yet, NULL is returned.Parametersplayera SwfdecPlayerReturns the SwfdecURL currently played back or NULLswfdec_player_set_url ()swfdec_player_set_urlvoid
swfdec_player_set_url (SwfdecPlayer *player,
const SwfdecURL *url);Sets the url
for the main data. This function may only be called once.Parametersplayera SwfdecPlayerurlthe url for the initial reference in this playerswfdec_player_get_base_url ()swfdec_player_get_base_urlconst SwfdecURL *
swfdec_player_get_base_url (SwfdecPlayer *player);Gets the base URL that this player uses when resolving a relative URL. It is
automatically set to the parent directory of the currently played back
resource, but can be changed using swfdec_player_set_base_url(). When no
resource has been set on the player
yet, NULL is returned.Parametersplayera SwfdecPlayerReturns the base SwfdecURL for resolving relative links or NULLswfdec_player_set_base_url ()swfdec_player_set_base_urlvoid
swfdec_player_set_base_url (SwfdecPlayer *player,
const SwfdecURL *url);Sets the URL that will be used for resolving realtive links inside the
player
.Parametersplayera SwfdecPlayerurla SwfdecURL or NULL to reset to defaultsswfdec_player_get_variables ()swfdec_player_get_variablesconst char *
swfdec_player_get_variables (SwfdecPlayer *player);Gets the initial variables for this player. See swfdec_player_set_variables()
for details about variables.Parametersplayera SwfdecPlayerReturns a string represetation of the current variables or NULL if none are
set on the player
.swfdec_player_set_variables ()swfdec_player_set_variablesvoid
swfdec_player_set_variables (SwfdecPlayer *player,
const char *variables);Sets the loader for the main data. This function may only be called if
swfdec_player_set_url() has not been called yet.
If the variables
are set and validate, they will be set as properties on the
root movie.Parametersplayera SwfdecPlayervariablesa string that is checked to be in 'application/x-www-form-urlencoded'
syntax describing the arguments to set on the new player or NULL for
none.swfdec_player_get_rate ()swfdec_player_get_ratedouble
swfdec_player_get_rate (SwfdecPlayer *player);Queries the framerate of this movie. This number specifies the number
of frames that are supposed to pass per second. It is a multiple of 1/256.Parametersplayera SwfdecPlayerReturns The framerate of this movie or 0 if it isn't known yet or the
movie doesn't have a framerate.swfdec_player_get_default_size ()swfdec_player_get_default_sizevoid
swfdec_player_get_default_size (SwfdecPlayer *player,
guint *width,
guint *height);If the default size of the movie is initialized, fills in width
and height
with the size. Otherwise width
and height
are set to 0.Parametersplayera SwfdecPlayerwidthinteger to store the width in or NULLheightinteger to store the height in or NULLswfdec_player_get_size ()swfdec_player_get_sizevoid
swfdec_player_get_size (SwfdecPlayer *player,
int *width,
int *height);Gets the currently set image size. If the default width or height should be
used, the width or height respectively is set to -1.Parametersplayera SwfdecPlayerwidthinteger to store the width in or NULLheightinteger to store the height in or NULLswfdec_player_set_size ()swfdec_player_set_sizevoid
swfdec_player_set_size (SwfdecPlayer *player,
int width,
int height);Sets the image size to the given values. The image size is what the area that
the player
will render and advocate with scripts.Parametersplayera SwfdecPlayerwidthdesired width of the movie or -1 for defaultheightdesired height of the movie or -1 for defaultswfdec_player_get_next_event ()swfdec_player_get_next_eventglong
swfdec_player_get_next_event (SwfdecPlayer *player);Queries how long to the next event. This is the next time when you should
call swfdec_player_advance() to forward to.Parametersplayeria SwfdecPlayerReturns number of milliseconds until next event or -1 if no outstanding eventswfdec_player_get_background_color ()swfdec_player_get_background_colorguint
swfdec_player_get_background_color (SwfdecPlayer *player);Gets the current suggested background color. The color will be an ARGB-color,
with the MSB being the alpha value. Note that Swfdec will not render the
background color itself, so if you want the background to not be translucent
it is your job to clear the background using this color.Parametersplayera SwfdecPlayerReturns the background color as an ARGB valueswfdec_player_get_scale_mode ()swfdec_player_get_scale_modeSwfdecScaleMode
swfdec_player_get_scale_mode (SwfdecPlayer *player);Gets the currrent mode used for scaling the movie. See SwfdecScaleMode for
the different modes.Parametersplayera SwfdecPlayerReturns the current scale modeswfdec_player_set_scale_mode ()swfdec_player_set_scale_modevoid
swfdec_player_set_scale_mode (SwfdecPlayer *player,
SwfdecScaleMode mode);Sets the currrent mode used for scaling the movie. See SwfdecScaleMode for
the different modes.Parametersplayera SwfdecPlayermodea SwfdecScaleModeswfdec_player_get_alignment ()swfdec_player_get_alignmentSwfdecAlignment
swfdec_player_get_alignment (SwfdecPlayer *player);Gets the alignment of the player. The alignment describes what point is used
as the anchor for drawing the contents. See SwfdecAlignment for possible
values.Parametersplayera SwfdecPlayerReturns the current alignmentswfdec_player_set_alignment ()swfdec_player_set_alignmentvoid
swfdec_player_set_alignment (SwfdecPlayer *player,
SwfdecAlignment align);Sets the alignment to align
. For details about alignment, see
swfdec_player_get_alignment() and SwfdecAlignment.Parametersplayera SwfdecPlayeralignSwfdecAlignment to setswfdec_player_get_scripting ()swfdec_player_get_scriptingSwfdecPlayerScripting *
swfdec_player_get_scripting (SwfdecPlayer *player);Gets the current scripting implementation in use. If no implementation is in
use (the default), NULL is returned.Parametersplayera SwfdecPlayerReturns the current scripting implementation used or NULL if noneswfdec_player_set_scripting ()swfdec_player_set_scriptingvoid
swfdec_player_set_scripting (SwfdecPlayer *player,
SwfdecPlayerScripting *scripting);Sets the implementation to use for external scripting in the given player
.
Note that this is different from the internal script engine. See the
SwfdecPlayerScripting paragraph for details about external scripting.Parametersplayera SwfdecPlayerscriptingthe scripting implementation to use or NULL to disable scriptingswfdec_player_get_allow_fullscreen ()swfdec_player_get_allow_fullscreengboolean
swfdec_player_get_allow_fullscreen (SwfdecPlayer *player);Checks if the player is allowed to go fullscreen. See
swfdec_player_set_allow_fullscreen() for details.Parametersplayerthe playerReturnsTRUE if the player is allowed to go fullscreenswfdec_player_set_allow_fullscreen ()swfdec_player_set_allow_fullscreenvoid
swfdec_player_set_allow_fullscreen (SwfdecPlayer *player,
gboolean allow);Sets if the player is allowed to go fullscreen. If a player is allowed to go
fullscreen, it may set the SwfdecPlayer::fullscreen property to TRUE.
Players are not allowed to go fullscreen by default. Usually applications
only want to allow going fullscreen in response to mouse or keyboard events.Parametersplayerthe playerallowif the player should be allowed to go fullscreenswfdec_player_get_fullscreen ()swfdec_player_get_fullscreengboolean
swfdec_player_get_fullscreen (SwfdecPlayer *player);CHecks if the player is in fullscreen mode currently. If the player is
in fullscreen mode, it assumes it occupies the whole screen. A player will
only ever go into fullscreen, if you have allowed it by calling
swfdec_player_set_allow_fullscreen().Parametersplayerthe playerReturnsTRUE if the player is in fullscreen mode currentlyswfdec_player_get_renderer ()swfdec_player_get_rendererSwfdecRenderer *
swfdec_player_get_renderer (SwfdecPlayer *player);Gets the current renderer in use. See swfdec_player_set_renderer() for
details.Parametersplayera playerReturns the current SwfdecRenderer in use.swfdec_player_set_renderer ()swfdec_player_set_renderervoid
swfdec_player_set_renderer (SwfdecPlayer *player,
SwfdecRenderer *renderer);Sets the renderer to be used by the player
. Setting the correct renderer is
mostly relevant for TextField flash objects with native fonts, as the
renderer provides those. It can also be very relevant for performance
reasons. See the SwfdecRenderer documentation for details.Parametersplayera playerrendererthe renderer to useswfdec_player_render ()swfdec_player_rendervoid
swfdec_player_render (SwfdecPlayer *player,
cairo_t *cr);Renders the given area of the current frame to cr
. This function just calls
swfdec_player_render_with_renderer() using the player
's renderer.Parametersplayera SwfdecPlayercrcairo_t to render toswfdec_player_render_with_renderer ()swfdec_player_render_with_renderervoid
swfdec_player_render_with_renderer (SwfdecPlayer *player,
cairo_t *cr,
SwfdecRenderer *renderer);Renders the given area of the current frame to cr
. If you only want to
redraw parts of the player, like when responding to a
SwfdecPlayer:invalidate signal, set a clip on cr
using cairo_clip():
cairo_rectangle (cr, x, y, width, height);
cairo_clip (cr);
swfdec_player_render_with_renderer (player, cr, renderer);
Only redrawing parts of the player improves performance considerably.Parametersplayera SwfdecPlayercrcairo_t to render torendererRenderer to use for renderingswfdec_player_advance ()swfdec_player_advancegulong
swfdec_player_advance (SwfdecPlayer *player,
gulong msecs);Advances player
by msecs
or at most one event, whatever happens first in
the player's timeline. You should make sure to call this function as often
as swfdec_player_get_next_event() indicates or your player will not appear
smooth.Parametersplayerthe SwfdecPlayer to advancemsecsnumber of milliseconds to advance at maximumReturns actual number of milliseconds advanced.swfdec_player_mouse_move ()swfdec_player_mouse_movegboolean
swfdec_player_mouse_move (SwfdecPlayer *player,
double x,
double y);Updates the current mouse position. If the mouse has left the area of player
,
you should pass values outside the movie size for x
and y
. You will
probably want to call swfdec_player_advance() before to update the player to
the correct time when calling this function.Parametersplayera SwfdecPlayerxx coordinate of mouseyy coordinate of mouseReturnsTRUE if the mouse event was handled. FALSE if the event should be
propagated further. A mouse event may not be handled if the user
clicked on a translucent area.swfdec_player_mouse_press ()swfdec_player_mouse_pressgboolean
swfdec_player_mouse_press (SwfdecPlayer *player,
double x,
double y,
guint button);Tells the player
that the mouse button button
was pressed at the given
coordinate.Parametersplayera SwfdecPlayerxx coordinate of mouseyy coordinate of mousebuttonnumber of the button that was pressed. Swfdec supports up to 32
buttons.ReturnsTRUE if the mouse event was handled. FALSE if the event should be
propagated further. A mouse event may not be handled if the user
clicked on a translucent area.swfdec_player_mouse_release ()swfdec_player_mouse_releasegboolean
swfdec_player_mouse_release (SwfdecPlayer *player,
double x,
double y,
guint button);Tells the player
that the mouse button button
was released at the given
coordinate.Parametersplayera SwfdecPlayerxx coordinate of mouseyy coordinate of mousebuttonnumber of the button that was released. Swfdec supports up to 32
buttons.ReturnsTRUE if the mouse event was handled. FALSE if the event should be
propagated further. A mouse event may not be handled if the user
clicked on a translucent area.swfdec_player_key_press ()swfdec_player_key_pressgboolean
swfdec_player_key_press (SwfdecPlayer *player,
guint keycode,
guint character);Call this function to make the player
react to a key press. A list of
defined key codes is defined by SwfdecKey. You will likely need to
translate from your keyboard API to the Flash key codes.Parametersplayera SwfdecPlayerkeycodethe key that was pressed, must be smaller than 256.characterUCS4 of the character that was inserted or 0 if noneReturnsTRUE if the key press was handled by the player
, FALSE if it
should be propagated furtherswfdec_player_key_release ()swfdec_player_key_releasegboolean
swfdec_player_key_release (SwfdecPlayer *player,
guint keycode,
guint character);Call this function to make the player
react to a key being released. See
swfdec_player_key_press() for details.Parametersplayera SwfdecPlayerkeycodethe key that was releasedcharacterUCS4 of the character that was inserted or 0 if noneReturnsTRUE if the key press was handled by the player
, FALSE if it
should be propagated furtherswfdec_player_get_focus ()swfdec_player_get_focusgboolean
swfdec_player_get_focus (SwfdecPlayer *player);Checks if the player
has keyboard focus. See swfdec_player_set_focus() for
details.Parametersplayera SwfdecPlayerReturnsTRUE if the player has keyboard focus.swfdec_player_set_focus ()swfdec_player_set_focusvoid
swfdec_player_set_focus (SwfdecPlayer *player,
gboolean focus);Tells the player
whether keyboard focus is inside it. The player will use
this information to draw focus indicators around objects. Note that this
update will not happen immediately, but only the next time you call
swfdec_player_advance(). The player is focussed by default. So if you
integrate it into a widget system such, you likely want to unset this upon
creation of the player.The player must be focussed to receive keyboard events.Parametersplayerthe playerfocusif the player is focussedswfdec_player_get_selection ()swfdec_player_get_selectionconst char *
swfdec_player_get_selection (SwfdecPlayer *player);Retrieves the currently selected text of the player. If no text is currently
selected, NULL is returned.Parametersplayerthe playerReturns the currently selected text or NULLswfdec_player_get_audio ()swfdec_player_get_audioconst GList *
swfdec_player_get_audio (SwfdecPlayer *player);Returns a list of all currently active audio streams in player
.Parametersplayera SwfdecPlayerReturns A GList of SwfdecAudio. You must not modify or free this list.swfdec_player_get_maximum_runtime ()swfdec_player_get_maximum_runtimegulong
swfdec_player_get_maximum_runtime (SwfdecPlayer *player);Queries the given player
for how long scripts may run. see
swfdec_player_set_maximum_runtime() for a longer discussion of this value.Parametersplayera SwfdecPlayerReturns the maximum time in milliseconds that scripts are allowed to run or
0 for infinite.swfdec_player_set_maximum_runtime ()swfdec_player_set_maximum_runtimevoid
swfdec_player_set_maximum_runtime (SwfdecPlayer *player,
gulong msecs);Sets the time that the player may use to let internal scripts run. If the
Flash file that is currently played back does not manage to complete its
scripts in the given time, it is aborted. You cannot continue the scripts at
a later point in time. However, your application may become unresponsive and
your users annoyed if they cannot interact with it for too long. To give a
reference point, the Adobe Flash player usually sets this value to 10
seconds. Note that this time determines the maximum time calling
swfdec_player_advance() may take, even if it is called with a large value.
Also note that this setting is ignored when running inside a debugger.Parametersplayera SwfdecPlayermsecstime in milliseconds that scripts are allowed to run or 0 for
infiniteTypes and Valuesstruct SwfdecPlayerSwfdecPlayerstruct SwfdecPlayer;This is the base object used for playing Flash files.Property DetailsThe “alignment” propertySwfdecPlayer:alignment “alignment” SwfdecAlignmentpoint of the screen to align the output to.Flags: Read / WriteDefault value: SWFDEC_ALIGNMENT_CENTERThe “allow-fullscreen” propertySwfdecPlayer:allow-fullscreen “allow-fullscreen” gbooleanif the player is allowed to change into fullscreen mode.Flags: Read / WriteDefault value: FALSEThe “background-color” propertySwfdecPlayer:background-color “background-color” guintARGB color used to draw the background.Flags: ReadDefault value: 4294967295The “base-url” propertySwfdecPlayer:base-url “base-url” SwfdecURL *base URL for creating new resource or NULL if not set yet.Flags: Read / WriteThe “cache-size” propertySwfdecPlayer:cache-size “cache-size” gulongmaximum cache size in bytes.Flags: Read / WriteThe “default-height” propertySwfdecPlayer:default-height “default-height” guintdefault height of the movie.Flags: ReadDefault value: 0The “default-width” propertySwfdecPlayer:default-width “default-width” guintdefault width of the movie.Flags: ReadDefault value: 0The “focus” propertySwfdecPlayer:focus “focus” gbooleanTRUE if the player has keyboard focus.Flags: Read / WriteDefault value: TRUEThe “fullscreen” propertySwfdecPlayer:fullscreen “fullscreen” gbooleanif the player is in fullscreen mode.Flags: ReadDefault value: FALSEThe “height” propertySwfdecPlayer:height “height” gintcurrent height of the movie.Flags: Read / WriteAllowed values: >= -1Default value: -1The “initialized” propertySwfdecPlayer:initialized “initialized” gbooleanTRUE when the player has initialized its basic values.Flags: ReadDefault value: FALSEThe “loader-type” propertySwfdecPlayer:loader-type “loader-type” GType *type to use for creating loaders.Flags: Read / Write / Construct OnlyAllowed values: SwfdecLoaderThe “max-runtime” propertySwfdecPlayer:max-runtime “max-runtime” gulongmaximum time in msecs scripts may run in the player before aborting.Flags: Read / WriteThe “mouse-cursor” propertySwfdecPlayer:mouse-cursor “mouse-cursor” SwfdecMouseCursorhow the mouse pointer should be presented.Flags: ReadDefault value: SWFDEC_MOUSE_CURSOR_NONEThe “next-event” propertySwfdecPlayer:next-event “next-event” glonghow many milliseconds until the next event or -1 when no event pending.Flags: ReadAllowed values: >= -1Default value: -1The “rate” propertySwfdecPlayer:rate “rate” gdoublerate in frames per second.Flags: ReadAllowed values: [0,256]Default value: 0The “renderer” propertySwfdecPlayer:renderer “renderer” SwfdecRenderer *the renderer used by this player.Flags: Read / Write / ConstructThe “scale-mode” propertySwfdecPlayer:scale-mode “scale-mode” SwfdecScaleModemethod used to scale the movie.Flags: Read / WriteDefault value: SWFDEC_SCALE_SHOW_ALLThe “scripting” propertySwfdecPlayer:scripting “scripting” SwfdecPlayerScripting *external scripting implementation.Flags: Read / WriteThe “selection” propertySwfdecPlayer:selection “selection” gchar *currently selected text.Flags: ReadDefault value: NULLThe “socket-type” propertySwfdecPlayer:socket-type “socket-type” GType *type to use for creating sockets.Flags: Read / Write / Construct OnlyAllowed values: SwfdecSocketThe “start-time” propertySwfdecPlayer:start-time “start-time” SwfdecTimeVal *time to use as the beginning time for this player.Flags: Write / Construct OnlyThe “system” propertySwfdecPlayer:system “system” SwfdecSystem *object holding system information.Flags: Read / WriteThe “url” propertySwfdecPlayer:url “url” SwfdecURL *URL of resource currently played back or NULL if not set.Flags: ReadThe “variables” propertySwfdecPlayer:variables “variables” gchar *variables to use when setting the URL.Flags: Read / WriteDefault value: NULLThe “width” propertySwfdecPlayer:width “width” gintcurrent width of the movie.Flags: Read / WriteAllowed values: >= -1Default value: -1Signal DetailsThe “advance” signalSwfdecPlayer::advancevoid
user_function (SwfdecPlayer *player,
gulong msecs,
guint audio_samples,
gpointer user_data)Emitted whenever the player advances.Parametersplayerthe SwfdecPlayer affectedmsecsthe amount of milliseconds the player will advanceaudio_samplesnumber of frames the audio is advanced (in 44100Hz steps)user_datauser data set when the signal handler was connected.Flags: Run LastThe “audio-added” signalSwfdecPlayer::audio-addedvoid
user_function (SwfdecPlayer *player,
SwfdecAudio *audio,
gpointer user_data)Emitted whenever a new audio stream was added to player
.Parametersplayerthe SwfdecPlayer affectedaudiothe audio stream that was addeduser_datauser data set when the signal handler was connected.Flags: Run LastThe “audio-removed” signalSwfdecPlayer::audio-removedvoid
user_function (SwfdecPlayer *player,
SwfdecAudio *audio,
gpointer user_data)Emitted whenever an audio stream was removed from player
. The stream will
have been added with the SwfdecPlayer::audio-added signal previously.Parametersplayerthe SwfdecPlayer affectedaudiothe audio stream that was removeduser_datauser data set when the signal handler was connected.Flags: Run LastThe “fscommand” signalSwfdecPlayer::fscommandvoid
user_function (SwfdecPlayer *player,
gchar *command,
gchar *parameter,
gpointer user_data)
This signal is emited whenever a Flash script command (also known as
fscommand) is encountered. This method is ued by the Flash file to
communicate with the hosting environment. In web browsers it is used to
call Javascript functions. Standalone Flash players understand a limited
set of functions. They vary from player to player, but the most common are
listed here:"quit": quits the player."fullscreen": A boolean setting (parameter is "true" or
"false") that sets the player into fullscreen mode."allowscale": A boolean setting that tells the player to
not scale the Flash application."showmenu": A boolean setting that tells the Flash player
to not show its own entries in the right-click menu."exec": Run an external executable. The parameter
specifies the path."trapallkeys": A boolean setting that tells the Flash
player to pass all key events to the Flash application instead of using it
for keyboard shortcuts or similar.Parametersplayerthe SwfdecPlayer affectedcommandthe command to execute. This is a lower case string.parameterparameter to pass to the command. The parameter depends on the
function.user_datauser data set when the signal handler was connected.Flags: Run LastThe “handle-key” signalSwfdecPlayer::handle-keygboolean
user_function (SwfdecPlayer *player,
guint key,
guint pressed,
gboolean Returns,
gpointer user_data)This signal is emitted whenever player
should respond to a key event. If
any of the handlers returns TRUE, swfdec_player_key_press() or
swfdec_player_key_release() will return TRUE. Note that unlike many event
handlers in gtk, returning TRUE will not stop further event handlers from
being invoked. Use g_signal_stop_emission() in that case.Parametersplayerthe SwfdecPlayer affectedkeySwfdecKey that was pressed or releasedpressedTRUE if the key
was pressed or FALSE if it was releaseduser_datauser data set when the signal handler was connected.Returns TRUE if this handler handles the event. Flags: Run LastThe “handle-mouse” signalSwfdecPlayer::handle-mousegboolean
user_function (SwfdecPlayer *player,
gdouble x,
gdouble y,
gint button,
gpointer user_data)This signal is emitted whenever player
should respond to a mouse event. If
any of the handlers returns TRUE, swfdec_player_handle_mouse() will return
TRUE. Note that unlike many event handlers in gtk, returning TRUE will not
stop further event handlers from being invoked. Use g_signal_stop_emission()
in that case.Parametersplayerthe SwfdecPlayer affectedxnew x coordinate of the mouseynew y coordinate of the mousebutton0 for a mouse move, a positive number if a button was pressed,
a negative number if a button was releaseduser_datauser data set when the signal handler was connected.Returns TRUE if this handler handles the event. Flags: Run LastThe “invalidate” signalSwfdecPlayer::invalidatevoid
user_function (SwfdecPlayer *player,
gpointer rectangles,
guint n_rectangles,
gpointer user_data)This signal is emitted whenever graphical elements inside the player have
changed. It provides two ways to look at the changes: By looking at the
extents
parameter, it provides a simple way to get a single rectangle that
encloses all changes. By looking at the rectangles
array, you can get
finer control over changes which is very useful if your rendering system
provides a way to handle regions.Parametersplayerthe SwfdecPlayer affectedrectanglesa number of smaller rectangles for fine-grained control over
changesn_rectanglesnumber of rectangles in rectanglesuser_datauser data set when the signal handler was connected.Flags: Run LastThe “launch” signalSwfdecPlayer::launchvoid
user_function (SwfdecPlayer *player,
gchar *url,
gchar *target,
SwfdecBuffer *data,
guint header_count,
GStrv header_names,
GStrv header_values,
gpointer user_data)Emitted whenever the player
encounters an URL that should be loaded into
a target the Flash player does not recognize. In most cases this happens
when the user clicks a link in an embedded Flash movie that should open a
new web page.
The effect of calling any swfdec functions on the emitting player
is undefined.Parametersplayerthe SwfdecPlayer affectedurlURL to opentargettarget to load the URL intodataoptional data to pass on with the request. Can be NULL indicating
no data should be passed.header_countnumber of custom HTTP headers to be sentheader_namesnames of the custom HTTP headers. NULL terminatedheader_valuesvalues of the custom HTTP headers. NULL terminateduser_datauser data set when the signal handler was connected.Flags: Run LastThe “missing-plugins” signalSwfdecPlayer::missing-pluginsvoid
user_function (SwfdecPlayer *player,
GStrv details,
gpointer user_data)Emitted whenever a plugin is detected that GStreamer cannot currently
handle because it is missing plugins to do so. You should use
gst_install_plugins_async() to install those plugins.Parametersplayerthe SwfdecPlayer missing pluginsdetailsthe details strings for all missing pluginsuser_datauser data set when the signal handler was connected.Flags: Run LastThe “query-size” signalSwfdecPlayer::query-sizegboolean
user_function (SwfdecPlayer *player,
gboolean fullscreen,
gpointer width,
gpointer height,
gpointer user_data)This signals is emitted whenever the player is (un)fullscreened. In this
case it requests the new size the Flash file will be displayed in
immediately. If you want to provide values, connect to this signal. The
values don't have to be exact, you can still call swfdec_player_set_size()
later on. However, it will look visually nicer if your values here are
correct. By default, the screen resolution values will be used for
fullscreen and the default size will be used otherwise.Parametersplayerthe SwfdecPlayer that resizesfullscreenTRUE if the player queries the fullscreen size, FALSE for
the default sizewidthpointer to an integer that takes the width to useheightpointer to an integer that takes the height to useuser_datauser data set when the signal handler was connected.Returns TRUE if this handler properly sets width
and height
and no
other handlers should be invoked.Flags: Run Last