preview.frame
Gives one JPEG frame of the program, from the primary canvas or another canvas.
JSON-RPC 2.0screen.capture
Parameters
- max_widthnumberThe frame's width at most, 64 to 1920. Default 720.
- canvasstringA canvas id from state.get. Without it, or with an unknown id, the primary canvas.
Result
- mimestring"image/jpeg".
- widthnumberIts width.
- heightnumberIts height.
- datastringThe JPEG, base64.
Example
{ "jsonrpc": "2.0", "id": 1, "method": "preview.frame", "params": {}}lightair call preview.frameconst result = lightair.call("preview.frame", {});