Skip to content

Commit

Permalink
fix: support added to allow recording on iOS Safari (#119)
Browse files Browse the repository at this point in the history
* fix: fixed issue of unable to stop recording in case of safari

 1. Added mimeType mp4 for Safari Browser Support
 2. Bypassed function for fixMetaData in case of Safari

* fix: updated to fix ios issue for video el

 Added playsInline attribute

* fix: updated to stream once video element is created

 Added change to test in ios mobile

* fix: updated the condition for ios mobile.
 Black screen appears when user tries to turn on camera

* fix: logger added to debug issue in ios

* fix: support added to allow recording on iOS Safari

 Changes:
 * we use window.MediaSource to check if inline recording is supported but that is not used anywhere in the code.
 * window.MediaSource is not supported in ios on safari as well
 * Updated the condition to check only if MediaRecorder and mediaDevices are supported to check for inline recording
  • Loading branch information
Swapnil256 authored Jun 11, 2021
1 parent 4f367cc commit 085fe19
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/video-recorder.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,15 +164,11 @@ export default class VideoRecorder extends Component {

componentDidMount () {
const isInlineRecordingSupported =
!!window.MediaSource && !!window.MediaRecorder && !!navigator.mediaDevices
!!window.MediaRecorder && !!navigator.mediaDevices

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

if (isInlineRecordingSupported) {
this.mediaSource = new window.MediaSource()
}

this.setState(
{
isInlineRecordingSupported,
Expand Down

1 comment on commit 085fe19

@vercel
Copy link

@vercel vercel bot commented on 085fe19 Jun 11, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.