Skip to content

Commit

Permalink
webrtc: always use iceServers instead of ice_servers
Browse files Browse the repository at this point in the history
  • Loading branch information
ayufan committed Jun 13, 2023
1 parent 836d317 commit 01b0e96
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
4 changes: 4 additions & 0 deletions html/control.html
Original file line number Diff line number Diff line change
Expand Up @@ -753,6 +753,10 @@ <h1>Release</h1>
stopStream();
show(videoContainer);

const iceServers = [
[ { urls: ['stun:stun.l.google.com:19302'] } ]
];

fetch(webrtcURL, {
body: JSON.stringify({type: 'request'}),
headers: {'Content-Type': 'application/json'},
Expand Down
8 changes: 3 additions & 5 deletions html/webrtc.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,8 @@

<script>
function startWebRTC() {
// syntax: https://github.com/paullouisageneau/libdatachannel/blob/master/DOC.md#rtcwebrtc_peer_connection
const ice_servers = [
// 'stun:stun.l.google.com:19302',
//'turn://7295a68e2381585126c6a19e:zDd3R415oPPXJKQT@a.relay.metered.ca:80'
const iceServers = [
[ { urls: ['stun:stun.l.google.com:19302'] } ]
];

var pc = null;
Expand All @@ -62,7 +60,7 @@
body: JSON.stringify({
type: 'request',
res: params.res,
ice_servers: ice_servers
iceServers: iceServers
}),
headers: {
'Content-Type': 'application/json'
Expand Down
2 changes: 1 addition & 1 deletion output/webrtc/webrtc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ static std::shared_ptr<ClientTrackData> webrtc_add_video(const std::shared_ptr<r

static void webrtc_parse_ice_servers(rtc::Configuration &config, const nlohmann::json &message)
{
auto ice_servers = message.find("ice_servers");
auto ice_servers = message.find("iceServers");
if (ice_servers == message.end() || !ice_servers->is_array())
return;

Expand Down

0 comments on commit 01b0e96

Please # to comment.