Skip to content

Commit

Permalink
Fix usage of live links
Browse files Browse the repository at this point in the history
Originally introduced in 36f0071
  • Loading branch information
lorenzschmid committed Feb 17, 2023
1 parent d2b009a commit 43c10d9
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 12 deletions.
8 changes: 8 additions & 0 deletions _includes/partials/get_room_live_href.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{% assign room_live_href = '' -%}
{%- if room.live -%}
{%- if room.live.absolute_url -%}
{%- assign room_live_href = room.live.absolute_url -%}
{%- elsif room.live.relative_url -%}
{%- assign room_live_href = room.live.relative_url | prepend: site.baseurl -%}
{%- endif -%}
{%- endif -%}
13 changes: 8 additions & 5 deletions _includes/partials/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,15 @@
<link rel="prefetch" as="fetch" href="{{ site.baseurl }}/assets/js/data.json" type="application/json" crossorigin="anonymous" />
{%- endif %}

{%- if site.conference.live.streaming.enable -%}
{%- for room in site.rooms -%}
{%- if site.conference.live.streaming.enable %}
{%- for room in site.rooms %}
{%- if room.live %}
<link rel="preconnect" href="{{ room.live }}" />
{%- endif -%}
{%- endfor -%}
{%- include partials/get_room_live_href.html %}
{%- if room_live_href %}
<link rel="preconnect" href="{{ room_live_href }}" />
{%- endif %}
{%- endif %}
{%- endfor %}
{%- endif %}
</head>

Expand Down
9 changes: 3 additions & 6 deletions _layouts/data.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,10 @@
{%- assign first_room = true -%}
{%- for room in site.rooms %}
{%- if room.live -%}
{%- if room.live.absolute_url -%}
{%- assign room_live_href = room.live.absolute_url -%}
{%- elsif room.live.relative_url -%}
{%- assign room_live_href = room.live.relative_url | prepend: site.baseurl -%}
{%- else -%}
{%- include partials/get_room_live_href.html -%}
{%- unless room_live_href -%}
{%- continue -%}
{%- endif -%}
{%- endunless -%}

{%- unless first_room -%}
,
Expand Down
3 changes: 2 additions & 1 deletion _layouts/stream-overview.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ <h1 class="display-5 mb-4">
<div class="col-md mb-4">
<h3>{{ room.name }}</h3>
<div class="embed-responsive embed-responsive-16by9">
<iframe class="embed-responsive-item" src="{{ room.live }}" allowfullscreen></iframe>
{%- include partials/get_room_live_href.html %}
<iframe class="embed-responsive-item" src="{{ room_live_href }}" allowfullscreen></iframe>
</div>
</div>

Expand Down

0 comments on commit 43c10d9

Please sign in to comment.