Skip to content

Commit

Permalink
fixed outgoing calls - added fake webcam
Browse files Browse the repository at this point in the history
  • Loading branch information
dudash committed Feb 9, 2022
1 parent ff85f9a commit 685a1f8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .clivrt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[DEFAULT]
signalinghosturl = wss://signaling-s-dudash-dev.apps.sandbox.x8i5.p1.openshiftapps.com
autoanswer = true
loglevel = WARN
loglevel = ERROR
videostyle = ascii-color
webcam = /dev/video0
webcam = FAKE
framerate = 30
video_size = 800x600
13 changes: 7 additions & 6 deletions cli/network/networkmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ async def handle_msg_chat(self, msg_data):
text = msg_data['text']
# TODO move chat off into a side panel on it's own
printf(f'<chat><b>{name}</b>: <i>{text}</i></chat>')
# TODO is user I'm chatting with left hangup call
# eg. "SERVER: User aaa left"
except Exception as e:
logging.error('bad message data - could not parse chat message')
logging.error(e)
Expand Down Expand Up @@ -178,8 +180,7 @@ async def handle_msg_video_answer(self, msg_data):
name = msg_data['name']
target = msg_data['target']
logging.debug('processing video answer message for ' + target + ' from ' + name)
msg_obj = Prodict.from_dict(json.loads(msg_data))
await self.pc.setRemoteDescription(msg_obj['sdp'])
await self.pc.setRemoteDescription(msg_data['sdp'])
await self.recorder.start()
self.session.connection_status.status = ConnectionStatusEnum.INCALL
self.session.connection_status.talking_to = name
Expand Down Expand Up @@ -218,10 +219,8 @@ async def invite_user_to_rtc(self, username: str):

async def end_rtc(self):
logging.debug('sending hangup message to signaling server but stay connected')
# TODO - this isn't quite right, wont let me reconnect - getting the error:
# >>>>> Cannot handle offer in signaling state "closed"
await self.recorder.stop()
await self.pc.close()
# await self.pc.close()
self.session.connection_status.status = ConnectionStatusEnum.NOTINCALL
self.session.connection_status.talking_to = ''
# TODO self.wsclient.send(json.dumps(msg_data)) # is there some RTC message to send?
Expand All @@ -235,7 +234,9 @@ def add_media_tracks(self):
video_size = self.config.defaults().get('video_size', '640x480')
try:
options = {'framerate': framerate, video_size: '640x480'}
if self.session.os_type == 'Darwin':
if self.session.videodevice == 'FAKE':
webcam = MediaPlayer('http://download.tsi.telecom-paristech.fr/gpac/dataset/dash/uhd/mux_sources/hevcds_720p30_2M.mp4')
elif self.session.os_type == 'Darwin':
webcam = MediaPlayer(self.session.videodevice, format='avfoundation', options=options) # default:none
elif self.session.os_type == 'Windows':
webcam = MediaPlayer(self.session.videodevice, format='dshow', options=options) # video=Integrated Camera
Expand Down

0 comments on commit 685a1f8

Please sign in to comment.