Fix video player refs (#3604)
This commit is contained in:
parent
c2868cf5a8
commit
c977e38639
1 changed files with 5 additions and 5 deletions
|
|
@ -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}
|
||||
|
|
|
|||
Loading…
Reference in a new issue