Package ch.bailu.gtk.gtk
Class Video
- All Implemented Interfaces:
PointerInterface
`GtkVideo` is a widget to show a `GtkMediaStream` with media controls.
![An example GtkVideo](video.png)
The controls are available separately as [class@Gtk.MediaControls].
If you just want to display a video without controls, you can treat it
like any other paintable and for example put it into a [class@Gtk.Picture].
`GtkVideo` aims to cover use cases such as previews, embedded animations,
etc. It supports autoplay, looping, and simple media controls. It does
not have support for video overlays, multichannel audio, device
selection, or input. If you are writing a full-fledged video player,
you may want to use the [iface@Gdk.Paintable] API and a media framework
such as Gstreamer directly.
![An example GtkVideo](video.png)
The controls are available separately as [class@Gtk.MediaControls].
If you just want to display a video without controls, you can treat it
like any other paintable and for example put it into a [class@Gtk.Picture].
`GtkVideo` aims to cover use cases such as previews, embedded animations,
etc. It supports autoplay, looping, and simple media controls. It does
not have support for video overlays, multichannel audio, device
selection, or input. If you are writing a full-fledged video player,
you may want to use the [iface@Gdk.Paintable] API and a media framework
such as Gstreamer directly.
-
Nested Class Summary
Nested classes/interfaces inherited from class ch.bailu.gtk.gtk.Widget
Widget.OnDestroy, Widget.OnDestroyNotify, Widget.OnDirectionChanged, Widget.OnHide, Widget.OnKeynavFailed, Widget.OnMap, Widget.OnMnemonicActivate, Widget.OnMoveFocus, Widget.OnQueryTooltip, Widget.OnRealize, Widget.OnShow, Widget.OnStateFlagsChanged, Widget.OnTickCallback, Widget.OnUnmap, Widget.OnUnrealize
Nested classes/interfaces inherited from class ch.bailu.gtk.gobject.Object
Object.OnBindingTransformFunc, Object.OnDuplicateFunc, Object.OnNotify, Object.OnToggleNotify, Object.OnWeakNotify
-
Field Summary
Fields inherited from class ch.bailu.gtk.gtk.Widget
SIGNAL_ON_DESTROY, SIGNAL_ON_DIRECTION_CHANGED, SIGNAL_ON_HIDE, SIGNAL_ON_KEYNAV_FAILED, SIGNAL_ON_MAP, SIGNAL_ON_MNEMONIC_ACTIVATE, SIGNAL_ON_MOVE_FOCUS, SIGNAL_ON_QUERY_TOOLTIP, SIGNAL_ON_REALIZE, SIGNAL_ON_SHOW, SIGNAL_ON_STATE_FLAGS_CHANGED, SIGNAL_ON_UNMAP, SIGNAL_ON_UNREALIZE
Fields inherited from class ch.bailu.gtk.gobject.Object
SIGNAL_ON_NOTIFY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionImplements interfaceAccessible
.Implements interfaceBuildable
.Implements interfaceConstraintTarget
.boolean
Returns %TRUE if videos have been set to loop.static ClassHandler
getFile()
Gets the file played by @self or %NULL if not playing back
a file.static int
boolean
getLoop()
Returns %TRUE if videos have been set to loop.Gets the media stream managed by @self or %NULL if none.static long
static TypeSystem.TypeSize
static long
static TypeSystem.TypeSize
static Video
newForFilenameVideo
(Str filename) Creates a `GtkVideo` to play back the given @filename.static Video
newForFilenameVideo
(String filename) Creates a `GtkVideo` to play back the given @filename.static Video
newForFileVideo
(File file) Creates a `GtkVideo` to play back the given @file.static Video
newForMediaStreamVideo
(MediaStream stream) Creates a `GtkVideo` to play back the given @stream.static Video
newForResourceVideo
(Str resource_path) Creates a `GtkVideo` to play back the resource at the
given @resource_path.static Video
newForResourceVideo
(String resource_path) Creates a `GtkVideo` to play back the resource at the
given @resource_path.void
setAutoplay
(boolean autoplay) Sets whether @self automatically starts playback when it
becomes visible or when a new file gets loaded.void
Makes @self play the given @file.void
setFilename
(Str filename) Makes @self play the given @filename.void
setFilename
(String filename) Makes @self play the given @filename.void
setLoop
(boolean loop) Sets whether new files loaded by @self should be set to loop.void
setMediaStream
(MediaStream stream) Sets the media stream to be played back.void
setResource
(Str resource_path) Makes @self play the resource at the given @resource_path.void
setResource
(String resource_path) Makes @self play the resource at the given @resource_path.Methods inherited from class ch.bailu.gtk.gtk.Widget
actionSetEnabled, actionSetEnabled, activate, activateAction, activateAction, activateActionVariant, activateActionVariant, activateDefault, addController, addCssClass, addCssClass, addMnemonicLabel, addTickCallback, allocate, childFocus, computeBounds, computeExpand, computePoint, computeTransform, contains, createPangoContext, createPangoLayout, createPangoLayout, disposeTemplate, dragCheckThreshold, errorBell, getAllocatedBaseline, getAllocatedHeight, getAllocatedWidth, getAllocation, getAncestor, getCanFocus, getCanTarget, getChildVisible, getClipboard, getCssClasses, getCssName, getCursor, getDefaultDirection, getDirection, getDisplay, getFirstChild, getFocusable, getFocusChild, getFocusOnClick, getFontMap, getFontOptions, getFrameClock, getHalign, getHasTooltip, getHeight, getHexpand, getHexpandSet, getLastChild, getLayoutManager, getMapped, getMarginBottom, getMarginEnd, getMarginStart, getMarginTop, getName, getNative, getNextSibling, getOpacity, getOverflow, getPangoContext, getParent, getPreferredSize, getPrevSibling, getPrimaryClipboard, getRealized, getReceivesDefault, getRequestMode, getRoot, getScaleFactor, getSensitive, getSettings, getSize, getSizeRequest, getStateFlags, getStyleContext, getTemplateChild, getTemplateChild, getTooltipMarkup, getTooltipText, getValign, getVexpand, getVexpandSet, getVisible, getWidth, grabFocus, hasCssClass, hasCssClass, hasDefault, hasFocus, hasVisibleFocus, hide, inDestruction, initTemplate, insertActionGroup, insertActionGroup, insertAfter, insertBefore, isAncestor, isDrawable, isFocus, isSensitive, isVisible, keynavFailed, listMnemonicLabels, map, measure, mnemonicActivate, observeChildren, observeControllers, onDestroy, onDirectionChanged, onHide, onKeynavFailed, onMap, onMnemonicActivate, onMoveFocus, onQueryTooltip, onRealize, onShow, onStateFlagsChanged, onUnmap, onUnrealize, pick, queueAllocate, queueDraw, queueResize, realize, removeController, removeCssClass, removeCssClass, removeMnemonicLabel, removeTickCallback, setCanFocus, setCanTarget, setChildVisible, setCssClasses, setCursor, setCursorFromName, setCursorFromName, setDefaultDirection, setDirection, setFocusable, setFocusChild, setFocusOnClick, setFontMap, setFontOptions, setHalign, setHasTooltip, setHexpand, setHexpandSet, setLayoutManager, setMarginBottom, setMarginEnd, setMarginStart, setMarginTop, setName, setName, setOpacity, setOverflow, setParent, setReceivesDefault, setSensitive, setSizeRequest, setStateFlags, setTooltipMarkup, setTooltipMarkup, setTooltipText, setTooltipText, setValign, setVexpand, setVexpandSet, setVisible, shouldLayout, show, sizeAllocate, snapshotChild, triggerTooltipQuery, unmap, unparent, unrealize, unsetStateFlags
Methods inherited from class ch.bailu.gtk.gobject.Object
addToggleRef, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, disconnect, disconnect, dupData, dupData, dupQdata, forceFloating, freezeNotify, get, get, getData, getData, getProperty, getProperty, getQdata, interfaceFindProperty, interfaceInstallProperty, isFloating, notify, notify, notifyByPspec, onNotify, ref, refSink, removeToggleRef, replaceData, replaceData, replaceQdata, runDispose, set, set, setData, setData, setDataFull, setDataFull, setProperty, setProperty, setQdata, setQdataFull, stealData, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref
Methods inherited from class ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacks
Methods inherited from class ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNull
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Constructor Details
-
Video
-
Video
public Video()Creates a new empty `GtkVideo`.
-
-
Method Details
-
getClassHandler
-
newForFileVideo
Creates a `GtkVideo` to play back the given @file.- Parameters:
file
- a `GFile`- Returns:
- a new `GtkVideo`
-
newForFilenameVideo
Creates a `GtkVideo` to play back the given @filename.
This is a utility function that calls [ctor@Gtk.Video.new_for_file],
See that function for details.- Parameters:
filename
- filename to play back- Returns:
- a new `GtkVideo`
-
newForFilenameVideo
Creates a `GtkVideo` to play back the given @filename.
This is a utility function that calls [ctor@Gtk.Video.new_for_file],
See that function for details.- Parameters:
filename
- filename to play back- Returns:
- a new `GtkVideo`
-
newForMediaStreamVideo
Creates a `GtkVideo` to play back the given @stream.- Parameters:
stream
- a `GtkMediaStream`- Returns:
- a new `GtkVideo`
-
newForResourceVideo
Creates a `GtkVideo` to play back the resource at the
given @resource_path.
This is a utility function that calls [ctor@Gtk.Video.new_for_file].- Parameters:
resource_path
- resource path to play back- Returns:
- a new `GtkVideo`
-
newForResourceVideo
Creates a `GtkVideo` to play back the resource at the
given @resource_path.
This is a utility function that calls [ctor@Gtk.Video.new_for_file].- Parameters:
resource_path
- resource path to play back- Returns:
- a new `GtkVideo`
-
getAutoplay
public boolean getAutoplay()Returns %TRUE if videos have been set to loop.- Returns:
- %TRUE if streams should autoplay
-
getFile
Gets the file played by @self or %NULL if not playing back
a file.- Returns:
- The file played by @self
-
getLoop
public boolean getLoop()Returns %TRUE if videos have been set to loop.- Returns:
- %TRUE if streams should loop
-
getMediaStream
Gets the media stream managed by @self or %NULL if none.- Returns:
- The media stream managed by @self
-
setAutoplay
public void setAutoplay(boolean autoplay) Sets whether @self automatically starts playback when it
becomes visible or when a new file gets loaded.- Parameters:
autoplay
- whether media streams should autoplay
-
setFile
Makes @self play the given @file.- Parameters:
file
- the file to play
-
setFilename
Makes @self play the given @filename.
This is a utility function that calls gtk_video_set_file(),- Parameters:
filename
- the filename to play
-
setFilename
Makes @self play the given @filename.
This is a utility function that calls gtk_video_set_file(),- Parameters:
filename
- the filename to play
-
setLoop
public void setLoop(boolean loop) Sets whether new files loaded by @self should be set to loop.- Parameters:
loop
- whether media streams should loop
-
setMediaStream
Sets the media stream to be played back.
@self will take full control of managing the media stream. If you
want to manage a media stream yourself, consider using a
[class@Gtk.Picture] for display.
If you want to display a file, consider using [method@Gtk.Video.set_file]
instead.- Parameters:
stream
- The media stream to play or %NULL to unset
-
setResource
Makes @self play the resource at the given @resource_path.
This is a utility function that calls [method@Gtk.Video.set_file].- Parameters:
resource_path
- the resource to set
-
setResource
Makes @self play the resource at the given @resource_path.
This is a utility function that calls [method@Gtk.Video.set_file].- Parameters:
resource_path
- the resource to set
-
asAccessible
Implements interfaceAccessible
. Call this to get access to interface functions.- Overrides:
asAccessible
in classWidget
- Returns:
Accessible
-
asBuildable
Implements interfaceBuildable
. Call this to get access to interface functions.- Overrides:
asBuildable
in classWidget
- Returns:
Buildable
-
asConstraintTarget
Implements interfaceConstraintTarget
. Call this to get access to interface functions.- Overrides:
asConstraintTarget
in classWidget
- Returns:
ConstraintTarget
-
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-