juananime / react-native-audiowaveform

Audio waveform renderer for React Native
261 stars 94 forks source link

Is there a loaded callback function? #58

Open idoor88 opened 4 years ago

idoor88 commented 4 years ago

Hi, I am using the waveform component, but sometimes it takes a while to load the sound file and show up the waveform on view, I like to put a loading spinner before it is loaded, after it is loaded then turn off the spinner, so is there a loaded callback function where I can turn off the loading spinner? my code looks like this:

`

               {audioFileURL.length!=0 && <WaveForm

                style={styles.waveform}

                onPress={this.changestate}

                source={{uri: audioFileURL}}

                stop={stopAudio}

                play={playAudio}

                autoPlay={true}

                waveFormStyle={{ waveColor: "lightsteelblue", scrubColor: "white" }}

              />}

`