mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-12-07 00:09:14 +08:00
add viewer.local config property when viewing local instance (#1358)
If running local server instance, avoid using relays to communicate with the viewer.
This commit is contained in:
1 parent
2ffe4f9036
commit
bf64769128
2 files changed
+25
-20
No files matched your search
@@ -153,3 +153,5 @@ class ViewerConfig(PrintableConfig):
|
|||||||
connecting to the viewer"""
|
connecting to the viewer"""
|
||||||
codec: Literal["H264", "VP8"] = "VP8"
|
codec: Literal["H264", "VP8"] = "VP8"
|
||||||
"""Video codec that viewer will use."""
|
"""Video codec that viewer will use."""
|
||||||
|
local: bool = False
|
||||||
|
"""If running local server instance, avoid using relays to communicate with the viewer."""
|
||||||
@@ -669,28 +669,31 @@ class ViewerState:
|
|||||||
# returns the description to for WebRTC to the specific websocket connection
|
# returns the description to for WebRTC to the specific websocket connection
|
||||||
offer = RTCSessionDescription(data["sdp"], data["type"])
|
offer = RTCSessionDescription(data["sdp"], data["type"])
|
||||||
|
|
||||||
if self.config.skip_openrelay:
|
if self.config.local:
|
||||||
ice_servers = [
|
pc = RTCPeerConnection()
|
||||||
RTCIceServer(urls="stun:stun.l.google.com:19302"),
|
|
||||||
]
|
|
||||||
else:
|
else:
|
||||||
ice_servers = [
|
if self.config.skip_openrelay:
|
||||||
RTCIceServer(urls="stun:stun.l.google.com:19302"),
|
ice_servers = [
|
||||||
RTCIceServer(urls="stun:openrelay.metered.ca:80"),
|
RTCIceServer(urls="stun:stun.l.google.com:19302"),
|
||||||
RTCIceServer(
|
]
|
||||||
urls="turn:openrelay.metered.ca:80", username="openrelayproject", credential="openrelayproject"
|
else:
|
||||||
),
|
ice_servers = [
|
||||||
RTCIceServer(
|
RTCIceServer(urls="stun:stun.l.google.com:19302"),
|
||||||
urls="turn:openrelay.metered.ca:443", username="openrelayproject", credential="openrelayproject"
|
RTCIceServer(urls="stun:openrelay.metered.ca:80"),
|
||||||
),
|
RTCIceServer(
|
||||||
RTCIceServer(
|
urls="turn:openrelay.metered.ca:80", username="openrelayproject", credential="openrelayproject"
|
||||||
urls="turn:openrelay.metered.ca:443?transport=tcp",
|
),
|
||||||
username="openrelayproject",
|
RTCIceServer(
|
||||||
credential="openrelayproject",
|
urls="turn:openrelay.metered.ca:443", username="openrelayproject", credential="openrelayproject"
|
||||||
),
|
),
|
||||||
]
|
RTCIceServer(
|
||||||
|
urls="turn:openrelay.metered.ca:443?transport=tcp",
|
||||||
|
username="openrelayproject",
|
||||||
|
credential="openrelayproject",
|
||||||
|
),
|
||||||
|
]
|
||||||
|
|
||||||
pc = RTCPeerConnection(configuration=RTCConfiguration(iceServers=ice_servers))
|
pc = RTCPeerConnection(configuration=RTCConfiguration(iceServers=ice_servers))
|
||||||
self.pcs.add(pc)
|
self.pcs.add(pc)
|
||||||
|
|
||||||
video = SingleFrameStreamTrack()
|
video = SingleFrameStreamTrack()
|
||||||
|
|||||||
Reference in new issue
Block a user