youtube fixes
This commit is contained in:
parent
14679dc0a5
commit
e7192e6bbd
1 changed files with 4 additions and 1 deletions
|
@ -37,7 +37,10 @@ class Event(models.Model):
|
|||
elif '<' in self.media:
|
||||
html = self.media
|
||||
else:
|
||||
html += '<iframe src="%s"></iframe>' % self.media
|
||||
url = self.media
|
||||
if 'youtube.com/watch' in url:
|
||||
url = url.replace('/watch', '/embed')
|
||||
html += '<iframe src="%s" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>' % url
|
||||
if self.media_caption:
|
||||
html = '<figure>%s<figcaption>%s</figcaption></figure>' % (html, self.media_caption)
|
||||
return html
|
||||
|
|
Loading…
Reference in a new issue