remove focus state if camera is unshared

This commit is contained in:
Ramon Souza 2021-08-19 14:31:02 -03:00
parent 9fd28639e5
commit 5ed9639601

View File

@ -118,6 +118,7 @@ class VideoList extends Component {
}
componentDidUpdate(prevProps) {
const { focusedId } = this.state;
const { layoutType, cameraDock, streams } = this.props;
const { width: cameraDockWidth, height: cameraDockHeight } = cameraDock;
const {
@ -127,6 +128,11 @@ class VideoList extends Component {
} = prevProps;
const { width: prevCameraDockWidth, height: prevCameraDockHeight } = prevCameraDock;
const focusedStream = streams.filter((item) => item.stream === focusedId);
if (focusedId && focusedStream.length === 0) {
this.handleVideoFocus(focusedId);
}
if (layoutType !== prevLayoutType
|| cameraDockWidth !== prevCameraDockWidth
|| cameraDockHeight !== prevCameraDockHeight