Dominevo
ReferenceHTTP API

webrtcSession

The webrtcSession router: 11 methods of the webrtc-session capability, with tier, scope, input and output.

Capability webrtc-session · scope device · mode singleton · source packages/types/src/capabilities/webrtc-session.cap.ts:284.

Every method is called at /trpc/webrtcSession.<method> — queries with GET, mutations with POST. See How to call and Authorization. Device methods take deviceId in their input.

MethodKindTierToken scopeViewer
listStreamsqueryprotectedviewyes
createSessionmutationprotectedcreateyes
handleOffermutationprotectedcreateyes
handleAnswermutationprotectedcreateyes
addIceCandidatemutationprotectedcreateyes
getIceCandidatesqueryprotectedviewyes
closeSessionmutationprotectedcreateyes
hasAdaptiveBitratequeryprotectedviewyes
getSessionStatequeryprotectedviewyes
applyDownlinkProbemutationprotectedcreateyes
getSessionDebugqueryprotectedviewyes

webrtcSession.listStreams

  • Kind: query — GET /trpc/webrtcSession.listStreams
  • Tier: protected — any signed-in principal whose scopes cover the method
  • Token scope: view on capability webrtc-session, or category device, or a device grant covering deviceId
  • Viewer: yes
  • Try it: open /system/api-explorer?method=webrtcSession.listStreams on your hub

Input

{ deviceId: number }

Output

WebrtcStreamChoiceSchema[]

Shapes: WebrtcStreamChoiceSchema

webrtcSession.createSession

  • Kind: mutation — POST /trpc/webrtcSession.createSession
  • Tier: protected — any signed-in principal whose scopes cover the method
  • Token scope: create on capability webrtc-session, or category device, or a device grant covering deviceId
  • Viewer: yes
  • Try it: open /system/api-explorer?method=webrtcSession.createSession on your hub

Input

{ deviceId: number; target: WebrtcStreamTargetSchema; hints?: webrtcClientHintsSchema; relayOnly?: boolean; consumerAttribution?: { kind: BrokerConsumerKindSchema; label?: string; media?: "audio" | "video" | "both"; targetCodec?: string; transport?: "passthrough" | "repacketize" | "transcode"; remoteAddr?: string; userAgent?: string; userId?: string; sessionId?: string; extra?: Record<string, string> } }

Output

{ sessionId: string; sdpOffer: string }

Shapes: WebrtcStreamTargetSchema · BrokerConsumerKindSchema

webrtcSession.handleOffer

  • Kind: mutation — POST /trpc/webrtcSession.handleOffer
  • Tier: protected — any signed-in principal whose scopes cover the method
  • Token scope: create on capability webrtc-session, or category device, or a device grant covering deviceId
  • Viewer: yes
  • Try it: open /system/api-explorer?method=webrtcSession.handleOffer on your hub

Input

{ deviceId: number; target?: WebrtcStreamTargetSchema; sdpOffer: string; sessionId?: string; relayOnly?: boolean; nonTrickle?: boolean; disableTurn?: boolean; disableIpv6?: boolean; consumerAttribution?: { kind: BrokerConsumerKindSchema; label?: string; media?: "audio" | "video" | "both"; targetCodec?: string; transport?: "passthrough" | "repacketize" | "transcode"; remoteAddr?: string; userAgent?: string; userId?: string; sessionId?: string; extra?: Record<string, string> }; hints?: webrtcClientHintsSchema; talkback?: boolean }

Output

{ sessionId: string; sdpAnswer: string }

Shapes: WebrtcStreamTargetSchema · BrokerConsumerKindSchema

webrtcSession.handleAnswer

  • Kind: mutation — POST /trpc/webrtcSession.handleAnswer
  • Tier: protected — any signed-in principal whose scopes cover the method
  • Token scope: create on capability webrtc-session, or category device, or a device grant covering deviceId
  • Viewer: yes
  • Try it: open /system/api-explorer?method=webrtcSession.handleAnswer on your hub

Input

{ deviceId: number; sessionId: string; sdpAnswer: string }

Output

void

webrtcSession.addIceCandidate

  • Kind: mutation — POST /trpc/webrtcSession.addIceCandidate
  • Tier: protected — any signed-in principal whose scopes cover the method
  • Token scope: create on capability webrtc-session, or category device, or a device grant covering deviceId
  • Viewer: yes
  • Try it: open /system/api-explorer?method=webrtcSession.addIceCandidate on your hub

Input

{ deviceId: number; sessionId: string; candidate: string; sdpMid?: string | null; sdpMLineIndex?: number | null }

Output

void

webrtcSession.getIceCandidates

  • Kind: query — GET /trpc/webrtcSession.getIceCandidates
  • Tier: protected — any signed-in principal whose scopes cover the method
  • Token scope: view on capability webrtc-session, or category device, or a device grant covering deviceId
  • Viewer: yes
  • Try it: open /system/api-explorer?method=webrtcSession.getIceCandidates on your hub

Input

{ deviceId: number; sessionId: string }

Output

{ candidates: ({ candidate: string; sdpMid: string | null; sdpMLineIndex: number | null })[]; done: boolean }

webrtcSession.closeSession

  • Kind: mutation — POST /trpc/webrtcSession.closeSession
  • Tier: protected — any signed-in principal whose scopes cover the method
  • Token scope: create on capability webrtc-session, or category device, or a device grant covering deviceId
  • Viewer: yes
  • Try it: open /system/api-explorer?method=webrtcSession.closeSession on your hub

Input

{ deviceId: number; sessionId: string }

Output

void

webrtcSession.hasAdaptiveBitrate

  • Kind: query — GET /trpc/webrtcSession.hasAdaptiveBitrate
  • Tier: protected — any signed-in principal whose scopes cover the method
  • Token scope: view on capability webrtc-session, or category device, or a device grant covering deviceId
  • Viewer: yes
  • Try it: open /system/api-explorer?method=webrtcSession.hasAdaptiveBitrate on your hub

Input

{ deviceId: number; profile: CamProfileSchema }

Output

boolean

Shapes: CamProfileSchema

webrtcSession.getSessionState

  • Kind: query — GET /trpc/webrtcSession.getSessionState
  • Tier: protected — any signed-in principal whose scopes cover the method
  • Token scope: view on capability webrtc-session, or category device, or a device grant covering deviceId
  • Viewer: yes
  • Try it: open /system/api-explorer?method=webrtcSession.getSessionState on your hub

Input

{ deviceId: number; sessionId: string }

Output

{ pendingRenegotiation: { target: WebrtcStreamTargetSchema; epoch: number } | null; alive: boolean }

Shapes: WebrtcStreamTargetSchema

webrtcSession.applyDownlinkProbe

  • Kind: mutation — POST /trpc/webrtcSession.applyDownlinkProbe
  • Tier: protected — any signed-in principal whose scopes cover the method
  • Token scope: create on capability webrtc-session, or category device, or a device grant covering deviceId
  • Viewer: yes
  • Try it: open /system/api-explorer?method=webrtcSession.applyDownlinkProbe on your hub

Input

{ deviceId: number; sessionId: string; downlinkMbps: number }

Output

{ outcome: "switching" | "held"; tier: CamProfileSchema | null; reason: string }

Shapes: CamProfileSchema

webrtcSession.getSessionDebug

  • Kind: query — GET /trpc/webrtcSession.getSessionDebug
  • Tier: protected — any signed-in principal whose scopes cover the method
  • Token scope: view on capability webrtc-session, or category device, or a device grant covering deviceId
  • Viewer: yes
  • Try it: open /system/api-explorer?method=webrtcSession.getSessionDebug on your hub

Input

{ deviceId: number; sessionId: string }

Output

WebrtcSessionDebugSchema

Shapes: WebrtcSessionDebugSchema