WebRTC Configuration
LB Phone uses WebRTC to transmit video and audio between players. This is used in video calls, InstaPic live, and for recording nearby players voices.
You can modify the Config.RTCConfig
table in lb-phone/config/config.lua
to change the WebRTC settings. You can read more about the settings at Mozilla's documentation (opens in a new tab).
TURN Server
To fix issues with video calls and InstaPic live not working, you need to set up a TURN server.
Cloudflare
The phone comes with built-in support for Cloudflare's Realtime TURN server.
-
Open
lb-phone/config/config.lua
-
Set
Config.DynamicWebRTC.Enabled = true
-
Set
Config.DynamicWebRTC.Service = "cloudflare"
-
Create a Cloudflare account
-
Press "Create"
-
Optionally, set a name for the TURN server
-
Press "Create"
-
Save the
Turn Token ID
andAPI Token
values in a secure location. You will need these in the next step, so you can keep the page open. -
Open
lb-phone/server/apiKeys.lua
. In theWEBRTC
table, setTokenID
to yourTurn Token ID
andAPIToken
to yourAPI Token
. Make sure to add quotes around the values, like this:lb-phone/server/apiKeys.luaWEBRTC = { TokenID = "6tixd89deru5dn3in1la93am7yhhbq3g", APIToken = "becst6d09fk3q6wumib9jf4zou6ppcn9mecr7a1ne2povhu4tedwyuu49q8bqn6y", }
-
Press "Finish" in the Cloudflare dashboard
-
Restart LB Phone or your server
Metered
You can also use a service like metered (opens in a new tab). To do this, create an account and get your TURN server credentials. Then, press "Show ICE Servers Array" and copy from the content of the iceServers
array, like this:
{
urls: "stun:stun.relay.metered.ca:80",
},
{
urls: "turn:global.relay.metered.ca:80",
username: "",
credential: "",
},
{
urls: "turn:global.relay.metered.ca:80?transport=tcp",
username: "",
credential: "",
},
{
urls: "turn:global.relay.metered.ca:443",
username: "",
credential: "",
},
{
urls: "turns:global.relay.metered.ca:443?transport=tcp",
username: "",
credential: "",
},
Finally, open lb-phone/config/config.lua
and set your iceServers
in the Config.RTCConfig
table.
Config.RTCConfig = {
iceServers = {
{
urls: "stun:stun.relay.metered.ca:80",
},
{
urls: "turn:global.relay.metered.ca:80",
username: "",
credential: "",
},
{
urls: "turn:global.relay.metered.ca:80?transport=tcp",
username: "",
credential: "",
},
{
urls: "turn:global.relay.metered.ca:443",
username: "",
credential: "",
},
{
urls: "turns:global.relay.metered.ca:443?transport=tcp",
username: "",
credential: "",
},
}
}