feat: embeds in lesson

This commit is contained in:
Jannat Patel
2023-08-31 21:33:09 +05:30
parent e402f322f6
commit 833e714a1f
5 changed files with 49 additions and 0 deletions

View File

@@ -155,6 +155,20 @@ def youtube_video_renderer(video_id):
"""
def embed_renderer(details):
src = details.split("|||")[1]
return f"""
<iframe width="100%" height="400"
src={src}
title="Embedded Content"
frameborder="0"
style="border-radius: var(--border-radius-lg)"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
allowfullscreen>
</iframe>
"""
def video_renderer(src):
return (
f"<video controls width='100%'><source src={quote(src)} type='video/mp4'></video>"