fix(ui) - compile errors after merge

This commit is contained in:
Shekar Siri 2021-12-04 02:58:55 +05:30
parent f7f70589c3
commit 7184119e5f
4 changed files with 10 additions and 18 deletions

View file

@ -13,7 +13,6 @@ interface Props {
}
function ChatControls({ stream, endCall, videoEnabled, setVideoEnabled } : Props) {
const [audioEnabled, setAudioEnabled] = useState(true)
const [videoEnabled, setVideoEnabled] = useState(false)
const toggleAudio = () => {
if (!stream) { return; }

View file

@ -10,21 +10,21 @@ import type { LocalStream } from 'Player/MessageDistributor/managers/LocalStream
export interface Props {
remoteStream: MediaStream | null,
incomeStream: MediaStream | null,
localStream: LocalStream | null,
userId: String,
endCall: () => void
}
const ChatWindow: FC<Props> = function ChatWindow({ userId, remoteStream, localStream, endCall }) {
const ChatWindow: FC<Props> = function ChatWindow({ userId, incomeStream, localStream, endCall }) {
const [localVideoEnabled, setLocalVideoEnabled] = useState(false)
const [remoteVideoEnabled, setRemoteVideoEnabled] = useState(false)
useEffect(() => {
if (!remoteStream) { return }
if (!incomeStream) { return }
const iid = setInterval(() => {
const settings = remoteStream.getVideoTracks()[0]?.getSettings()
const settings = incomeStream.getVideoTracks()[0]?.getSettings()
const isDummyVideoTrack = !!settings ? (settings.width === 2 || settings.frameRate === 0) : true
console.log(isDummyVideoTrack, settings)
const shouldBeEnabled = !isDummyVideoTrack
@ -33,7 +33,7 @@ const ChatWindow: FC<Props> = function ChatWindow({ userId, remoteStream, localS
}
}, 1000)
return () => clearInterval(iid)
}, [ remoteStream, localVideoEnabled ])
}, [ incomeStream, localVideoEnabled ])
const minimize = !localVideoEnabled && !remoteVideoEnabled
@ -48,7 +48,7 @@ const ChatWindow: FC<Props> = function ChatWindow({ userId, remoteStream, localS
<Counter startTime={new Date().getTime() } className="text-sm ml-auto" />
</div>
<div className={cn(stl.videoWrapper, {'hidden' : minimize}, 'relative')}>
<VideoContainer stream={ remoteStream } />
<VideoContainer stream={ incomeStream } />
<div className="absolute bottom-0 right-0 z-50">
<VideoContainer stream={ localStream ? localStream.stream : null } muted width={50} />
</div>

View file

@ -38,7 +38,7 @@ interface Props {
}
function AssistActions({ toggleChatWindow, userId, calling, peerConnectionStatus, remoteControlEnabled, hasPermission, isEnterprise }: Props) {
const [ remoteStream, setRemoteStream ] = useState<MediaStream | null>(null);
const [ incomeStream, setIncomeStream ] = useState<MediaStream | null>(null);
const [ localStream, setLocalStream ] = useState<LocalStream | null>(null);
const [ callObject, setCallObject ] = useState<{ end: ()=>void, toggleRemoteControl: ()=>void } | null >(null);
@ -63,6 +63,7 @@ function AssistActions({ toggleChatWindow, userId, calling, peerConnectionStatus
onError
));
}).catch(onError)
}
const confirmCall = async () => {
if (await confirm({
@ -124,7 +125,7 @@ function AssistActions({ toggleChatWindow, userId, calling, peerConnectionStatus
</div>
}
<div className="fixed ml-3 left-0 top-0" style={{ zIndex: 999 }}>
{ inCall && callObject && <ChatWindow endCall={callObject.end} userId={userId} remoteStream={remoteStream} localStream={localStream} /> }
{ inCall && callObject && <ChatWindow endCall={callObject.end} userId={userId} incomeStream={incomeStream} localStream={localStream} /> }
</div>
</div>
)

View file

@ -118,7 +118,7 @@ function resolveCSS(baseURL: string, css: string): string {
}
export default class AssistManager {
constructor(private session, private config, private md: MessageDistributor, private config) {}
constructor(private session, private md: MessageDistributor, private config) {}
private setStatus(status: ConnectionStatus) {
if (status === ConnectionStatus.Connecting) {
@ -403,14 +403,6 @@ export default class AssistManager {
}
}
private onMouseClick = (e: MouseEvent): void => {
const conn = this.dataConnection;
if (!conn) { return; }
const data = this.md.getInternalCoordinates(e);
// const el = this.md.getElementFromPoint(e); // requires requestiong node_id from domManager
conn.send({ type: "click", x: Math.round(data.x), y: Math.round(data.y) });
}
private localCallData: {
localStream: LocalStream,
onStream: (s: MediaStream)=>void,