@startuml
!include skin.inc

autonumber "#'.'"

participant "<i>Browser</i>" as bro #ffffff
participant "Application" as app 
participant "Server" as srv 

note over bro, srv:  Both parties are in a call already.

note right of app: User requests addition / \nremoval of video

app -->> bro: <i>Update PeerConnection, e.g. adding or removing video stream</i>
app -->> bro: <i>offerSdp=peerConnection.CreateOffer()</i>
app -->> bro: <i>peerConnection.SetLocalDescription(offer, offerSdp)</i>

app -> srv: POST VvoipOffer(sessionId, offerSdp)
srv --> app: Response 
note right of srv: pass on the offer
note right of srv: receive answer

alt Alternative 2: Terminating participant declines update
	srv -> app: POST or NOTIFY VvoipEventNotification(Declined)
	note over bro, app #ff0000: Ed. Note: application indicates roll back to the browser. Still under discussion in W3C how. \nSolve in CONR.

	note over bro, srv: Call goes ahead without modification.
else Alternative 1: Terminating participant accepts update
	srv -> app: POST or NOTIFY VvoipAcceptanceNotification(answer, answerSdp)
	app -->> bro: <i>peerConnection.setRemoteDescription(answer, answerSdp)</i>

	bro -->> app: <i>oniceconnectionstatechange(new)</i>
	app -> srv: PUT VvoipIceStatus(New)
	srv --> app: Response
	note over bro, srv: Running ICE connectivity checks (if applicable).

	bro -->> app: <i>oniceconnectionstatechange(connected)</i>
	app -> srv: PUT VvoipIceStatus(Connected)
	srv --> app: Response

	note over bro, srv: Call goes ahead with modified media streams.
end
@enduml