react-native-svga-streamer
v0.1.0
Published
react-native-svga-streamerA cross-platform React Native library (Expo-compatible via config plugin / EAS) that streams SVGA animations and plays them immediately without fully downloading the SVGA file first. Designed for both bare React Native and Expo (
Readme
react-native-svga-streamer
Cross-platform SVGA player for React Native with streaming-friendly fetching and progress events. Works in bare RN and in Expo (via config plugin / EAS). Starts playback as soon as data is available and reports onLoadProgress.
Installation
yarn add react-native-svga-streamer
cd ios && pod install && cd -Usage
import { SVGAPlayer } from 'react-native-svga-streamer';
export default function Demo() {
return (
<SVGAPlayer
style={{ width: 200, height: 200 }}
source={{ uri: 'https://raw.githubusercontent.com/svga/SVGA-Samples/master/angel.svga' }}
autoPlay
onLoad={(meta) => console.log('loaded', meta)}
onLoadProgress={(p) => console.log('progress', p)}
onError={(e) => console.warn('error', e)}
onFinished={() => console.log('finished')}
/>
);
}Props
- source:
{ uri, headers? } | number(required) - autoPlay: boolean (default true)
- loops: number | 'infinite' (default 'infinite')
- speed: number (default 1)
- onLoad:
(meta) => void - onLoadProgress:
(event) => void - onError:
(err) => void - onFinished:
() => void
Expo
- Managed apps: the package ships a minimal config plugin. Use EAS build.
Contributing
License
MIT
Made with create-react-native-library
