Support direct external video links
This commit is contained in:
parent
2a555f14e8
commit
31cc2c2ccb
|
@ -86,8 +86,7 @@ def iframe_video(file_src):
|
||||||
</iframe>
|
</iframe>
|
||||||
'''.format(url=file_src)
|
'''.format(url=file_src)
|
||||||
|
|
||||||
def extern_video(file_src):
|
def url_video(url):
|
||||||
url = 'https://media-metanohi-name.eu-central-1.linodeobjects.com/media/' + file_src
|
|
||||||
return '''\
|
return '''\
|
||||||
<video src="{url}" controls height="427">
|
<video src="{url}" controls height="427">
|
||||||
Your browser cannot play this video. You can download it here instead:
|
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>
|
</video>
|
||||||
'''.format(url=url)
|
'''.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):
|
def youtube_video(file_src):
|
||||||
yt_id = file_src
|
yt_id = file_src
|
||||||
return '''\
|
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)
|
file_type, file_src = media['file'].split(':', 1)
|
||||||
actions = {
|
actions = {
|
||||||
'extern': extern_video,
|
'extern': extern_video,
|
||||||
|
'url': url_video
|
||||||
'iframe': iframe_video,
|
'iframe': iframe_video,
|
||||||
'youtube': youtube_video
|
'youtube': youtube_video
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue