forked from evgeny-nadymov/telegram-react
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
evgeny-nadymov
committed
Apr 9, 2021
1 parent
b7d1c74
commit fae054a
Showing
5 changed files
with
168 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/* | ||
* Copyright (c) 2018-present, Evgeny Nadymov | ||
* | ||
* This source code is licensed under the GPL v.3.0 license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* | ||
* Copyright (c) 2018-present, Evgeny Nadymov | ||
* | ||
* This source code is licensed under the GPL v.3.0 license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import './CallSettingsVideoPreview.css'; | ||
|
||
class CallSettingsVideoPreview extends React.Component { | ||
|
||
componentDidMount() { | ||
const { stream } = this.props; | ||
if (stream) { | ||
const video = document.getElementById('call-settings-video'); | ||
if (video) { | ||
video.srcObject = stream; | ||
} | ||
} | ||
} | ||
|
||
componentDidUpdate(prevProps, prevState, snapshot) { | ||
const { stream } = this.props; | ||
if (prevProps.stream !== stream) { | ||
const video = document.getElementById('call-settings-video'); | ||
if (video) { | ||
video.srcObject = stream; | ||
} | ||
} | ||
} | ||
|
||
componentWillUnmount() { | ||
} | ||
|
||
render() { | ||
|
||
return ( | ||
<div> | ||
<video id='call-settings-video' autoPlay={true} muted={true}/> | ||
</div> | ||
); | ||
} | ||
|
||
} | ||
|
||
CallSettingsVideoPreview.propTypes = { | ||
stream: PropTypes.object | ||
}; | ||
|
||
export default CallSettingsVideoPreview; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters