Append oembed

master
Bob Mottram 2019-08-21 12:40:43 +01:00
parent 444137e915
commit 79d9313abd
1 changed files with 3 additions and 1 deletions

View File

@ -1032,7 +1032,9 @@ def addEmbeddedVideo(content: str,width=400,height=300) -> str:
url=content.split('"'+videoSite)[1] url=content.split('"'+videoSite)[1]
if '"' in url: if '"' in url:
url=url.split('"')[0] url=url.split('"')[0]
content=content+"<center><iframe src=\""+videoSite+url+"\" width=\"50%\" frameborder=\"0\" allowfullscreen></iframe></center>" if not url.endswith('/oembed'):
url=url+'/oembed'
content=content+"<center><iframe src=\""+videoSite+url+"\" width=\""+str(width)+"\" height=\""+str(height)+"\" frameborder=\"0\" allow=\"autoplay; fullscreen\" allowfullscreen></iframe></center>"
return content return content
# A selection of the current larger peertube sites, mostly French and German language # A selection of the current larger peertube sites, mostly French and German language