module

Emerald::Docs::NODES::VideoPlayer

EmeraldVideoPlayer (Control UI Node)

Executive Summary & Key Topics

Topic Method / Anchor Description
Overview .topic_01_overview Introduction to EmeraldVideoPlayer control node.
Inspector Properties .topic_02_inspector_properties Exposed properties visible in Godot editor inspector.
Usage Example in Crystal .topic_03_usage_example Instantiating and controlling EmeraldVideoPlayer programmatically.

Class methods

topic_01_overview

Overview: Introduction to EmeraldVideoPlayer control node.

EmeraldVideoPlayer is a Godot Control node that renders decoded video directly to an internal TextureRect with aspect ratio management and full playback controls.

Source
topic_02_inspector_properties

Inspector Properties: Exposed properties visible in Godot editor inspector.

  • source (String): File path (res:// or absolute) or stream URL (https://, rtsp://).
  • autoplay (Bool): If true, starts playback immediately upon entering the scene tree.
  • loop (Bool): If true, restarts playback automatically when the end is reached.
  • volume (Int32): Audio volume from 0 to 100.
  • playback_rate (Float64): Playback speed multiplier (0.25x to 4.0x).
  • aspect_mode (String): Aspect ratio mode: "Fit", "Fill", "Stretch", or "Center".
  • hardware_acceleration (String): Hardware video acceleration backend: "Auto", "None", "D3D11VA", "DXVA2", "VAAPI", "VDPAU", "VideoToolbox", "MediaCodec", or "NVDEC".
  • decoding_threads (Int32): Number of decoder worker threads (0 for auto).
  • low_latency (Bool): Enables low-latency caching for minimal frame delay.
  • drop_late_frames (Bool): Drops frames that arrive after their presentation timestamp.
Source
topic_03_usage_example

Usage Example in Crystal: Instantiating and controlling EmeraldVideoPlayer programmatically.

require "lapis"
require "emerald"

node CutsceneScene < Node2D do
  def _ready : Void
    player = EmeraldVideoPlayer.new
    player.source = "res://videos/intro_cutscene.mp4"
    player.volume = 100
    player.loop = false
    player.autoplay = true

    # Connect to completion signal
    player.playback_finished.connect do
      Godot.print("Cutscene finished, loading main menu...")
    end

    add_child(player)
  end
end
Source