class

Emerald::VLC::MediaPlayer

Inherits Reference < Object

High-level media player wrapper controlling playback, tracks, subtitles, and video rendering.

Constructors

from_media(media : Media) : MediaPlayer
Source
new(instance : Instance | Nil = nil)
Source

Instance methods

add_subtitle_file(file_path : String) : Bool

Loads an external subtitle file (.srt, .vtt, .sub, .ass)

Source
aspect_ratio

Video aspect ratio string (e.g. "16:9", "4:3")

Source
aspect_ratio=(ratio : String) : String
Source
audio_channel

Audio output channel mode (Stereo, Reverse Stereo, Dolby, etc.)

Source
audio_channel=(ch : LibVLC::AudioOutputChannel) : LibVLC::AudioOutputChannel
Source
audio_delay_ms

Audio delay in milliseconds (for lip-sync correction)

Source
audio_delay_ms=(delay : Int64) : Int64
Source
audio_track=(track_id : Int32) : Int32
Source
audio_tracks

Available audio tracks

Source
can_pause?

True if pause is supported

Source
current_audio_track

Currently active audio track ID (-1 if disabled)

Source
current_subtitle_track

Currently active subtitle track ID (-1 if disabled)

Source
current_video_track
Source
enable_video_callbacks(frame_buffer : VideoFrameBuffer) : Nil

Enables memory video decoding using double-buffered frame surface

Source
equalizer=(eq : Equalizer | Nil) : Nil

Applies an audio graphic equalizer

Source
event_manager
Source
finalize
Source
frame_buffer
Source
handle
Source
instance
Source
length_ms

Media duration in milliseconds

Source
media
Source
media=(media : Media | Nil) : Media | Nil

Assigns a new media source to the player

Source
mute=(muted : Bool) : Bool
Source
mute?

Audio Mute state

Source
next_frame

Steps forward by a single video frame

Source
pause

Pauses playback

Source
play

Starts playback

Source
playback_rate

Playback speed rate multiplier (e.g. 1.0 = normal, 2.0 = double speed)

Source
playback_rate=(rate : Float32) : Float32

Sets playback speed rate multiplier (0.25 .. 4.0)

Source
playing?

Returns true if currently playing

Source
position

Current playback position as normalized ratio (0.0 .. 1.0)

Source
position=(pos : Float32) : Float32

Seeks to normalized ratio (0.0 .. 1.0)

Source
seekable?

True if seeking is supported by the media/stream

Source
state

Current playback state

Source
stop

Stops playback

Source
subtitle_delay_ms

Subtitle delay in milliseconds

Source
subtitle_delay_ms=(delay : Int64) : Int64
Source
subtitle_track=(track_id : Int32) : Int32
Source
subtitle_tracks

Subtitle / SPU tracks

Source
take_snapshot(file_path : String, width : UInt32 = 0_u32, height : UInt32 = 0_u32) : Bool

Captures a video snapshot to a local file (.png, .jpg)

Source
time_ms

Current playback position in milliseconds

Source
time_ms=(new_time_ms : Int64) : Int64

Seeks to timestamp in milliseconds

Source
toggle_mute
Source
toggle_pause

Toggles between play and pause

Source
video_size

Gets current video width and height in pixels

Source
video_track=(track_id : Int32) : Int32
Source
video_tracks

Video tracks

Source
volume

Audio Volume (0 .. 100/200)

Source
volume=(vol : Int32) : Int32
Source

Nested types