You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-11 20:22:36 +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:
@@ -63,6 +63,10 @@ export default class VideoFeed extends React.Component<IProps, IState> {
|
|||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
this.props.feed.addListener(CallFeedEvent.NewStream, this.onNewStream);
|
this.props.feed.addListener(CallFeedEvent.NewStream, this.onNewStream);
|
||||||
|
|
||||||
|
this.playMedia();
|
||||||
|
}
|
||||||
|
|
||||||
|
playMedia() {
|
||||||
const audioOutput = CallMediaHandler.getAudioOutput();
|
const audioOutput = CallMediaHandler.getAudioOutput();
|
||||||
const currentMedia = this.getCurrentMedia();
|
const currentMedia = this.getCurrentMedia();
|
||||||
|
|
||||||
@@ -117,14 +121,12 @@ export default class VideoFeed extends React.Component<IProps, IState> {
|
|||||||
return this.audio.current || this.video.current;
|
return this.audio.current || this.video.current;
|
||||||
}
|
}
|
||||||
|
|
||||||
onNewStream = (newStream: MediaStream) => {
|
onNewStream = () => {
|
||||||
this.setState({
|
this.setState({
|
||||||
audioMuted: this.props.feed.isAudioMuted(),
|
audioMuted: this.props.feed.isAudioMuted(),
|
||||||
videoMuted: this.props.feed.isVideoMuted(),
|
videoMuted: this.props.feed.isVideoMuted(),
|
||||||
});
|
});
|
||||||
const currentMedia = this.getCurrentMedia();
|
this.playMedia();
|
||||||
currentMedia.srcObject = newStream;
|
|
||||||
currentMedia.play();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
onResize = (e) => {
|
onResize = (e) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user