Recording
ConsoleMonster.Export
Exports JSON-lines recordings (written by a live session with a recorder) to an animated SVG (CSS keyframes, no script), a self-contained HTML player (play/pause, speed, scrubbing) or asciicast v3 for standard players. A recording holds updates, not pictures, so it is played into the widget tree it was recorded from (the same dashboard definition) at a fixed size and frame rate.
Inheritance
- object
- Recording
Methods
public static List<RecordedFrame> CaptureFrames(IWidget root, IEnumerable<LiveEvent> events, RecordingExportOptions? options = null) #Replays dashboard events into distinct timed cell grids for image add-ons and other consumers.
Parameters
- root ConsoleMonster.Layout.IWidget
- events System.Collections.Generic.IEnumerable<ConsoleMonster.Live.LiveEvent>
- options ConsoleMonster.Export.RecordingExportOptions? = null
Returns
List<RecordedFrame>public static RenderedOutput Render(IWidget root, TextReader jsonLines, OutputFormat format, RecordingExportOptions? options = null) #Renders a recording file in a format.
Parameters
- root ConsoleMonster.Layout.IWidget
- The dashboard the events were recorded from.
- jsonLines System.IO.TextReader
- The recording (JSON lines).
- format ConsoleMonster.Export.OutputFormat
- Html, Svg, Asciicast or Text.
- options ConsoleMonster.Export.RecordingExportOptions? = null
- Pacing, theme and player settings.
public static RenderedOutput Render(IWidget root, IEnumerable<LiveEvent> events, OutputFormat format, RecordingExportOptions? options = null) #Renders recorded events in a format.
Parameters
- root ConsoleMonster.Layout.IWidget
- The dashboard the events were recorded from.
- events System.Collections.Generic.IEnumerable<ConsoleMonster.Live.LiveEvent>
- The events.
- format ConsoleMonster.Export.OutputFormat
- Html, Svg, Asciicast or Text.
- options ConsoleMonster.Export.RecordingExportOptions? = null
- Pacing, theme and player settings.
public static RenderedOutput Render(IReadOnlyList<RecordedFrame> frames, OutputFormat format, RecordingExportOptions? options = null) #Renders recorded frames in a format.
Parameters
- frames System.Collections.Generic.IReadOnlyList<ConsoleMonster.Export.RecordedFrame>
- The frames.
- format ConsoleMonster.Export.OutputFormat
- Html, Svg, Asciicast or Text.
- options ConsoleMonster.Export.RecordingExportOptions? = null
- Pacing, theme and player settings.
public static void Save(IWidget root, string recordingPath, string outputPath, OutputFormat? format = null, RecordingExportOptions? options = null) #Exports a recording file to another file (UTF-8 without a byte order mark).
Parameters
- root ConsoleMonster.Layout.IWidget
- The widget tree the recording was made with.
- recordingPath string
- The .jsonl recording.
- outputPath string
- The output file.
- format ConsoleMonster.Export.OutputFormat? = null
- The format; null picks it from the output extension (.html, .svg, .cast; .json writes player data).
- options ConsoleMonster.Export.RecordingExportOptions? = null
- The options.
public static string ToAsciicast(IWidget root, TextReader jsonLines, RecordingExportOptions? options = null) #Exports a recording as asciicast v3.
Parameters
- root ConsoleMonster.Layout.IWidget
- The widget tree the recording was made with.
- jsonLines System.IO.TextReader
- The recording.
- options ConsoleMonster.Export.RecordingExportOptions? = null
- Size, frame rate and theme.
Returns
string The asciicast lines.public static string ToHtml(IWidget root, TextReader jsonLines, RecordingExportOptions? options = null) #Exports a recording as an HTML player.
Parameters
- root ConsoleMonster.Layout.IWidget
- The widget tree the recording was made with.
- jsonLines System.IO.TextReader
- The recording.
- options ConsoleMonster.Export.RecordingExportOptions? = null
- Size, frame rate, theme and window frame.
Returns
string The HTML.public static string ToPlayerData(IWidget root, TextReader jsonLines, RecordingExportOptions? options = null) #Exports a recording as player data (JSON) for the native player (ConsoleExporter.PlayerScript), so a site includes the script once and points any number of players at their data instead of embedding whole pages. The data holds the distinct rows as HTML, each frame as its start time and row numbers, and the screen CSS (scoped to its player by the script). It is safe to embed in a script type="application/json" element.
Parameters
- root ConsoleMonster.Layout.IWidget
- The widget tree the recording was made with.
- jsonLines System.IO.TextReader
- The recording.
- options ConsoleMonster.Export.RecordingExportOptions? = null
- Size, frame rate, theme and window frame.
Returns
string The JSON.public static string ToPlayerData(IWidget root, IEnumerable<LiveEvent> events, RecordingExportOptions? options = null) #Exports recorded events as player data (JSON); see Recording.ToPlayerData.
Parameters
- root ConsoleMonster.Layout.IWidget
- The widget tree the events address.
- events System.Collections.Generic.IEnumerable<ConsoleMonster.Live.LiveEvent>
- The events, in order, with their times.
- options ConsoleMonster.Export.RecordingExportOptions? = null
- Size, frame rate, theme and window frame.
Returns
string The JSON.public static string ToSvg(IWidget root, TextReader jsonLines, RecordingExportOptions? options = null) #Exports a recording as an animated SVG.
Parameters
- root ConsoleMonster.Layout.IWidget
- The widget tree the recording was made with.
- jsonLines System.IO.TextReader
- The recording.
- options ConsoleMonster.Export.RecordingExportOptions? = null
- Size, frame rate, theme and window frame.
Returns
string The SVG.