Support direct external video links

This commit is contained in:
Niels G. W. Serup 2025-02-09 17:01:01 +01:00
parent 2a555f14e8
commit 31cc2c2ccb
No known key found for this signature in database
GPG Key ID: 38EEEBCE67324F19
1 changed files with 6 additions and 2 deletions

View File

@ -86,8 +86,7 @@ def iframe_video(file_src):
</iframe>
'''.format(url=file_src)
def extern_video(file_src):
url = 'https://media-metanohi-name.eu-central-1.linodeobjects.com/media/' + file_src
def url_video(url):
return '''\
<video src="{url}" controls height="427">
Your browser cannot play this video. You can download it here instead:
@ -95,6 +94,10 @@ Your browser cannot play this video. You can download it here instead:
</video>
'''.format(url=url)
def extern_video(file_src):
url = 'https://media-metanohi-name.eu-central-1.linodeobjects.com/media/' + file_src
return url_video(url)
def youtube_video(file_src):
yt_id = file_src
return '''\
@ -119,6 +122,7 @@ def generate_video_page(base_dir, out_dir, base_html, showing_html, media):
file_type, file_src = media['file'].split(':', 1)
actions = {
'extern': extern_video,
'url': url_video
'iframe': iframe_video,
'youtube': youtube_video
}