Support direct external video links
This commit is contained in:
parent
2a555f14e8
commit
31cc2c2ccb
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue