master
Mustafa Yontar 5 years ago
parent cebcb79759
commit eaa8cba368
  1. 11
      app.py
  2. 3
      forward_stream.py

@ -111,7 +111,18 @@ def get_file():
files.append(i.name) files.append(i.name)
return jsonify(files) return jsonify(files)
@app.route('/api/recreate/room', methods=['GET'])
def create_room():
rms = Room.objects.all()
for i in rms:
jan = Janus(os.environ.get('JANUS_URL'), app.config['JANUS_ADMIN_KEY'])
jan.connect()
room_id = jan.create_room(name=i.room_name, video_codec="vp8", audio_codec="opus",
publisher_count=int(16), bitrate=128*1000, data=False)
i.room_id = room_id
i.save()
return "ok"
@app.route('/api/create/room', methods=['POST']) @app.route('/api/create/room', methods=['POST'])
@jwt_required @jwt_required

@ -121,6 +121,8 @@ async def subscribe(session, room, feed):
) )
# apply offer # apply offer
print(response["jsep"]["sdp"])
print(response["jsep"]["type"])
await pc.setRemoteDescription( await pc.setRemoteDescription(
RTCSessionDescription( RTCSessionDescription(
sdp=response["jsep"]["sdp"], type=response["jsep"]["type"] sdp=response["jsep"]["sdp"], type=response["jsep"]["type"]
@ -139,6 +141,7 @@ async def subscribe(session, room, feed):
}, },
} }
) )
print(pc.localDescription.sdp)
print("recorder start") print("recorder start")
await recorder.start() await recorder.start()

Loading…
Cancel
Save