mirror of
https://github.com/MatomoCamp/pretalx-matomocamp.git
synced 2024-09-19 15:53:48 +02:00
embed recordings
This commit is contained in:
parent
9b242c5cf3
commit
9dda91e2cb
1 changed files with 34 additions and 5 deletions
|
@ -16,13 +16,42 @@ class MatomoVideoProvider(BaseRecordingProvider):
|
||||||
button_title = "View Workshop" if is_workshop else "View Livestream"
|
button_title = "View Workshop" if is_workshop else "View Livestream"
|
||||||
livestream_url = f"https://live.matomocamp.org/" + submission.code
|
livestream_url = f"https://live.matomocamp.org/" + submission.code
|
||||||
chat_url = livestream_url + "/chat_room"
|
chat_url = livestream_url + "/chat_room"
|
||||||
|
recording_url = livestream_url + "/recording"
|
||||||
|
recording_embed_url = livestream_url + "/recording_embed"
|
||||||
return {
|
return {
|
||||||
"iframe": f"""
|
"iframe": f"""
|
||||||
|
<style>
|
||||||
|
.ratio {{ margin-top:1rem}}
|
||||||
|
/* based on https://github.com/twbs/bootstrap/blob/f61a0218b36d915db80dc23635a9078e98e2e3e0/scss/helpers/_ratio.scss */
|
||||||
|
.ratio {{
|
||||||
|
position: relative;
|
||||||
|
width: 100%;
|
||||||
|
}}
|
||||||
|
.ratio::before {{
|
||||||
|
display: block;
|
||||||
|
padding-top: calc(9 / 16 * 100%);
|
||||||
|
content: "";
|
||||||
|
}}
|
||||||
|
|
||||||
|
.ratio > * {{
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}}
|
||||||
|
</style>
|
||||||
<div>
|
<div>
|
||||||
<a href='{livestream_url}' class='btn btn-primary'>{button_title}</a>
|
<a href="{recording_url}" class="btn btn-primary">View Recording</a>
|
||||||
<a href="{chat_url}" class="btn btn-primary">Join Chatroom</a>
|
<a href="{chat_url}" class="btn btn-primary">Join Chatroom</a>
|
||||||
</div>
|
</div>
|
||||||
""",
|
<div class="ratio ratio-16x9" id="peertube-iframe">
|
||||||
|
<iframe src="{recording_embed_url}"
|
||||||
|
allowfullscreen
|
||||||
|
sandbox="allow-same-origin allow-scripts allow-popups"
|
||||||
|
></iframe>
|
||||||
|
</div>""",
|
||||||
|
"csp_header": "https://video.matomocamp.org/ https://live.matomocamp.org/"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue