Commit c168e75fe079aa5c22f198c82cb098753fc9091c
1 parent
0232d000
Exists in
master
and in
3 other branches
Colocando o Nickname, imagem e email do usuário no jitsi
Showing
3 changed files
with
36 additions
and
1 deletions
Show diff stats
webconference/templates/webconference/jitsi.html
... | ... | @@ -32,7 +32,35 @@ |
32 | 32 | var width = $("body").width(); // width of the window to be created |
33 | 33 | var height = $("body").height(); // height of the window to be created |
34 | 34 | var html = document.getElementById("jitsi"); |
35 | - var api = new JitsiMeetExternalAPI(domain, room, width, height,html); | |
35 | + var configOverwrite = {disableSimulcast: false}; | |
36 | + var interfaceConfigOverwrite = {filmStripOnly: false}; | |
37 | + var jwt = "Amadeus_Token"; | |
38 | + var api = new JitsiMeetExternalAPI(domain, room, width, height,html,configOverwrite, interfaceConfigOverwrite, false, jwt); | |
39 | + window.onload = initpage; | |
40 | + function initpage(){ | |
41 | + api.executeCommand('displayName', '{{user}}'); | |
42 | + api.executeCommand('email', '{{user.email}}'); | |
43 | + api.executeCommand('avatarUrl', '{{user_image}}'); | |
44 | + api.addEventListener('videoConferenceLeft', function(res){ | |
45 | + console.log(res); | |
46 | + console.log("saiu"); | |
47 | + $.ajax({ | |
48 | + method: "GET", | |
49 | + url: "{% url 'webconferences:saiu'%}", | |
50 | + dataType: 'json', | |
51 | + data: $.extend(res,{'email':'{{user_email}}'}), | |
52 | + success: function(response) { | |
53 | + window.location.replace(response['url']); | |
54 | + console.log(response); | |
55 | + }, | |
56 | + error: function(response) { | |
57 | + console.log(response); | |
58 | + } | |
59 | + }); | |
60 | + }); | |
61 | + } | |
62 | + | |
63 | + // api.executeCommands({displayName: ['Jailson']}); | |
36 | 64 | </script> |
37 | 65 | |
38 | 66 | </body> | ... | ... |
webconference/urls.py
... | ... | @@ -11,4 +11,5 @@ urlpatterns = [ |
11 | 11 | url(r'^window_view/(?P<slug>[\w_-]+)/$', views.NewWindowView.as_view(), name = 'window_view'), |
12 | 12 | url(r'^view/(?P<slug>[\w_-]+)/$', views.InsideView.as_view(), name = 'view'), |
13 | 13 | url(r'^conference/(?P<slug>[\w_-]+)/$',views.Conference.as_view(), name = 'conference'), |
14 | + url(r'^saiu/$',views.saiu, name = 'saiu'), | |
14 | 15 | ] | ... | ... |
webconference/views.py
... | ... | @@ -4,6 +4,7 @@ from django.contrib import messages |
4 | 4 | from django.core.urlresolvers import reverse, reverse_lazy |
5 | 5 | from django.utils.translation import ugettext_lazy as _ |
6 | 6 | from django.contrib.auth.mixins import LoginRequiredMixin |
7 | +from django.http import JsonResponse | |
7 | 8 | |
8 | 9 | from amadeus.permissions import has_subject_permissions, has_resource_permissions |
9 | 10 | |
... | ... | @@ -76,8 +77,13 @@ class Conference(LoginRequiredMixin,generic.TemplateView): |
76 | 77 | def get_context_data(self, **kwargs): |
77 | 78 | context = super(Conference, self).get_context_data(**kwargs) |
78 | 79 | context['name_room'] = kwargs.get('slug') |
80 | + context['user_image'] = 'http://localhost:8000'+str(self.request.user.image.url) | |
79 | 81 | return context |
80 | 82 | |
83 | +def saiu(request): | |
84 | + url = {'url': 'http://localhost:8000' + str(reverse_lazy('webconferences:view', kwargs = {'slug': request.GET['roomName']}))} | |
85 | + return JsonResponse(url, safe=False) | |
86 | + | |
81 | 87 | |
82 | 88 | class InsideView(LoginRequiredMixin, |
83 | 89 | # '''LogMixin,''' | ... | ... |