Fix video player refs (#3604)

This commit is contained in:
Miguel Alatzar 2019-11-25 17:27:24 -07:00 committed by GitHub
parent c2868cf5a8
commit c977e38639
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -164,16 +164,16 @@ export default class VideoPreview extends PureComponent {
};
onReplay = () => {
if (this.refs.videoPlayer) {
if (this.videoPlayerRef) {
this.setState({playerState: PLAYER_STATE.PLAYING, paused: false});
this.refs.videoPlayer.seek(0);
this.videoPlayerRef.seek(0);
}
};
onSeek = (seek) => {
if (this.refs.videoPlayer) {
if (this.videoPlayerRef) {
this.setState({currentTime: seek}, () => {
this.refs.videoPlayer.seek(seek);
this.videoPlayerRef.seek(seek);
});
}
};
@ -215,7 +215,7 @@ export default class VideoPreview extends PureComponent {
<TouchableOpacity
style={StyleSheet.absoluteFill}
activeOpacity={1}
onPress={() => this.refs.controls.fadeInControls()}
onPress={() => this.controlsRef?.fadeInControls()}
>
<Video
ref={this.setVideoPlayerRef}