diff --git a/src/components/views/voip/VideoFeed.tsx b/src/components/views/voip/VideoFeed.tsx index 663c2e4613..43696defb9 100644 --- a/src/components/views/voip/VideoFeed.tsx +++ b/src/components/views/voip/VideoFeed.tsx @@ -63,6 +63,10 @@ export default class VideoFeed extends React.Component { 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 { 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) => {