Skip to content
Snippets Groups Projects
Commit 6840e640 authored by Olivia206's avatar Olivia206
Browse files

removed iframe partial

parent 70790318
No related branches found
No related tags found
No related merge requests found
{{- $template := .block.template -}}
{{- $position := .block.position -}}
{{- $title := .block.title -}}
{{- with .block.data -}}
<div class="block block-video{{ if $title }} block-with-title{{ end }}">
<div class="container">
......@@ -13,21 +12,10 @@
{{ end -}}
{{ if .url }}
<div class="video">
<div class="video-player">
<button class="video-player__play" title ="{{- i18n "blocks.video.play" -}}" aria-label="{{- i18n "blocks.video.play" -}}"></button>
<picture>
<source srcset="https://osuny-1b4da.kxcdn.com/g1qn3b0yvdg2t0wosq059xocpyq1?format=webp&width=1800&height=0&&fit=inside&quality=50" type="image/jpg" />
<img src="https://osuny-1b4da.kxcdn.com/g1qn3b0yvdg2t0wosq059xocpyq1?format=webp&width=1800&height=0&&fit=inside&quality=50" alt="" />
</picture>
</div>
<div class="video-container" data-url="{{ .url }}">
{{ partial "blocks/templates/video/GetIframe" ( dict
"url" ""
"title" .video_title
)}}
</div>
</div>
<div class="video">
{{ $partial := printf "blocks/templates/video/%s" .video.platform }}
{{ partial $partial . }}
</div>
{{ end }}
{{ if .video_title }}
......@@ -36,7 +24,7 @@
{{ partial "commons/transcription" ( dict
"transcription" .transcription
"position" $position
"position" .block.position
) }}
</div>
</div>
......
{{ $url := .url }}
{{ $identifier := false }}
{{ $title := partial "PrepareHTML" .title }}
{{ $domain := "" }}
{{ $vimeo := (dict
"name" "vimeo"
"urls" (slice "vimeo.com")
) }}
{{ $youtube := (dict
"name" "youtube"
"urls" (slice "youtube.com" "youtu.be")
) }}
{{ $dailymotion := (dict
"name" "dailymotion"
"urls" (slice "dailymotion.com" "dai.ly")
) }}
{{ $peertube := (dict
"name" "peertube"
"urls" (slice "peertube")
) }}
{{ $providers := slice $vimeo $youtube $dailymotion $peertube }}
{{ range $provider := $providers }}
{{ range $provider_url := $provider.urls }}
{{ if in $url $provider_url }}
{{ if eq $provider.name "vimeo" }}
{{ $parts := split $url "/" }}
{{ $identifier = (index (last 1 $parts) 0) }}
{{ else if eq $provider.name "youtube" }}
{{ if eq $provider_url "youtu.be" }}
{{ $parts := split $url "/" }}
{{ $identifier = (index (last 1 $parts) 0) }}
{{ else if eq $provider_url "youtube.com" }}
{{ $parts := split $url "v=" }}
{{ $identifier = (index (last 1 $parts) 0) }}
{{ end }}
{{ else if eq $provider.name "dailymotion" }}
{{ if eq $provider_url "dai.ly" }}
{{ $parts := split $url "dai.ly/" }}
{{ $identifier = (index (last 1 $parts) 0) }}
{{ else if eq $provider_url "dailymotion.com" }}
{{ $parts := split $url "video/" }}
{{ $identifier = (index (last 1 $parts) 0) }}
{{ end }}
{{ else if eq $provider.name "peertube" }}
{{ $parts := split $url "w/" }}
{{ $identifier = (index (last 1 $parts) 0) }}
{{ $domain = (index (first 1 $parts) 0)}}
{{ end }}
{{ if $identifier }}
{{ $partial := printf "blocks/templates/video/%s.html" $provider.name }}
{{ partial $partial (dict
"lolo" $url
"id" $identifier
"title" $title
"domain" $domain
)}}
{{ end }}
{{ end }}
{{ end }}
{{ end }}
{{ if not $identifier }}
{{ partial "blocks/templates/video/iframe.html" (dict
"url" $url
"title" $title
)}}
{{ end }}
<iframe
class="dailymotion"
src="https://www.dailymotion.com/embed/video/{{ .id }}"
title="{{ .title }}"
loading="lazy">
</iframe>
{{ partial "PrepareHTML" .video.iframe }}
\ No newline at end of file
{{ partial "PrepareHTML" .video.iframe }}
\ No newline at end of file
<iframe
src=""
title="{{ .title }}"
loading="lazy">
</iframe>
\ No newline at end of file
<iframe
class="peertube"
src="{{ .domain }}videos/embed/{{ .id }}"
title="{{ .title }}"
loading="lazy">
</iframe>
{{ partial "PrepareHTML" .video.iframe }}
\ No newline at end of file
<iframe
class="vimeo"
src="https://player.vimeo.com/video/{{ .id }}"
title="{{ .title }}"
loading="lazy">
</iframe>
{{ partial "PrepareHTML" .video.iframe }}
\ No newline at end of file
<iframe
class="youtube"
src="https://www.youtube.com/embed/{{ .id }}"
title="{{ .title }}"
loading="lazy">
</iframe>
{{ partial "PrepareHTML" .video.iframe }}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment