From c0b14eb026f8cf1139a8151da0a1b23df7e3be92 Mon Sep 17 00:00:00 2001 From: Loan Robert Date: Thu, 25 Jul 2024 14:28:12 +0200 Subject: [PATCH] Add modal to copy direct link to recording --- web/b3desk/models/bbb.py | 19 ++++++++- web/b3desk/templates/meeting/recordings.html | 42 +++++++++++++++++++- 2 files changed, 58 insertions(+), 3 deletions(-) diff --git a/web/b3desk/models/bbb.py b/web/b3desk/models/bbb.py index eb74f8d3..60b03974 100644 --- a/web/b3desk/models/bbb.py +++ b/web/b3desk/models/bbb.py @@ -275,9 +275,26 @@ def get_recordings(self): type = format.find("type").text if type in ("presentation", "video"): data["playbacks"][type] = { - "url": format.find("url").text, + "url": (media_url := format.find("url").text), "images": images, } + if type == "video": + try: + resp = requests.get( + direct_link := media_url + "video-0.m4v" + ) + if resp.status_code == 200: + data["playbacks"][type]["direct_link"] = ( + direct_link + ) + except ( + requests.exceptions.HTTPError, + requests.exceptions.ConnectionError, + ): + current_app.logger.warning( + "No direct recording link for meeting %s", + self.meeting.meetingID, + ) result.append(data) except Exception as exception: current_app.logger.error(exception) diff --git a/web/b3desk/templates/meeting/recordings.html b/web/b3desk/templates/meeting/recordings.html index 9c6a826b..5b786d18 100644 --- a/web/b3desk/templates/meeting/recordings.html +++ b/web/b3desk/templates/meeting/recordings.html @@ -58,9 +58,13 @@

{% if recording.playbacks.get("video") %} - mp4 + {% if recording.playbacks.video.get("direct_link") %} + + {% endif %} {% endif %} - @@ -151,6 +155,40 @@

+ + +
+
+
+
+
+ +
+
+

+ + Partager l'enregistrement de "{{ recording_name }}" +

+ {% if recording.playbacks.get("video") %} + {% if recording.playbacks.video.get("direct_link") %} +
+ + +
+ {% endif %} + {% endif %} +
+
+
+
+
+
+ {% endfor %}