]> git.parisson.com Git - teleforma.git/commitdiff
update video monitor to get web server proxy streams
authorGuillaume Pellerin <yomguy@parisson.com>
Sat, 1 Feb 2014 13:57:28 +0000 (14:57 +0100)
committerGuillaume Pellerin <yomguy@parisson.com>
Sat, 1 Feb 2014 13:57:28 +0000 (14:57 +0100)
teleforma/sources/models.py
teleforma/templates/teleforma/source_detail.html

index ea89c97c01e77c91b5432daef770cac20978f80c..2dde36a07ab8c2c778ec5e8d02120601adab551f 100644 (file)
@@ -33,7 +33,8 @@ class Source(Model):
     room              = ForeignKey(Room, related_name='source', verbose_name=_('room'), 
                                     blank=True, null=True, on_delete=models.SET_NULL)
     monitors          = ManyToManyField(Monitor, related_name="source", 
-                                    verbose_name=_('monitors'), blank=True, null=True)    
+                                    verbose_name=_('monitors'), blank=True, null=True)
+
     class Meta:
         db_table = app_label + '_' + 'source'
         ordering = ['public_id']
@@ -41,6 +42,11 @@ class Source(Model):
     def __unicode__(self):
         return '-'.join([self.public_id, self.room.name, self.ip])
 
+    @property
+    def proxy(self):
+        "As set in the reverse proxy pass on the web server"
+        return '/telecaster/' + public_id + '/'
+
     @property
     def default_monitor_url(self):
         return 'http://' + str(self.ip) + self.monitors.all()[0].slug
index 6d74fc85f38b8e50169db3c2130a121a437ad1d5..80621a9b4987726f3126d2618365f00496df97ab 100644 (file)
@@ -41,7 +41,7 @@
 
 <div class="video">
 <video width="864" height="480" controls autoplay>
-<source src="{{ object.default_monitor_url }}" type="video/webm" />
+<source src="{{ object.proxy }}" type="video/webm" />
 </video>
 </div>