Commit ec9fecc5 authored by Benjamin Graillot's avatar Benjamin Graillot

Nouveaux arguments

parent 8892cce8
......@@ -17,6 +17,9 @@
* loop: boucler la lecture.
* autoplay: lancer la vidéo à l'ouverture de la page.
* controls: afficher les contrôles de lecture de la vidéo.
* width: largeur du lecteur.
* height: hauteur du lecteur.
* frameborder: afficher la bordure du lecteur.
"""
......@@ -52,11 +55,14 @@ def execute(macro, text):
kwargs[kw] = arg
return macro.formatter.rawHTML(html(*args, **kwargs))
def html(video, controls=1, loop=0, autoplay=0, playlist=None):
html = u'''<iframe width="854" height="480" src="https://www.youtube.com/embed/{}?loop={}&autoplay={}&controls={}{}"></iframe>'''.format(
def html(video, controls=1, loop=0, autoplay=0, width=640, height=360, frameborder=False, playlist=None):
html = u'''<iframe width="{}" height="{}" src="https://www.youtube.com/embed/{}?loop={}&autoplay={}&controls={}{}" frameborder="{}"></iframe>'''.format(
width,
height,
video,
loop,
autoplay,
controls,
'&playlist={}'.format(playlist) if playlist is not None else '')
'&playlist={}'.format(playlist) if playlist is not None else '',
int(frameborder))
return html
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment