2021-06-12 09:09:16 +03:00
|
|
|
/*
|
|
|
|
Copyright 2021 Šimon Brandner <simon.bra.ag@gmail.com>
|
|
|
|
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
you may not use this file except in compliance with the License.
|
|
|
|
You may obtain a copy of the License at
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
limitations under the License.
|
|
|
|
*/
|
|
|
|
|
|
|
|
import React from "react";
|
2021-06-12 13:30:56 +03:00
|
|
|
import { MatrixCall } from "matrix-js-sdk/src/webrtc/call";
|
|
|
|
import { CallFeed } from "matrix-js-sdk/src/webrtc/callFeed";
|
2021-06-12 09:09:16 +03:00
|
|
|
import VideoFeed from "./VideoFeed";
|
2021-07-21 18:45:21 +03:00
|
|
|
import classNames from "classnames";
|
2021-06-12 09:09:16 +03:00
|
|
|
|
|
|
|
interface IProps {
|
|
|
|
feeds: Array<CallFeed>;
|
|
|
|
call: MatrixCall;
|
2021-07-21 17:34:21 +03:00
|
|
|
hideLocalFeeds: boolean;
|
2021-07-21 18:45:21 +03:00
|
|
|
pipMode: boolean;
|
2021-06-12 09:09:16 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
export default class CallViewSidebar extends React.Component<IProps> {
|
|
|
|
render() {
|
2021-07-21 17:21:52 +03:00
|
|
|
const feeds = this.props.feeds.map((feed) => {
|
2021-07-21 18:12:27 +03:00
|
|
|
if (feed.isLocal() && this.props.hideLocalFeeds) return;
|
2021-06-12 15:01:09 +03:00
|
|
|
|
2021-06-12 09:09:16 +03:00
|
|
|
return (
|
|
|
|
<VideoFeed
|
|
|
|
key={feed.stream.id}
|
|
|
|
feed={feed}
|
|
|
|
call={this.props.call}
|
|
|
|
primary={false}
|
|
|
|
/>
|
|
|
|
);
|
|
|
|
});
|
|
|
|
|
2021-07-21 18:45:21 +03:00
|
|
|
const className = classNames("mx_CallViewSidebar", {
|
|
|
|
mx_CallViewSidebar_pipMode: this.props.pipMode,
|
|
|
|
});
|
|
|
|
|
2021-06-12 09:09:16 +03:00
|
|
|
return (
|
2021-07-21 18:45:21 +03:00
|
|
|
<div className={className}>
|
2021-06-12 09:09:16 +03:00
|
|
|
{ feeds }
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|