Skip to content

Commit

Permalink
fix: toggle replay video muted based on state
Browse files Browse the repository at this point in the history
  • Loading branch information
fbaiodias committed Jun 4, 2019
1 parent af659d6 commit af1ed4d
Show file tree
Hide file tree
Showing 2 changed files with 1,233 additions and 908 deletions.
17 changes: 11 additions & 6 deletions src/video-recorder.js
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,16 @@ export default class VideoRecorder extends Component {
}
}

handleReplayVideoClick = () => {
if (this.replayVideo.paused) {
this.replayVideo.play()
}

this.setState({
isReplayVideoMuted: !this.state.isReplayVideoMuted
})
}

renderCameraView () {
const {
renderDisconnectedView,
Expand Down Expand Up @@ -546,12 +556,7 @@ export default class VideoRecorder extends Component {
muted={isReplayVideoMuted}
playsInline
autoPlay
onClick={() => {
if (this.replayVideo.paused) {
this.replayVideo.play()
}
this.setState({ isReplayVideoMuted: !this.replayVideo.muted })
}}
onClick={this.handleReplayVideoClick}
/>
{videoInput}
</CameraView>
Expand Down
Loading

0 comments on commit af1ed4d

Please sign in to comment.