Called immediately before mounting occurs, and before Component#render
.
Avoid introducing any side-effects or subscriptions in this method.
This method will not stop working in React 17.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.
Called when the component may be receiving new props. React may call this even if props have not changed, so be sure to compare new and existing props if you only want to handle changes.
Calling Component#setState
generally does not trigger this method.
This method will not stop working in React 17.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.
Called immediately before rendering when new props or state is received. Not called for the initial render.
Note: You cannot call Component#setState
here.
This method will not stop working in React 17.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.
Catches exceptions generated in descendant components. Unhandled exceptions will cause the entire component tree to unmount.
Invoked after the component is mounted first. Creates an interval timer which updates the the timecode every 10ms.
Called immediately after updating occurs. Not called for the initial render.
The snapshot is only present if getSnapshotBeforeUpdate is present and returns non-null.
Called immediately before mounting occurs, and before Component#render
.
Avoid introducing any side-effects or subscriptions in this method.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.
Called when the component may be receiving new props. React may call this even if props have not changed, so be sure to compare new and existing props if you only want to handle changes.
Calling Component#setState
generally does not trigger this method.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.
Invoked after the component is unmounted. Cancels the interval timer which updates the the timecode.
Called immediately before rendering when new props or state is received. Not called for the initial render.
Note: You cannot call Component#setState
here.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.
Runs before React applies the result of render
to the document, and
returns an object to be given to componentDidUpdate. Useful for saving
things such as scroll position before render
causes changes to it.
Note: the presence of getSnapshotBeforeUpdate prevents any of the deprecated lifecycle events from running.
Renders the component
Renders the settings modal if the corresponding state variable is set.
Converts a timestamp given in seconds into a timecode to be displayed on
the UI in the format 00:00:00.000
. If the timer hasn't been initialised
yet, the timecode is returned containing dashes instead of the numbers,
like so --:--:--.---
.
A timecode based on the current position in the stream
Sends a control command to the server to seek the stream by the given amount of seconds.
Number of seconds to seek the stream by
Sends a command to the remote control endpoint of the API for the document that the current session is attached to. Possible commands are:
{ adjust: n }
for adjusting the playback position{ playing: true/false }
for starting stopping playback{ showdirty: true/false}
for toggling between clean and dirty feedCommand to send to the server
Called to determine whether the change in props and state should trigger a re-render.
Component
always returns true.
PureComponent
implements a shallow comparison on props and state and returns true if any
props or states have changed.
If false is returned, Component#render
, componentWillUpdate
and componentDidUpdate
will not be called.
Toggles between clean and dirty feed by sending the corresponding command to the server.
Toggles playback state by sending the corresponding command to the server.
Renders the timecode popup if the corresponding state variable is set.
Adjusts the time offset of the clock by the given value.
Offset in seconds to add to the timestamp
Invoked when the component is about to receive new props. Updates playback position state in case it was changed through the props.
Generated using TypeDoc
This component allows the user to control the preview stream's playback and playback position, acting as a remote control for the preview player.
Document ID of the current session
Current status of the preview player
Callback for clearing the current session