The Recorder class provides functionality to record and playback video like experiences. It can:
For performance during recording, a separate javascript worker is used to parallelize state encoding. Therefore, in addition to the FigureOne library, a FigureOne worker file will need to be loaded. See the tutorials for examples on how this is done.
For tutorials and examples of how to use Recorder, see
Notifications - The notification manager property notifications will
publish the following events:
timeUpdate: updated at period defined in property timeUpdatesdurationUpdated: updated whenever audio or video are loaded, or when
recording goes beyond the current durationaudioLoadedvideoLoadedrecordingStartedrecordingStoppedpreparingToPlayplaybackStartedpreparingToPauseplaybackStoppedseekrecordingStatesComplete - recording completed and recorded states ready@class
in seconds - change this to change the duration between recorded seek frames
in seconds - how often to publish the 'timeUpdate' notification
- use to subscribe to notifications
Recorder time format.
number | string
Use number for number of seconds, or use string with format 'm:s.s' (for
example, '1:23.5' would define 1 minute, 23.5 seconds)
Function Map
In FigureOne Recorder, state is saved in stringified javascript objects. When the state includes a function (like a trigger method in an animation for example) then that function is referenced in the state object as a unique string id.
When a geometry is loaded, functions that will be captured in state objects
need to be added to a function map. Both Figure and
FigureElement have attached function maps as the property fnMap.
Therefore, the method is added to either the figure or element function map,
with an associated unique string id, and that string id is used when the
function is used. For example as defined callbacks, triggerAnimationStep and
customAnimationStep callbacks, or recorder slide definitions (entryState,
steadyState, leaveState, exec, execDelta).
The funciton map has:
global function map
local function map where keys are unique identifiers and values are the associated functions
figure.fnMap.add('toConsole', s => console.log(s));
figure.fnMap.exec('toConsole', 'hello');
in seconds