class

Opal::Asciicast::PlaybackEngine

Inherits Reference < Object

Playback and inspection engine for Asciinema v2 recordings. Reconstructs terminal screens into UI::Buffer frames, supports frame-by-frame stepping, seeking, speed multipliers, and overlay-respecting compositing.

Constructors

from_file(path : String) : self

Factory constructor from file path

Source
from_string(content : String) : self

Factory constructor from raw asciicast string

Source
new(recording : Reader::Recording)
Source

Instance methods

add_overlay(element : UI::Element, x : Int32, y : Int32, width : Int32, height : Int32) : self

Attaches a persistent overlay element to be composited over playback

Source
clear_overlays

Clears all persistent overlays

Source
current_buffer

Returns the current visual buffer

Source
current_frame

Returns the current frame or a blank buffer if no frames exist

Source
current_index
Source
current_timestamp

Returns the current timestamp in seconds

Source
duration
Source
empty?
Source
frames
Source
goto_frame(index : Int32) : PlaybackFrame

Seeks directly to a frame index

Source
has_next?
Source
has_prev?
Source
height
Source
looping=(looping : Bool)
Source
looping?
Source
next_frame

Advances to the next frame

Source
pause
Source
paused?
Source
play(speed : Float64 = 1.0, loop : Bool = false, &block : UI::Buffer, Int32 -> Nil) : Nil

Automated playback loop yielding each frame buffer and frame index

Source
playing?
Source
prev_frame

Steps back to the previous frame

Source
recording
Source
render_frame(target : UI::Buffer, x : Int32 = 0, y : Int32 = 0, respect_overlays : Bool = false) : Nil

Composites the current playback frame into the target buffer. If respect_overlays is true, does not overwrite non-space cells already in target.

Source
resume
Source
rewind

Rewinds playback to frame 0

Source
seek(timestamp_seconds : Float64) : PlaybackFrame

Seeks to the frame closest to the specified timestamp in seconds

Source
speed
Source
speed=(speed : Float64)
Source
stop
Source
total_frames
Source
width
Source