Skip to content

Commit

Permalink
fix: isVideoInputSupported check
Browse files Browse the repository at this point in the history
  • Loading branch information
fbaiodias committed Nov 30, 2018
1 parent c99a5ea commit 0fc9ed2
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/video-recorder.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,6 @@ const Video = styled.video`
${props => props.onClick && 'cursor: pointer;'};
`

const isIOSSafari = () => {
const ua = window.navigator.userAgent
const iOS = !!ua.match(/iPad/i) || !!ua.match(/iPhone/i)
const webkit = !!ua.match(/WebKit/i)
return iOS && webkit
}

const captureThumb = videoTag =>
new Promise((resolve, reject) => {
const canvas = document.createElement('canvas')
Expand Down Expand Up @@ -110,7 +103,9 @@ export default class VideoRecorder extends Component {

const isInlineRecordingSupported =
!!window.MediaSource && !!window.MediaRecorder
const isVideoInputSupported = isIOSSafari()

const isVideoInputSupported =
document.createElement('input').capture !== undefined

this.state = {
isRecording: false,
Expand Down

0 comments on commit 0fc9ed2

Please sign in to comment.