Video

open class Video : Widget, VideoProtocol

GtkVideo is a widget to show a GtkMediaStream with media controls.

An example GtkVideo

The controls are available separately as [classGtk.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 [classGtk.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 [classGdk.Paintable] API and a media framework such as Gstreamer directly.

The Video type acts as a reference-counted owner of an underlying GtkVideo instance. It provides the methods that can operate on this data type through VideoProtocol conformance. Use Video as a strong reference or owner of a GtkVideo instance.

  • Designated initialiser from the underlying `C` data type.
    

    This creates an instance without performing an unbalanced retain i.e., ownership is transferred to the Video instance.

    Declaration

    Swift

    @inlinable
    public init(_ op: UnsafeMutablePointer<GtkVideo>)

    Parameters

    op

    pointer to the underlying object

  • Designated initialiser from a constant pointer to the underlying C data type. This creates an instance without performing an unbalanced retain i.e., ownership is transferred to the Video instance.

    Declaration

    Swift

    @inlinable
    public init(_ op: UnsafePointer<GtkVideo>)

    Parameters

    op

    pointer to the underlying object

  • Optional initialiser from a non-mutating gpointer to the underlying C data type. This creates an instance without performing an unbalanced retain i.e., ownership is transferred to the Video instance.

    Declaration

    Swift

    @inlinable
    override public init!(gpointer op: gpointer?)

    Parameters

    op

    gpointer to the underlying object

  • Optional initialiser from a non-mutating gconstpointer to the underlying C data type. This creates an instance without performing an unbalanced retain i.e., ownership is transferred to the Video instance.

    Declaration

    Swift

    @inlinable
    override public init!(gconstpointer op: gconstpointer?)

    Parameters

    op

    pointer to the underlying object

  • Optional initialiser from a constant pointer to the underlying C data type. This creates an instance without performing an unbalanced retain i.e., ownership is transferred to the Video instance.

    Declaration

    Swift

    @inlinable
    public init!(_ op: UnsafePointer<GtkVideo>?)

    Parameters

    op

    pointer to the underlying object

  • Optional initialiser from the underlying C data type. This creates an instance without performing an unbalanced retain i.e., ownership is transferred to the Video instance.

    Declaration

    Swift

    @inlinable
    public init!(_ op: UnsafeMutablePointer<GtkVideo>?)

    Parameters

    op

    pointer to the underlying object

  • Designated initialiser from the underlying C data type. Will retain GtkVideo. i.e., ownership is transferred to the Video instance.

    Declaration

    Swift

    @inlinable
    public init(retaining op: UnsafeMutablePointer<GtkVideo>)

    Parameters

    op

    pointer to the underlying object

  • Reference intialiser for a related type that implements VideoProtocol Will retain GtkVideo.

    Declaration

    Swift

    @inlinable
    public init<T>(video other: T) where T : VideoProtocol

    Parameters

    other

    an instance of a related type that implements VideoProtocol

  • Unsafe typed initialiser. Do not use unless you know the underlying data type the pointer points to conforms to VideoProtocol.

    Declaration

    Swift

    @inlinable
    override public init<T>(cPointer p: UnsafeMutablePointer<T>)

    Parameters

    cPointer

    pointer to the underlying object

  • Unsafe typed, retaining initialiser. Do not use unless you know the underlying data type the pointer points to conforms to VideoProtocol.

    Declaration

    Swift

    @inlinable
    override public init<T>(retainingCPointer cPointer: UnsafeMutablePointer<T>)

    Parameters

    cPointer

    pointer to the underlying object

  • Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to VideoProtocol.

    Declaration

    Swift

    @inlinable
    override public init(raw p: UnsafeRawPointer)

    Parameters

    p

    raw pointer to the underlying object

  • Unsafe untyped, retaining initialiser. Do not use unless you know the underlying data type the pointer points to conforms to VideoProtocol.

    Declaration

    Swift

    @inlinable
    override public init(retainingRaw raw: UnsafeRawPointer)
  • Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to VideoProtocol.

    Declaration

    Swift

    @inlinable
    public required init(raw p: UnsafeMutableRawPointer)

    Parameters

    p

    mutable raw pointer to the underlying object

  • Unsafe untyped, retaining initialiser. Do not use unless you know the underlying data type the pointer points to conforms to VideoProtocol.

    Declaration

    Swift

    @inlinable
    required public init(retainingRaw raw: UnsafeMutableRawPointer)

    Parameters

    raw

    mutable raw pointer to the underlying object

  • Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to VideoProtocol.

    Declaration

    Swift

    @inlinable
    override public init(opaquePointer p: OpaquePointer)

    Parameters

    p

    opaque pointer to the underlying object

  • Unsafe untyped, retaining initialiser. Do not use unless you know the underlying data type the pointer points to conforms to VideoProtocol.

    Declaration

    Swift

    @inlinable
    override public init(retainingOpaquePointer p: OpaquePointer)

    Parameters

    p

    opaque pointer to the underlying object

  • Creates a new empty GtkVideo.

    Declaration

    Swift

    @inlinable
    public init()
  • Creates a GtkVideo to play back the given file.

    Declaration

    Swift

    @inlinable
    public init<FileT>(file: FileT?) where FileT : FileProtocol
  • Creates a GtkVideo to play back the given filename.

    This is a utility function that calls [ctorGtk.Video.new_for_file], See that function for details.

    Declaration

    Swift

    @inlinable
    public init(filename: UnsafePointer<CChar>? = nil)
  • Creates a GtkVideo to play back the given stream.

    Declaration

    Swift

    @inlinable
    public init<MediaStreamT>(mediaStream stream: MediaStreamT?) where MediaStreamT : MediaStreamProtocol
  • Creates a GtkVideo to play back the resource at the given resource_path.

    This is a utility function that calls [ctorGtk.Video.new_for_file].

    Declaration

    Swift

    @inlinable
    public init(resource resourcePath: UnsafePointer<CChar>? = nil)
  • Creates a GtkVideo to play back the given file.

    Declaration

    Swift

    @inlinable
    public static func newFor<FileT>(file: FileT?) -> Widget! where FileT : FileProtocol
  • Creates a GtkVideo to play back the given filename.

    This is a utility function that calls [ctorGtk.Video.new_for_file], See that function for details.

    Declaration

    Swift

    @inlinable
    public static func newFor(filename: UnsafePointer<CChar>? = nil) -> Widget!
  • Creates a GtkVideo to play back the given stream.

    Declaration

    Swift

    @inlinable
    public static func newForMedia<MediaStreamT>(mediaStream stream: MediaStreamT?) -> Widget! where MediaStreamT : MediaStreamProtocol
  • Creates a GtkVideo to play back the resource at the given resource_path.

    This is a utility function that calls [ctorGtk.Video.new_for_file].

    Declaration

    Swift

    @inlinable
    public static func newFor(resource resourcePath: UnsafePointer<CChar>? = nil) -> Widget!