@meedwire/react-native-video-manager
TypeScript icon, indicating that this package has built-in type declarations

1.0.0-beta.3 • Public • Published

react-native-video-manager

Package for manager video

Installation

yarn add react-native-video-manager

Usage - Get frames video

import { getFramesVideo } from 'react-native-video-manager';

// ...

const App: React.FC = () => {
    const [source, setSouce] = useState()

    const getFrames = useCallback(async () => {
        try {
            if (!source) return;

            const frames = await getVideoFrames(source);

            setFrames(frames);
        }catch(e){
            console.error(e)
        }
    }, [source])

    return (
        <View>
            <Button title="Retrieve Frames" onPress={getFrames} />
        <View/>
    )
}

Usage - Compress Video

import { compress } from 'react-native-video-manager';

// ...

const App: React.FC = () => {
    const [source, setSouce] = useState()

    const handleCropVideo = useCallback(async () => {
        try {
            if (!source) return;

            const {
                filePath,
                fileSize,
                originalFileSize
            } = await compress(source);

            setSouce(filePath);
        }catch(e){
            console.error(e)
        }
    }, [source])

    return (
        <View>
            <Button title="Retrieve Frames" onPress={handleCropVideo} />
        <View/>
    )
}

Usage - Crop Video

import { cropVideo } from 'react-native-video-manager';

// ...

const App: React.FC = () => {
    const [source, setSouce] = useState()

    const handleCropVideo = useCallback(async () => {
        try {
            if (!source) return;

            // Seconds
            const startTime = 0;
            // Seconds
            const endTime = 10;

            const source = await cropVideo(source, {startTime, endTime});

            setSouce(source);
        }catch(e){
            console.error(e)
        }
    }, [source])

    return (
        <View>
            <Button title="Retrieve Frames" onPress={handleCropVideo} />
        <View/>
    )
}

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT


Made with create-react-native-library

Package Sidebar

Install

npm i @meedwire/react-native-video-manager

Weekly Downloads

0

Version

1.0.0-beta.3

License

MIT

Unpacked Size

155 kB

Total Files

33

Last publish

Collaborators

  • meedwire