![]() ![]() However, if only a gif prop is provided, the first frame will be extracted and used as the still preview as soon as the GIF image has fully loaded. If one is left out, the other will be used as a fallback. GifPlayer expects one or both of the gif and still props. Still confused? Here's a jsfiddle which shows how to use pauseRef.Īny other attribute available on the HTML img tag can be passed as well (excluding src, which would be overwritten), though keep in mind React's version of that attribute may be different than you expect. here's an example class MyGifWrapper extends React. The word "ref" is used because its usage pattern is similar to React element refs: For example, you might want to stop the GIF when it scrolls offscreen. PauseRef: a function callback is called with another function, pause - this can be saved and called later to remotely pause the playing of the GIF, in such cases where that might be desired. Receives one argument, playing, which is a boolean. OnTogglePlay: a function which is called whenever the GIF toggles between playing and paused. ![]() JPG, PNG, etc.)Īutoplay: a boolean which can be set true if you want to immediately bombard your user with a moving GIF as soon as it's available Still: a string address to a still preview of the GIF (e.g. Gif: a string address to an animated GIF image. Options can be passed to the GifPlayer element as props. Var React = require( 'react ') var ReactDOM = require( 'react-dom ') var GifPlayer = require( 'react-gif-player ') // with JSX ReactDOM. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |