Socket
Socket
Sign inDemoInstall

@meedwire/react-native-video-manager

Package Overview
Dependencies
514
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @meedwire/react-native-video-manager

Used to assist in video manipulation


Version published
Weekly downloads
1
Maintainers
1
Created
Weekly downloads
 

Readme

Source

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

Keywords

FAQs

Last updated on 21 Mar 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc