ClapperGtk.Video¶
- Subclasses:
None
Methods¶
- Inherited:
ClapperGtk.Av (4), Gtk.Widget (183), GObject.Object (37), Gtk.Accessible (18), Gtk.Buildable (1)
- Structs:
class |
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Gtk.Widget (25), GObject.Object (7), Gtk.Accessible (7), Gtk.Buildable (9)
Properties¶
- Inherited:
Name |
Type |
Flags |
Short Description |
|---|---|---|---|
r/w/en |
|||
r/w/en |
Signals¶
- Inherited:
Name |
Short Description |
|---|---|
A helper signal for implementing common seeking by double tap on screen side for touchscreen devices. |
|
A signal that user requested a change in fullscreen state of the video. |
Fields¶
- Inherited:
Class Details¶
- class ClapperGtk.Video(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
A ready to be used GTK video widget implementing Clapper API.
ClapperGtk.Videois the main widget exposed byClapperGtkAPI. It both displays videos played by [class`Clapper`.Player] (exposed as [property`ClapperGtk`.Av:player] property) and manages revealing and fading of any additional widgets overlaid on top of it.Other widgets provided by
ClapperGtklibrary, once placed anywhere on video (including nesting within another widget like [class`Gtk`.Box]) will automatically controlClapperGtk.Videothey were overlaid on top of. This allows to freely create custom playback control panels best suited for specific application. Additionally, pre-made widgets such as [class`ClapperGtk`.SimpleControls] are also available.- Basic usage
A typical use case is to embed video widget as part of your app where video playback is needed. Get the [class`Clapper`.Player] belonging to the AV widget and start adding new [class`Clapper`.MediaItem] items to the [class`Clapper`.Queue] for playback. For more information please refer to the Clapper playback library documentation.
ClapperGtk.Videocan automatically take care of revealing and later fading overlaid content when interacting with the video. To do this, simply add your widgets with [method`ClapperGtk`.Video.add_fading_overlay]. If you want to display some static content on top of video (or take care of visibility within overlaid widget itself) you can add it to the video as a normal overlay with [method`ClapperGtk`.Video.add_overlay].- Actions
You can use built-in actions of parent [class`ClapperGtk`.Av]. See its documentation, for the list of available ones.
ClapperGtk.Videoimplementation of the [iface`Gtk`.Buildable] interface supports placing children as either normal overlay by specifyingoverlayor a fading one by specifyingfading-overlayas thetypeattribute of a<child>element. Position of overlaid content is determined byvalign/halignproperties.``xml <object class=”ClapperGtkVideo” id=”video”>
- <child type=”fading-overlay”>
- <object class=”ClapperGtkTitleHeader”>
<property name=”valign”>start</property>
</object>
</child> <child type=”fading-overlay”>
- <object class=”ClapperGtkSimpleControls”>
<property name=”valign”>end</property>
</object>
</child>
</object> ``
- classmethod new()¶
- Returns:
a new video
Gtk.Widget.- Return type:
Creates a new
ClapperGtk.Videoinstance.Newly created video widget will also have set some default GStreamer elements on its [class`Clapper`.Player]. This includes Clapper own video sink and a “scaletempo” element as audio filter. Both can still be changed after construction by setting corresponding player properties.
- add_fading_overlay(widget)¶
- Parameters:
widget (
Gtk.Widget) – aGtk.Widget
Similiar as
ClapperGtk.Video.add_overlay() but will also automatically add fading functionality to overlaidGtk.Widgetfor convenience. This will make widget reveal itself when interacting with self and fade otherwise. Useful when placing widgets such as playback controls panels.
- add_overlay(widget)¶
- Parameters:
widget (
Gtk.Widget) – aGtk.Widget
Add another
Gtk.Widgetto be overlaid on top of video.The position at which widget is placed is determined from [property`Gtk`.Widget:halign] and [property`Gtk`.Widget:valign] properties.
This function will overlay widget as-is meaning that widget is responsible for managing its own visablity if needed. If you want to add a
Gtk.Widgetthat will reveal and fade itself automatically when interacting with self (e.g. controls panel) you can useClapperGtk.Video.add_fading_overlay() function for convenience.
- get_fade_delay()¶
- Returns:
currently set fade delay.
- Return type:
Get time in milliseconds after which fading overlays should fade.
- get_touch_fade_delay()¶
- Returns:
currently set touch fade delay.
- Return type:
Get time in milliseconds after which fading overlays should fade when revealed using touch device.
- set_fade_delay(delay)¶
- Parameters:
delay (
int) – a fade delay
Set time in milliseconds after which fading overlays should fade.
- set_touch_fade_delay(delay)¶
- Parameters:
delay (
int) – a touch fade delay
Set time in milliseconds after which fading overlays should fade when using touchscreen.
It is often useful to set this higher then normal fade delay property, as in case of touch events user do not have a moving pointer that would extend fade timeout, so he can have more time to decide what to press next.
Signal Details¶
- ClapperGtk.Video.signals.seek_request(video, forward)¶
- Signal Name:
seek-request- Flags:
- Parameters:
video (
ClapperGtk.Video) – The object which received the signalforward (
bool) –Trueif seek should be forward,Falseif backward
A helper signal for implementing common seeking by double tap on screen side for touchscreen devices.
Note that forward already takes into account RTL direction, so implementation does not have to check.
- ClapperGtk.Video.signals.toggle_fullscreen(video)¶
- Signal Name:
toggle-fullscreen- Flags:
- Parameters:
video (
ClapperGtk.Video) – The object which received the signal
A signal that user requested a change in fullscreen state of the video.
Note that when going fullscreen from this signal, user will expect for only video to be fullscreened and not the whole app window. It is up to implementation to decide how to handle that.
Property Details¶
- ClapperGtk.Video.props.fade_delay¶
- Name:
fade-delay- Type:
- Default Value:
3000- Flags:
A delay in milliseconds before trying to fade all fading overlays.
- ClapperGtk.Video.props.touch_fade_delay¶
- Name:
touch-fade-delay- Type:
- Default Value:
5000- Flags:
A delay in milliseconds before trying to fade all fading overlays after revealed using touchscreen.