Skip to content

Commit 78cb11b

Browse files
authored
Merge pull request #708 from OpenVisualCloud/master
Fix #705
2 parents 600ddc8 + 933c922 commit 78cb11b

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

sensor/webrtc/owtapi.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,11 @@ def list_participants(self,room):
7171
r=self._request(requests.get,uri,headers=self._headers())
7272
return len(r.json())
7373

74-
def start_streaming_ins(self,room,rtsp_url):
74+
def start_streaming_ins(self,room,rtsp_url,protocol="tcp"):
7575
options={
7676
"connection": {
7777
"url":str(rtsp_url),
78-
"transportProtocol": "udp",
78+
"transportProtocol": protocol,
7979
"bufferSize":212992,
8080
},
8181
"media": {

sensor/webrtc/sensors.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,15 @@ def _create_room(self, sensor):
4242
if not r: return (404, "Sensor Not Found")
4343

4444
location=r[0]["_source"]["location"]
45+
protocol= "udp" if 'simsn' in r[0]['_source'].keys() else "tcp"
4546
name="{},{} - {}".format(location["lat"],location["lon"], sensor)
4647
room,stream=watcher.get(name)
4748
if room and stream:
4849
return self._room_details(sensor, name, room, stream)
4950

5051
room=self._owt.create_room(name=name, p_limit=streaming_limit)
5152
rtsp_url=r[0]["_source"]["url"]
52-
stream=self._owt.start_streaming_ins(room=room,rtsp_url=rtsp_url) if room else None
53+
stream=self._owt.start_streaming_ins(room=room,rtsp_url=rtsp_url,protocol=protocol) if room else None
5354
if not stream: return (503, "Exception when post")
5455

5556
watcher.set(name, room, stream)

0 commit comments

Comments
 (0)