Skip to content

Commit

Permalink
add record playback
Browse files Browse the repository at this point in the history
  • Loading branch information
fuji246 committed Dec 22, 2012
1 parent f0ade84 commit f03c1cc
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 21 deletions.
Binary file modified bbb_django/bbb/locale/zh_CN/LC_MESSAGES/django.mo
Binary file not shown.
44 changes: 24 additions & 20 deletions bbb_django/bbb/locale/zh_CN/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-12-21 23:43+0800\n"
"POT-Creation-Date: 2012-12-22 18:28+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"

#: admin.py:13 models.py:48 models.py:198
#: admin.py:13 models.py:48 models.py:241
msgid "agenda"
msgstr "会议安排"

Expand Down Expand Up @@ -62,31 +62,31 @@ msgstr "3小时"
msgid "user"
msgstr "用户"

#: models.py:40 models.py:189
#: models.py:40 models.py:232
msgid "meeting name"
msgstr "会议名称"

#: models.py:41 models.py:190
#: models.py:41 models.py:233
msgid "attendee password"
msgstr "会议密码"

#: models.py:42 models.py:192
#: models.py:42 models.py:235
msgid "moderator password"
msgstr "管理员密码"

#: models.py:43 models.py:194
#: models.py:43 models.py:237
msgid "welcome message"
msgstr "欢迎信息"

#: models.py:44 models.py:195
#: models.py:44 models.py:238
msgid "record"
msgstr "录制"

#: models.py:45 models.py:196
#: models.py:45 models.py:239
msgid "duration"
msgstr "时长"

#: models.py:46 models.py:197
#: models.py:46 models.py:240
msgid "start time"
msgstr "开始时间"

Expand All @@ -102,15 +102,15 @@ msgstr "会议"
msgid "meetings"
msgstr "会议列表"

#: models.py:194
#: models.py:237
msgid "Welcome!"
msgstr "欢迎!"

#: models.py:211
#: models.py:254
msgid "Your name"
msgstr "姓名"

#: models.py:212
#: models.py:255
msgid "password"
msgstr "密码"

Expand Down Expand Up @@ -196,23 +196,27 @@ msgstr "运行中"
msgid "End"
msgstr "结束会议"

#: templates/meetings.html:19
#: templates/meetings.html:20
msgid "Playback"
msgstr "会议录制"

#: templates/meetings.html:22
msgid "Ended"
msgstr "已结束"

#: templates/meetings.html:22
#: templates/meetings.html:25
msgid "Not started"
msgstr "未开始"

#: templates/meetings.html:23
#: templates/meetings.html:26
msgid "Calendar export"
msgstr "日程导出"

#: templates/meetings.html:24
#: templates/meetings.html:27
msgid "Start"
msgstr "开启会议"

#: templates/meetings.html:39
#: templates/meetings.html:42
msgid "There are no meetings at the moment."
msgstr "当前没有会议"

Expand Down Expand Up @@ -278,17 +282,17 @@ msgid ""
"please join the meeting via %(url)s, the attendee password is \"%(pwd)s\""
msgstr "请通过下面的url加入会议:%(url)s, 会议密码为:\"%(pwd)s\""

#: views/core.py:186
#: views/core.py:190
#, python-format
msgid "Successfully ended meeting %s"
msgstr "成功结束会议%s"

#: views/core.py:190
#: views/core.py:194
#, python-format
msgid "Unable to end meeting %s"
msgstr "未能结束会议%s"

#: views/core.py:219
#: views/core.py:223
#, python-format
msgid "Successfully schdulered meeting %s"
msgstr "成功预定会议%s"
Expand Down
43 changes: 43 additions & 0 deletions bbb_django/bbb/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,49 @@ def get_meetings(self):
else:
return 'error'

@classmethod
def get_recordings(self, meeting_id=None):
"""
Retrieves the recordings that are available for playback for a given meetingID (or set of meeting IDs).
:param meetingID: The meeting ID that identifies the meeting
"""
call = 'getRecordings'
if meeting_id:
query = urlencode((
('meetingID', meeting_id),
))
else:
query = ''
hashed = self.api_call(query, call)
url = settings.BBB_API_URL + call + '?' + hashed
print 'recording url:%s'%url
r = parse(urlopen(url).read())
# ToDO implement more keys
if r:
recordings = r.find('recordings')
if recordings is None:
return None
records = []
for session in recordings.findall('recording'):
record = {}
record['record_id'] = session.find('recordID').text
record['meeting_id'] = session.find('meetingID').text
record['meeting_name'] = session.find('name').text
record['published'] = session.find('published').text == "true"
record['start_time'] = session.find('startTime').text
record['end_time'] = session.find('endTime').text
playbacks = session.find('playback')
for f in playbacks.findall('format'):
if f.find('type').text == 'slides':
record['playback_url'] = f.find('url').text
record['length'] = f.find('length').text
records.append(record)
#print records
return records
else:
return None

def start(self):
call = 'create'
voicebridge = 70000 + random.randint(0,9999)
Expand Down
3 changes: 3 additions & 0 deletions bbb_django/bbb/templates/meetings.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ <h2>{% trans "Meetings" %}</h2>
<form method="GET" action="{% url join meeting.meeting_id%}"><input type="submit" value="{% trans "Join" %}"/></form> <form method="POST" action="{% url delete meeting.meeting_id meeting.moderator_pw %}">{% csrf_token %}<input type="submit" value="{% trans "End" %}"/></form>
{% else %}
<span class="status notrunning">{% trans "Ended" %}</span>
{% if meeting.playback_url %}
<input type="submit" value="{% trans "Playback" %}" onclick="javascritp:window.open('{{ meeting.playback_url }}')"/>
{% endif %}
{% endif %}
{% else %}
<span class="status notrunning">{% trans "Not started" %}</span>
Expand Down
6 changes: 5 additions & 1 deletion bbb_django/bbb/views/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,12 @@ def meetings(request):
},
}

record_info = Meeting.get_recordings(meeting.id)
if record_info:
d['playback_url'] = record_info[0]['playback_url']
#print 'record info: %s'% Meeting.get_recordings(meeting.id)
detail = started.get('%d'%meeting.id)
print meeting.id, detail
#print meeting.id, detail
if detail is not None:
d['running'] = detail['running']
d['info'].update(detail['info'])
Expand Down

0 comments on commit f03c1cc

Please sign in to comment.