shahen94 / react-native-video-processing

Native Video editing/trimming/compressing :movie_camera: library for React-Native
https://shahen94.github.io/react-native-video-processing/
MIT License
1.25k stars 326 forks source link

Readme file, running sample codes throws error "this.videoPlayerRef is undefined" #293

Open yalcinozer opened 4 years ago

yalcinozer commented 4 years ago

Current Behavior

Copy-pasting sample codes throws error "this.videoPlayerRef is undefined"

Expected Behavior

Sample codes are expected to run without errors

Solution

In sample codes, replacing methods with arrow functions makes "this" accessible and solves error. From trimVideo(){...this.videoPlayerRef...} To trimVideo=()=>{...this.videoPlayerRef...}

It easy to notice but novice developers could be in a hard time.

Thanks for the great library by the way.