mirror of
https://github.com/element-hq/element-web
synced 2024-11-28 04:21:57 +03:00
Properly handle media
This might have resulted in the wrong speaker being used or worse Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
parent
8ba95f5f01
commit
56b15edc58
1 changed files with 6 additions and 4 deletions
|
@ -63,6 +63,10 @@ export default class VideoFeed extends React.Component<IProps, IState> {
|
|||
componentDidMount() {
|
||||
this.props.feed.addListener(CallFeedEvent.NewStream, this.onNewStream);
|
||||
|
||||
this.playMedia();
|
||||
}
|
||||
|
||||
playMedia() {
|
||||
const audioOutput = CallMediaHandler.getAudioOutput();
|
||||
const currentMedia = this.getCurrentMedia();
|
||||
|
||||
|
@ -117,14 +121,12 @@ export default class VideoFeed extends React.Component<IProps, IState> {
|
|||
return this.audio.current || this.video.current;
|
||||
}
|
||||
|
||||
onNewStream = (newStream: MediaStream) => {
|
||||
onNewStream = () => {
|
||||
this.setState({
|
||||
audioMuted: this.props.feed.isAudioMuted(),
|
||||
videoMuted: this.props.feed.isVideoMuted(),
|
||||
});
|
||||
const currentMedia = this.getCurrentMedia();
|
||||
currentMedia.srcObject = newStream;
|
||||
currentMedia.play();
|
||||
this.playMedia();
|
||||
}
|
||||
|
||||
onResize = (e) => {
|
||||
|
|
Loading…
Reference in a new issue