react-native-amr

1.0.7 • Public • Published

react-native-amr

Native AMR play for react-native (iOS only)

npm install react-native-amr
react-native link react-native-amr
import AMR from 'react-native-amr'
 
AMR.stop();
 
//callback: (error, event: {status}) => void)
// status: 0:playing, 1:play success end, 2:play failed, 3: stop
 
AMR.play(path, (error, event) => {
    console.log(error);
    console.log(event);
    if (!error) {
        if (event.status === 1) {
            //play success
        } else if(event.status === 3) {
            //stop success
        }
    } else {
        //event.status = 2
        console.log('can\'t play');
    }
});
 
 

/react-native-amr/

    Package Sidebar

    Install

    npm i react-native-amr

    Weekly Downloads

    3

    Version

    1.0.7

    License

    MIT

    Unpacked Size

    7.11 MB

    Total Files

    19

    Last publish

    Collaborators

    • nevolee