replayPlayer.stories.js 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import styled from '@emotion/styled';
  2. import {Provider as ReplayContextProvider} from 'sentry/components/replays/replayContext';
  3. import ReplayPlayer from 'sentry/components/replays/replayPlayer';
  4. import events from './example_rrweb_events_1.json';
  5. export default {
  6. title: 'Components/Replays/ReplayPlayer',
  7. component: ReplayPlayer,
  8. };
  9. const ManualResize = styled('div')`
  10. resize: both;
  11. overflow: auto;
  12. width: 50%;
  13. `;
  14. export const ScaledReplayPlayer = () => (
  15. <ReplayContextProvider events={events}>
  16. <ManualResize>
  17. <ReplayPlayer />
  18. </ManualResize>
  19. </ReplayContextProvider>
  20. );
  21. export const FastForwardingReplayPlayer = () => (
  22. <ReplayContextProvider value={{fastForwardSpeed: 4}} events={events}>
  23. <ManualResize>
  24. <ReplayPlayer />
  25. </ManualResize>
  26. </ReplayContextProvider>
  27. );
  28. export const BufferingReplayPlayer = () => (
  29. <ReplayContextProvider value={{isBuffering: true}} events={events}>
  30. <ManualResize>
  31. <ReplayPlayer />
  32. </ManualResize>
  33. </ReplayContextProvider>
  34. );