forked from ttdatt/react-native-video-quickblox
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQuickbloxLocalVideoView.js
More file actions
40 lines (33 loc) · 870 Bytes
/
QuickbloxLocalVideoView.js
File metadata and controls
40 lines (33 loc) · 870 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/**
* Created by Dat Tran on 2/8/17.
*/
import React from 'react';
import PropTypes from 'prop-types'
import {requireNativeComponent} from 'react-native';
export default class QuickbloxLocalVideoView extends React.Component {
constructor(props) {
super(props);
this.onRendered = this.onRendered.bind(this);
}
onRendered(event) {
if (this.props.onRendered)
this.props.onRendered()
}
stopCamera() {
this.myRef.setNativeProps({stopCamera: true})
}
render() {
return <NativeQuickbloxLocalVideoView
{...this.props}
ref={ci => this.myRef = ci}
onChange={() => {
this.setState({bottom: 0})
this.onRendered()
}}
/>;
}
}
QuickbloxLocalVideoView.propTypes = {
onRendered: PropTypes.func
}
const NativeQuickbloxLocalVideoView = requireNativeComponent('QuickbloxLocalVideoView', null);