/* Copyright 2023 New Vector Ltd 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 { MatrixClient } from "matrix-js-sdk/src/client"; import { GroupCall } from "matrix-js-sdk/src/webrtc/groupCall"; import { CallFeed } from "matrix-js-sdk/src/webrtc/callFeed"; import React from "react"; import { t } from "i18next"; import styles from "./MediaInspector.module.css"; interface MediaViewerProps { client: MatrixClient; groupCall: GroupCall; userMediaFeeds: CallFeed[]; screenshareFeeds: CallFeed[]; } export function MediaViewer({ client, groupCall, userMediaFeeds, screenshareFeeds, }: MediaViewerProps) { return (
); } // View Items ########################################################################################################## interface TableProp { name: string; feeds: CallFeed[]; } function Table({ name, feeds }: TableProp): JSX.Element { // Catch case if feeds is empty if (feeds.length === 0) { const noFeed = t("No Feeds…"); return (

{name}

{noFeed}

); } // Render Table return (

{name}

Feed
User
StreamID
Tracks
{feeds.map((feed, i) => { const user = feed.isLocal ? "local" : feed.getMember() !== null ? feed.getMember()?.name : feed.userId; return ( ); })}
); } interface TableRowProp { index: number; user: string; stream: MediaStream | undefined; } function TableRow({ index, user, stream }: TableRowProp): JSX.Element { return (
{index}
{user}
{stream?.id}
{stream?.getTracks().map( (track): JSX.Element => ( ) )}
); } interface TrackColumnProp { kind: string; trackId: string; } function TrackColumn({ kind, trackId }: TrackColumnProp): JSX.Element { return (
{kind}  
{trackId}
); }