]> git.parisson.com Git - teleforma.git/commitdiff
manage multiple media sources by conferences (prepare multi camera sources from telec...
authorGuillaume Pellerin <guillaume.pellerin@free.fr>
Mon, 12 Feb 2024 15:07:11 +0000 (16:07 +0100)
committerGuillaume Pellerin <guillaume.pellerin@free.fr>
Mon, 26 Feb 2024 14:20:13 +0000 (15:20 +0100)
teleforma/models/core.py
teleforma/views/core.py

index 489238038c15eb5d4a56693a9346baff42f3009a..79807d2f1a194b90e025eee824a3181438bc1e32 100644 (file)
@@ -688,11 +688,19 @@ class LiveStream(models.Model):
     stream_type = models.CharField(_('Streaming type'),
                                    choices=streaming_choices, max_length=32)
     streaming = models.BooleanField(_('streaming'))
+    video_id = models.IntegerField(
+        _('video id'),
+        blank=True,
+        null=True
+        )
 
     @property
     def slug(self):
         if self.conference:
-            return self.conference.slug
+            if self.video_id:
+                return self.conference.slug + '_' + self.video_id
+            else:
+                return self.conference.slug
         else:
             return 'None'
 
index 54d22a1b743e7c23b76c6514ba0f2b73bcaa8323..3afb45c9681d4c5fa28c9e31aa75f72aa7c07f92 100644 (file)
@@ -870,6 +870,7 @@ class ConferenceView(CourseAccessMixin, DetailView):
                             settings, "TELECASTER_LIVE_STREAMING_PROTOCOL", 'http')
                         server_type = stream['server_type']
                         stream_type = stream['stream_type']
+
                         if server_type == 'icecast':
                             port = getattr(
                                 settings, "TELECASTER_LIVE_ICECAST_STREAMING_PORT", '8000')
@@ -880,15 +881,22 @@ class ConferenceView(CourseAccessMixin, DetailView):
                                 settings, "TELECASTER_LIVE_STREAM_M_STREAMING_PORT", '8080')
                             path = getattr(
                                 settings, "TELECASTER_LIVE_STREAM_M_STREAMING_PATH", '/')
-                        #site = Site.objects.all()[0]
+
+                        if "video_id" in stream:
+                            video_id = stream['video_id']
+                        else:
+                            video_id = None
+
                         server, c = StreamingServer.objects.get_or_create(
                             protocol=protocol,
                             host=host,
                             port=port,
                             path=path,
                             type=server_type)
+
                         stream = LiveStream(conference=conference, server=server,
-                                            stream_type=stream_type, streaming=True)
+                                            stream_type=stream_type, streaming=True,
+                                            video_id=video_id)
                         stream.save()
 
                     if not conference.web_class_group and settings.TELECASTER_LIVE_TWEETER: