Suyious / purrr.frontend

Frontend for Purrr - Chat Application that connects randomly among online users
https://purrr.chat
1 stars 2 forks source link

Implementation for WebRTC based Video Calling #47

Open HarshNarayanJha opened 3 weeks ago

HarshNarayanJha commented 3 weeks ago

This PR implements simple WebRTC based Video Calls. When in a chat, click the attachment button at the top (limited UI design right now), this sends a call request on the other side, showing an incoming call banner with accept and decline buttons. Declining just dismisses the banner (no events sent over, probably a good idea to add one)

Accepting starts sending a series of events to exchange offers, answers, and setups local cameras on both sides. All that event handling is added to the src/hooks/useWebRTC.tsx hook. Reconnections and Hangups are still left to be implemented.

Newly added client events are:

REQUEST_VIDEO_CALL = 'request_video_call',
DECLINE_INCOMING_CALL = 'decline_incoming_call',
END_VIDEO_CALL = 'end_video_call',
SEND_OFFER = 'send_offer',
SEND_ANSWER = 'send_answer',
SEND_CANDIDATE = 'send_candidate',

The VideoChat component is also pretty limited UI.

Related Backend PR: https://github.com/Suyious/purrr.backend/pull/14

Closes #12

netlify[bot] commented 3 weeks ago

Deploy request for purrrchat pending review.

Visit the deploys page to approve it

Name Link
Latest commit 512283eeb8242c69459394bc43d60f84fd5e5b8a
vercel[bot] commented 3 weeks ago

@HarshNarayanJha is attempting to deploy a commit to the suyious' projects Team on Vercel.

A member of the Team first needs to authorize it.