42
guide.md
42
guide.md
@@ -295,27 +295,27 @@ replayer.destroy();
|
|||||||
|
|
||||||
The replayer accepts options as its constructor's second parameter, and it has the following options:
|
The replayer accepts options as its constructor's second parameter, and it has the following options:
|
||||||
|
|
||||||
| key | default | description |
|
| key | default | description |
|
||||||
| ------------------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
| ----------------------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||||
| speed | 1 | replay speed ratio |
|
| speed | 1 | replay speed ratio |
|
||||||
| root | document.body | the root element of replayer |
|
| root | document.body | the root element of replayer |
|
||||||
| loadTimeout | 0 | timeout of loading remote style sheet |
|
| loadTimeout | 0 | timeout of loading remote style sheet |
|
||||||
| skipInactive | false | whether to skip inactive time |
|
| skipInactive | false | whether to skip inactive time |
|
||||||
| inactivePeriodThreshold | 10000 | the threshold in milliseconds for what should be considered an inactive period |
|
| inactivePeriodThreshold | 10000 | the threshold in milliseconds for what should be considered an inactive period |
|
||||||
| showWarning | true | whether to print warning messages during replay |
|
| showWarning | true | whether to print warning messages during replay |
|
||||||
| showDebug | false | whether to print debug messages during replay |
|
| showDebug | false | whether to print debug messages during replay |
|
||||||
| blockClass | 'rr-block' | element with the class name will display as a blocked area |
|
| blockClass | 'rr-block' | element with the class name will display as a blocked area |
|
||||||
| liveMode | false | whether to enable live mode |
|
| liveMode | false | whether to enable live mode |
|
||||||
| insertStyleRules | [] | accepts multiple CSS rule string, which will be injected into the replay iframe |
|
| insertStyleRules | [] | accepts multiple CSS rule string, which will be injected into the replay iframe |
|
||||||
| triggerFocus | true | whether to trigger focus during replay |
|
| triggerFocus | true | whether to trigger focus during replay |
|
||||||
| UNSAFE_replayCanvas | false | whether to replay the canvas element. **Enable this will remove the sandbox, which is unsafe.** |
|
| UNSAFE_replayCanvas | false | whether to replay the canvas element. **Enable this will remove the sandbox, which is unsafe.** |
|
||||||
| pauseAnimation | true | whether to pause CSS animation when the replayer is paused |
|
| pauseAnimation | true | whether to pause CSS animation when the replayer is paused |
|
||||||
| mouseTail | true | whether to show mouse tail during replay. Set to false to disable mouse tail. A complete config can be found in this [type](https://github.com/rrweb-io/rrweb/blob/9488deb6d54a5f04350c063d942da5e96ab74075/src/types.ts#L407) |
|
| mouseTail | true | whether to show mouse tail during replay. Set to false to disable mouse tail. A complete config can be found in this [type](https://github.com/rrweb-io/rrweb/blob/9488deb6d54a5f04350c063d942da5e96ab74075/src/types.ts#L407) |
|
||||||
| unpackFn | - | refer to the [storage optimization recipe](./docs/recipes/optimize-storage.md) |
|
| unpackFn | - | refer to the [storage optimization recipe](./docs/recipes/optimize-storage.md) |
|
||||||
| logConfig | - | configuration of console output playback, refer to the [console recipe](./docs/recipes/console.md) |
|
| logConfig | - | configuration of console output playback, refer to the [console recipe](./docs/recipes/console.md) |
|
||||||
| plugins | [] | load plugins to provide extended replay functions. [What is plugins?](./docs/recipes/plugin.md) |
|
| plugins | [] | load plugins to provide extended replay functions. [What is plugins?](./docs/recipes/plugin.md) |
|
||||||
| useVirtualDom | true | whether to use Virtual Dom optimization in the process of skipping to a new point of time |
|
| useVirtualDom | true | whether to use Virtual Dom optimization in the process of skipping to a new point of time |
|
||||||
| logger | console | The logger object used by the replayer to print warnings or errors |
|
| logger | console | The logger object used by the replayer to print warnings or errors |
|
||||||
|
|
||||||
#### Use rrweb-player
|
#### Use rrweb-player
|
||||||
|
|
||||||
|
|||||||
@@ -167,7 +167,10 @@ function isUserInteraction(event: eventWithTime): boolean {
|
|||||||
* @param inactivePeriodThreshold - threshold of inactive time in milliseconds
|
* @param inactivePeriodThreshold - threshold of inactive time in milliseconds
|
||||||
* @returns periods of time consist with [start time, end time]
|
* @returns periods of time consist with [start time, end time]
|
||||||
*/
|
*/
|
||||||
export function getInactivePeriods(events: eventWithTime[], inactivePeriodThreshold: number) {
|
export function getInactivePeriods(
|
||||||
|
events: eventWithTime[],
|
||||||
|
inactivePeriodThreshold: number,
|
||||||
|
) {
|
||||||
const inactivePeriods: [number, number][] = [];
|
const inactivePeriods: [number, number][] = [];
|
||||||
let lastActiveTime = events[0].timestamp;
|
let lastActiveTime = events[0].timestamp;
|
||||||
for (const event of events) {
|
for (const event of events) {
|
||||||
|
|||||||
Reference in New Issue
Block a user