melihercan / WebRTCme

A cross-platform framework for adding WebRTC support to .NET MAUI, Blazor, and Desktop applications by using a single unified .NET/C# API.
https://github.com/melihercan/WebRTCme
MIT License
230 stars 46 forks source link

WebRTC Video Call in Xamarin with Any Signaling Server #16

Closed mail2mhossain closed 8 months ago

mail2mhossain commented 2 years ago

I am trying to user only WebRTC part in my Xamarin project but failed to figure out how to initialize. I have attached a sequence diagram. In this way I am trying. Would you please help me to use your webRTC Api in this way.

WebRTC_Video_Call

Plant UML Code: @startuml WebRTC title WebRTC Video Call Sequence

Bob -> SignalingServer: Register
Alice -> SignalingServer: Register
group Call
    Bob -> Bob: InitPeerConnection()
    group InitPeerConnection
        Bob -> Bob: CreatePeerConnection()
        Bob -> Bob: ReceiveVideoTrack()
    end
    Bob -> Bob: CreateVideoCaptureDevice()
    Bob -> Bob: CreateAudioCaptureDevice()
    Bob -> Bob: AddVideoTransceiver()
    Bob -> Bob: AddAudioTransceiver()
    Bob -> Bob: CreateOffer()
    Bob -> Bob: SetLocalDescription()
    Bob -> SignalingServer: SendOfferSdp
    SignalingServer -> Alice: SendOfferSdp
    Alice -> Alice: InitPeerConnection()
    group InitPeerConnection
        Alice -> Alice: CreatePeerConnection()
        Alice -> Alice: ReceiveVideoTrack()
    end
    Alice -> Alice: CreateVideoCaptureDevice()
    Alice -> Alice: CreateAudioCaptureDevice()
    Alice -> Alice: AddVideoTransceiver()
    Alice -> Alice: AddAudioTransceiver()
    Alice -> Alice: SetRemoteDescription()
    Alice -> Alice: CreateAnswer()
    Alice -> SignalingServer: SendAnswerSdp
    SignalingServer -> Bob: SendAnswerSdp
    Bob -> Bob: SetRemoteDescription()

    Bob -> SignalingServer: SendIceCandidate()
    SignalingServer -> Alice: SendIceCandidate()
    Alice -> Alice: AddIceCandidate()

    Alice -> SignalingServer: SendIceCandidate()
    SignalingServer -> Bob: SendIceCandidate()
    Bob -> Bob: AddIceCandidate()
    Bob <-> Alice: P2PConnection
end

@enduml

melihercan commented 2 years ago

Hi, sorry currently I have no time to spend on this request. Please check the Demo application which runs on Blazor, Android and iOS platforms. I hope you can find the answers there.

melihercan commented 8 months ago

You can create your own connection library using the current ones as a template.

melihercan commented 8 months ago

And middleware as well...