1 | {{ if eq .type "youtube" }} |
---|
2 | <div class="responsive-video youtube"> |
---|
3 | <iframe class="no-js-hidden" src="https://www.youtube-nocookie.com/embed/{{ .id }}?rel=0" allowfullscreen></iframe> |
---|
4 | |
---|
5 | <div class="no-js-message"> |
---|
6 | The YouTube player can not be loaded with disabled JavaScript. <br> |
---|
7 | The following video is embedded here: <br> |
---|
8 | |
---|
9 | <a href="https://youtube.com/watch?v={{ .id }}" target="_blank"> |
---|
10 | https://youtube.com/watch?v={{ .id }} |
---|
11 | </a> |
---|
12 | </div> |
---|
13 | </div> |
---|
14 | {{ end }} |
---|
15 | |
---|
16 | {{ if eq .type "vimeo" }} |
---|
17 | <div class="responsive-video vimeo"> |
---|
18 | <iframe class="no-js-hidden" src="https://player.vimeo.com/video/{{ .id }}" |
---|
19 | webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe> |
---|
20 | |
---|
21 | <div class="no-js-message"> |
---|
22 | The Vimeo player can not be loaded with disabled JavaScript. <br> |
---|
23 | The following video is embedded here: <br> |
---|
24 | |
---|
25 | <a href="https://vimeo.com/{{ .id }}" target="_blank"> |
---|
26 | https://vimeo.com/{{ .id }} |
---|
27 | </a> |
---|
28 | </div> |
---|
29 | </div> |
---|
30 | {{ end }} |
---|
31 | |
---|
32 | {{ if eq .type "prezi" }} |
---|
33 | <div class="responsive-video prezi"> |
---|
34 | <iframe class="no-js-hidden" src="https://prezi.com/v/embed/{{ .id }}/" webkitallowfullscreen mozallowfullscreen |
---|
35 | allowfullscreen></iframe> |
---|
36 | |
---|
37 | <div class="no-js-message"> |
---|
38 | The Prezi player can not be loaded with disabled JavaScript. <br> |
---|
39 | The following video is embedded here: <br> |
---|
40 | |
---|
41 | <a href="https://prezi.com/v/embed/{{ .id }}" target="_blank"> |
---|
42 | https://prezi.com/v/embed/{{ .id }} |
---|
43 | </a> |
---|
44 | </div> |
---|
45 | </div> |
---|
46 | {{ end }} |
---|
47 | |
---|
48 | {{ if eq .type "bilibili" }} |
---|
49 | <div class="responsive-video bilibili" style="padding-bottom: 75%"> |
---|
50 | <iframe |
---|
51 | class="no-js-hidden" src="https://player.bilibili.com/player.html?bvid={{ .id }}&page=1&as_wide=1&high_quality=1&danmaku=0" |
---|
52 | scrolling="no" framespacing="0" webkitallowfullscreen mozallowfullscreen allowfullscreen> |
---|
53 | </iframe> |
---|
54 | |
---|
55 | <div class="no-js-message"> |
---|
56 | The Bilibili player can not be loaded with disabled JavaScript. <br> |
---|
57 | The following video is embedded here: <br> |
---|
58 | |
---|
59 | <a href="https://www.bilibili.com/video/{{ .id }}" target="_blank"> |
---|
60 | https://www.bilibili.com/video/{{ .id }} |
---|
61 | </a> |
---|
62 | </div> |
---|
63 | </div> |
---|
64 | {{ end }} |
---|
65 | |
---|
66 | {{ if (eq .type "peertube") }} |
---|
67 | {{- $srcUrl := urls.Parse .id -}} |
---|
68 | {{- $embedUrl := printf "%s://%s/videos/embed/%s" $srcUrl.Scheme $srcUrl.Host ($srcUrl.Path | path.Base) -}} |
---|
69 | <div class="responsive-video peertube"> |
---|
70 | <iframe class="no-js-hidden" sandbox="allow-same-origin allow-scripts allow-popups" src="{{ $embedUrl }}" allowfullscreen></iframe> |
---|
71 | |
---|
72 | <div class="no-js-message"> |
---|
73 | The PeerTube player can not be loaded with disabled JavaScript. <br> |
---|
74 | The following video is embedded here: <br> |
---|
75 | |
---|
76 | <a href="{{ .id }}" target="_blank"> |
---|
77 | {{ .id }} |
---|
78 | </a> |
---|
79 | </div> |
---|
80 | </div> |
---|
81 | {{ end }} |
---|
82 | |
---|
83 | {{ if eq .type "mp4" }} |
---|
84 | <div class="responsive-video local"> |
---|
85 | <video width="100%" controls poster="{{ .imageUrl }}"> |
---|
86 | <source src="{{ .url }}" type="video/mp4"> |
---|
87 | |
---|
88 | Your browser does not support the video tag. |
---|
89 | </video> |
---|
90 | </div> |
---|
91 | {{ end }} |
---|