1.0.0-beta.3 • Published 1 year ago

@meedwire/react-native-video-manager v1.0.0-beta.3

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

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

1.0.0-beta.2

1 year ago

1.0.0-beta.3

1 year ago

1.0.0-beta.1

2 years ago

1.0.0-beta

2 years ago