38 lines
1.8 KiB
TypeScript
38 lines
1.8 KiB
TypeScript
// Metro module 10816 (f10817).
|
|
import { useEffect } from "react";
|
|
import ApplicationStreamingStore from "../../../../stores/ApplicationStreamingStore";
|
|
import AuthenticationStore from "../../../../stores/AuthenticationStore";
|
|
import { AnalyticEvents } from "../../../../Constants";
|
|
import { ParticipantTypes } from "../../../calls/CallConstants";
|
|
import AnalyticsUtils from "../../../../utils/AnalyticsUtils";
|
|
import { collectVoiceAnalyticsMetadata } from "../../../app_analytics/AppAnalyticsUtils";
|
|
import { useStateFromStores } from "../../../../_bundle/Module589";
|
|
import SingleScreenshare from "./SingleScreenshare";
|
|
import SingleStream from "./SingleStream";
|
|
import SingleVideoCall from "./SingleVideoCall";
|
|
export function ChannelCallSingleController(props) {
|
|
const { selectedParticipant, channel } = props;
|
|
useEffect(() => {
|
|
AnalyticsUtils.track(AnalyticEvents.VIDEO_LAYOUT_TOGGLED, {
|
|
video_layout: "focus",
|
|
...collectVoiceAnalyticsMetadata(channel.id)
|
|
});
|
|
}, [channel.id]);
|
|
const stateFromStores = useStateFromStores([ApplicationStreamingStore], () => ApplicationStreamingStore.getActiveStreamForStreamKey(selectedParticipant.id));
|
|
const type = selectedParticipant.type;
|
|
if (ParticipantTypes.STREAM === type) {
|
|
const id = selectedParticipant.user.id;
|
|
const id2 = AuthenticationStore.getId();
|
|
return stateFromStores != null ? id === id2 ? <SingleScreenshare participant={selectedParticipant} channel={channel} /> : <SingleStream participant={selectedParticipant} channel={channel} /> : null;
|
|
}
|
|
if (ParticipantTypes.USER === type) {
|
|
return <SingleVideoCall participant={selectedParticipant} channel={channel} />;
|
|
}
|
|
if (ParticipantTypes.HIDDEN_STREAM === type) {
|
|
return null;
|
|
}
|
|
if (ParticipantTypes.ACTIVITY === type) {
|
|
throw new Error("Activities are not supported on old voice UI");
|
|
}
|
|
}
|