Sunil Mohan Adapa 900c0d30b9
*: Drop module level app property
module.app property usage is greatly reduced because setup() and force_upgrade()
method are now part of App class instead of at the module level. Remove the
remaining minor cases of usage and drop the property altogether.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-08-15 10:36:29 -04:00

22 lines
659 B
Python

# SPDX-License-Identifier: AGPL-3.0-or-later
"""
Views for the Janus app.
"""
from django.views.generic import TemplateView
from plinth import app as app_module
class JanusRoomView(TemplateView):
"""A simple page to host Janus video room."""
template_name = 'janus_video_room.html'
def get_context_data(self, *args, **kwargs):
"""Add user's TURN server information to view context."""
app = app_module.App.get('janus')
config = app.get_component('turn-janus').get_configuration()
context = super().get_context_data(*args, **kwargs)
context['user_turn_config'] = config.to_json()
return context