Skip to content

Commit

Permalink
fix: video is not muted in constraints (#156)
Browse files Browse the repository at this point in the history
  • Loading branch information
asiniy authored Apr 10, 2022
1 parent 52bf3cf commit 7db323d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
},
"dependencies": {
"fix-webm-duration": "^1.0.4",
"lodash.clonedeep": "^4.5.0",
"react-svg-inline": "^2.1.0"
},
"devDependencies": {
Expand Down
17 changes: 10 additions & 7 deletions src/video-recorder.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, { Component } from 'react'
import PropTypes from 'prop-types'
import cloneDeep from 'lodash.clonedeep'
import styled, { css } from 'styled-components'
import fixWebmDuration from 'fix-webm-duration'

Expand Down Expand Up @@ -254,14 +255,16 @@ export default class VideoRecorder extends Component {
video: true
}

const currentConstraints = {
...this.props.constraints,
video: {
deviceId: {
exact: currentDeviceId
const currentConstraints = cloneDeep(
{
video: {
deviceId: {
exact: currentDeviceId
}
}
}
}
},
this.props.constraints
)

navigator.mediaDevices
.getUserMedia(currentConstraints)
Expand Down

1 comment on commit 7db323d

@vercel
Copy link

@vercel vercel bot commented on 7db323d Apr 10, 2022

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.