UNPKG

@remotion/player

Version:

React component for embedding a Remotion preview into your app

39 lines (37 loc) 1.49 kB
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime"; import { ICON_SIZE } from './icons.js'; const className = '__remotion_buffering_indicator'; const remotionBufferingAnimation = '__remotion_buffering_animation'; export const bufferingIndicatorStrokeWidth = 3; const playerStyle = { width: ICON_SIZE, height: ICON_SIZE, overflow: 'hidden', lineHeight: 'normal', fontSize: 'inherit', }; const studioStyle = { width: 14, height: 14, overflow: 'hidden', lineHeight: 'normal', fontSize: 'inherit', }; export const BufferingIndicator = ({ type }) => { const style = type === 'player' ? playerStyle : studioStyle; return (_jsxs(_Fragment, { children: [_jsx("style", { type: "text/css", children: ` @keyframes ${remotionBufferingAnimation} { 0% { rotate: 0deg; } 100% { rotate: 360deg; } } .${className} { animation: ${remotionBufferingAnimation} 1s linear infinite; } ` }), _jsx("div", { style: style, children: _jsx("svg", { viewBox: type === 'player' ? '0 0 22 22' : '0 0 18 18', style: style, className: className, children: _jsx("path", { d: type === 'player' ? 'M 11 4 A 7 7 0 0 1 15.1145 16.66312' : 'M 9 2 A 7 7 0 0 1 13.1145 14.66312', stroke: "white", strokeLinecap: "round", fill: "none", strokeWidth: 3 }) }) })] })); };