Skip to content

Commit 4c71322

Browse files
authored
Add autoInitializeCamera prop (#505)
1 parent fc13008 commit 4c71322

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/TwilioVideo.ios.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,12 @@ export default class TwilioVideo extends Component {
150150
* @param {{ participant, room }} dominant participant
151151
*/
152152
onDominantSpeakerDidChange: PropTypes.func,
153+
/**
154+
* Whether or not video should be automatically initialized upon mounting
155+
* of this component. Defaults to true. If set to false, any use of the
156+
* camera will require calling `_startLocalVideo`.
157+
*/
158+
autoInitializeCamera: PropTypes.bool,
153159
...View.propTypes
154160
}
155161

@@ -162,7 +168,9 @@ export default class TwilioVideo extends Component {
162168

163169
componentDidMount () {
164170
this._registerEvents()
165-
this._startLocalVideo()
171+
if (this.props.autoInitializeCamera !== false) {
172+
this._startLocalVideo()
173+
}
166174
this._startLocalAudio()
167175
}
168176

0 commit comments

Comments
 (0)