]> git.parisson.com Git - teleforma.git/commitdiff
- add stream-m snapshot to live preview
authoryomguy <yomguy@parisson.com>
Fri, 22 Jun 2012 13:34:41 +0000 (15:34 +0200)
committeryomguy <yomguy@parisson.com>
Fri, 22 Jun 2012 13:34:41 +0000 (15:34 +0200)
- prepare telecaster inclusion..

teleforma/models.py
teleforma/static/teleforma/css/teleforma.css
teleforma/templates/teleforma/inc/conference_list.html

index 9bc49537dc34dd9a50a9061b5c54a2af7307f9f9..0538caf4763d1ef0bca542cf38fbeb7d375c57d9 100755 (executable)
@@ -260,6 +260,14 @@ class LiveStream(Model):
         else:
             return self.slug + '.' + self.stream_type
 
+    @property
+    def snapshot_url(self):
+        url = ''
+        if self.server.type == 'stream-m':
+            url = 'http://' + self.server.host + ':' + self.server.port + \
+                    '/snapshot/' + self.slug
+        return url
+
     @property
     def url(self):
         return 'http://' + self.server.host + ':' + self.server.port + '/' + self.mount_point
index 172420707c2297a800686108735a27bb38987203..9edbd6f6c6cf38b9f8105bb714711319b29ff116 100644 (file)
@@ -641,7 +641,7 @@ dl dt {
 }
 
 dl.listing dt {
-    width: 18em;
+    width: 30%;
     background-color: #f9f9f9;
     border: .1em solid #eee;
     border-right: .3em solid #ddd;
@@ -649,6 +649,7 @@ dl.listing dt {
     margin-right: .8em;
     color: #444;
 }
+
 dl.listing dt.group {
     float: none;
     margin-top: .9em;
@@ -658,7 +659,7 @@ dl.listing dt.group {
     width: 18.2em;
 }
 dl.listing dd {
-    margin-left: 19.4em;
+    margin-left: 30%;
     font-weight: bold;
 }
 
index b0cb720f1940fa2fdc0fd51276c494f83004b938..16337bcd7906030f77e989be685699c38ab56250 100644 (file)
     <tbody>
         {% for stream in course.livestream.all|from_course_type:type %}
             <tr>
-            <td {% if forloop.counter0 == 0 %}class="border-top"{% endif %} width="60%"><a href="{% url teleforma-conference-detail stream.conference.id %}" title="{% trans "View" %}"><img src="{{ STATIC_URL }}/teleforma/images/network-wireless.png" style="vertical-align:middle" alt="" /> {{ stream.slug }}</a></td>
-            <td {% if forloop.counter0 == 0 %}class="border-top"{% endif %} width="35%">{{ stream.conference.date_begin }}</td>
-            <td {% if forloop.counter0 == 0 %}class="border-top"{% endif %} width="5%" align="center">
+            <td {% if forloop.counter0 == 0 %}class="border-top"{% endif %} width="30%">
+             {% if stream.streaming %}
+               <a href="{% url teleforma-conference-detail stream.conference.id %}" title="{% trans "View" %}">
+               <img id="snapshot-{{ stream.course.code }}" src="{{ stream.snapshot_url }}" width="100%" alt="snapshot" />
+               </a>
+             {% else %}
+               {% trans "The conference is not started yet. Please wait..." %}
+             {% endif %}
+            </td>
+            <td {% if forloop.counter0 == 0 %}class="border-top"{% endif %} width="60%" style="padding-left: 1em;">
+                <div>
+                    <dl class="listing" style="font-size: 1.2em;">
+                    <dt>{% trans "Title" %}</dt><dd>{{ stream.conference.course.title }}</dd>
+                    <dt>{% trans "Session" %}</dt><dd>{{ stream.conference.session }}</dd>
+                    <dt>{% trans "Professor" %}</dt><dd><a href="{% url telemeta-profile-detail stream.conference.professor.user.username %}" target="_blank">{{ stream.conference.professor }}</a></dd>
+                    <dt>{% trans "Begin" %}</dt><dd>{{ stream.conference.date_begin }}</dd>
+                    </dl>
+                 </div>
+            </td>
+            <td {% if forloop.counter0 == 0 %}class="border-top"{% endif %} width="10%" align="center">
                 {% if stream.streaming %}
-                <img src="images/media-record.png" alt="yes" style="vertical-align:middle" />
+                <img src="{{ STATIC_URL }}teleforma/images/network-wireless.png" style="vertical-align:middle" title="streaming" />
+                <img src="{{ STATIC_URL }}telemeta/images/media-record.png" style="vertical-align:middle" title="recording" />
                 {% endif %}
             </td>
             </tr>
+         <script type="text/javascript">
+            function update_snapshots_callback_{{ stream.course.code }}() {
+                var d = 1;
+                var refresh = function(){
+                $("#snapshot-{{ stream.course.code }}").attr("src","{{ stream.snapshot_url }}");
+                };
+            refresh();
+            setInterval(refresh,d);
+            };
+            update_snapshots_callback_{{ stream.course.code }}();
+            </script>
         {% endfor %}
     </tbody>
     </table>
 </div>
+
+
+
 {% endif %}
\ No newline at end of file