VideoRef

public struct VideoRef : VideoProtocol, GWeakCapturing

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 VideoRef type acts as a lightweight Swift reference to an underlying GtkVideo instance. It exposes methods that can operate on this data type through VideoProtocol conformance. Use VideoRef only as an unowned reference to an existing GtkVideo instance.

  • ptr
    Untyped pointer to the underlying `GtkVideo` instance.
    

    For type-safe access, use the generated, typed pointer video_ptr property instead.

    Declaration

    Swift

    public let ptr: UnsafeMutableRawPointer!

Video Class

  • Designated initialiser from the underlying C data type

    Declaration

    Swift

    @inlinable
    init(_ p: UnsafeMutablePointer<GtkVideo>)
  • Designated initialiser from a constant pointer to the underlying C data type

    Declaration

    Swift

    @inlinable
    init(_ p: UnsafePointer<GtkVideo>)
  • Conditional initialiser from an optional pointer to the underlying C data type

    Declaration

    Swift

    @inlinable
    init!(_ maybePointer: UnsafeMutablePointer<GtkVideo>?)
  • Conditional initialiser from an optional, non-mutable pointer to the underlying C data type

    Declaration

    Swift

    @inlinable
    init!(_ maybePointer: UnsafePointer<GtkVideo>?)
  • Conditional initialiser from an optional gpointer

    Declaration

    Swift

    @inlinable
    init!(gpointer g: gpointer?)
  • Conditional initialiser from an optional, non-mutable gconstpointer

    Declaration

    Swift

    @inlinable
    init!(gconstpointer g: gconstpointer?)
  • Reference intialiser for a related type that implements VideoProtocol

    Declaration

    Swift

    @inlinable
    init<T>(_ other: T) where T : VideoProtocol
  • This factory is syntactic sugar for setting weak pointers wrapped in GWeak<T>

    Declaration

    Swift

    @inlinable
    static func unowned<T>(_ other: T) -> VideoRef where T : VideoProtocol
  • Unsafe typed initialiser. Do not use unless you know the underlying data type the pointer points to conforms to VideoProtocol.

    Declaration

    Swift

    @inlinable
    init<T>(cPointer: UnsafeMutablePointer<T>)
  • Unsafe typed initialiser. Do not use unless you know the underlying data type the pointer points to conforms to VideoProtocol.

    Declaration

    Swift

    @inlinable
    init<T>(constPointer: UnsafePointer<T>)
  • Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to VideoProtocol.

    Declaration

    Swift

    @inlinable
    init(mutating 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
    init(raw: UnsafeMutableRawPointer)
  • Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to VideoProtocol.

    Declaration

    Swift

    @inlinable
    init(opaquePointer: OpaquePointer)
  • Creates a new empty GtkVideo.

    Declaration

    Swift

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

    Declaration

    Swift

    @inlinable
    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
    init(filename: UnsafePointer<CChar>? = nil)
  • Creates a GtkVideo to play back the given stream.

    Declaration

    Swift

    @inlinable
    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
    init(resource resourcePath: UnsafePointer<CChar>? = nil)
  • Creates a GtkVideo to play back the given file.

    Declaration

    Swift

    @inlinable
    static func newFor<FileT>(file: FileT?) -> WidgetRef! 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
    static func newFor(filename: UnsafePointer<CChar>? = nil) -> WidgetRef!
  • Creates a GtkVideo to play back the given stream.

    Declaration

    Swift

    @inlinable
    static func newForMedia<MediaStreamT>(mediaStream stream: MediaStreamT?) -> WidgetRef! 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
    static func newFor(resource resourcePath: UnsafePointer<CChar>? = nil) -> WidgetRef!