Home / Docs Center / Device API Reference / webrtcPlaybackGet SDP

webrtcPlaybackGet SDP

Device API Reference · Encoder WebRTC Playback

Project: Device API Documentation (New) | page_id: 302

Brief Description:

  • Get SDP for WebRTC playback

Request URL:
- /xsw/api/webrtc/play

Request Method:
- POST

URL Parameters:

Parameter Required Type Description
streamPath Yes string Stream name, for example channel 1 is hlsram/live0
from No string Playback source, local for LAN playback, empty by default for public network playback

Body Parameters:

Parameter Required Type Description
sdp Yes string offer sdp

Response Example

  {
        "sdp": "xxx",
        "type": "answer",
        "relay": false,
        "subs": 1,
        "relayTips": true, 
  }

Response Parameter Description

Parameter Type Description
code int Status code. 0 means success, others mean failure
msg string Failure information
sdp string answer sdp
type string Fixed string answer
relay bool Whether stream relay is supported
relayTips bool Whether to display the relay prompt
subs int Number of clients currently playing

Notes

  • When relay is true (the relay platform address must be configured on the page, and can be configured on the device by default later), server stream relay is supported when hole punching fails. The relay playback API must be called again
Didn't find what you need?Contact us,Talk to our engineers directly.

Request a Quote

Fill in the form and we will get back with a quote and proposal within 1 business day.

Click "Generate inquiry email" to open your mail client with the body pre-filled. If no mail client is configured, click "Copy" and paste it into webmail — recipient: sunshiyang@xstrive.com.