Skip to content

Commit

Permalink
fix: play video on click
Browse files Browse the repository at this point in the history
  • Loading branch information
fbaiodias committed Feb 8, 2019
1 parent 83f5b24 commit 07e1b6f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/get-video-info.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ const getVideoInfo = videoBlob =>
duration: null,
thumbnail: null
})
videoTag.remoteEventListener('loadeddata', handleLoadedData)
videoTag.remoteEventListener &&
videoTag.remoteEventListener('loadeddata', handleLoadedData)
window.URL.revokeObjectURL(videoTag.src)
}

Expand Down
7 changes: 5 additions & 2 deletions src/video-recorder.js
Original file line number Diff line number Diff line change
Expand Up @@ -455,9 +455,12 @@ export default class VideoRecorder extends Component {
muted={isReplayVideoMuted}
playsInline
autoPlay
onClick={() =>
onClick={() => {
if (this.replayVideo.paused) {
this.replayVideo.play()
}
this.setState({ isReplayVideoMuted: !isReplayVideoMuted })
}
}}
/>
{videoInput}
</CameraView>
Expand Down

0 comments on commit 07e1b6f

Please sign in to comment.