React-based player for rrweb
npm install --save @posthog/react-rrweb-player
import React, { Component } from 'react'
import { EventIndex, formatTime, PlayerRef, PlayerContextProvider, PlayerController, PlayerFrame } from '@posthog/react-rrweb-player'
import '@posthog/react-rrweb-player/dist/index.css'
class Example extends Component {
render() {
return (
<PlayerContextProvider
ref={ref}
events={events}
key={recording.key}
onPlayerTimeChange={() => {}}
onNext={() => {}}
onPrevious={() => {}}
duration={duration}
isBuffering={false}
>
<PlayerFrame />
<PlayerController />
</PlayerContextProvider>
)
}
}
To develop locally, you can run the following commands and an example app will be launched on port 3000.
yarn # only the first time to install dependencies
yarn start # to run the base component
cd example
yarn start # to run the example project