On-load on-off-on-work

I used a reaction video to play audio files, it works fine on Android, but on ios it cannot run the onLoad and onProgress functions that I use to get duration and progress. Below is my code.

<Video source={{ uri: songPlaying.url }}
          ref="audio"
          volume={this.state.muted ? 0 : 1.0}
          muted={false}
          paused={!this.state.playing}
          onLoad={this.onLoad.bind(this)}                                                   
          onProgress={this.setTime.bind(this)}
          onEnd={this.onEnd.bind(this)}
          resizeMode="cover"
          repeat={false} />    

 onLoad(params) {
    this.setState({ songDuration: params.duration });
  }

//called in onProgress to set time.

 setTime(params) {
    if (!this.state.sliding) {
      this.setState({ currentTime: params.currentTime });
    }
  }
+4
source share

Source: https://habr.com/ru/post/1689732/


All Articles