Add sample page
This commit is contained in:
@ -47,8 +47,8 @@ class PeerTube(Directive):
|
||||
|
||||
url = f"https://{instanceURL}/videos/embed/{videoID}?"
|
||||
|
||||
width = self.options["width"] if "width" in self.options else "560"
|
||||
height = self.options["height"] if "height" in self.options else "315"
|
||||
width = self.options["width"] if "width" in self.options else 560
|
||||
height = self.options["height"] if "height" in self.options else 315
|
||||
fullscreen = (
|
||||
self.options["fullscreen"] if "fullscreen" in self.options else True
|
||||
)
|
||||
@ -57,36 +57,36 @@ class PeerTube(Directive):
|
||||
muted = self.options["muted"] if "muted" in self.options else False
|
||||
loop = self.options["loop"] if "loop" in self.options else False
|
||||
title_show = (
|
||||
self.options["title_show"] if "title_show" in self.options else True
|
||||
self.options["title_show"] if "title_show" in self.options else ""
|
||||
)
|
||||
privacy_show = (
|
||||
self.options["privacy_show"] if "privacy_show" in self.options else True
|
||||
self.options["privacy_show"] if "privacy_show" in self.options else ""
|
||||
)
|
||||
controls_show = (
|
||||
self.options["controls_show"] if "controls_show" in self.options else True
|
||||
self.options["controls_show"] if "controls_show" in self.options else ""
|
||||
)
|
||||
|
||||
iframe_arguments = [
|
||||
(width, "width='{}'"),
|
||||
(height, "height='{}'"),
|
||||
(width, "width={}"),
|
||||
(height, "height={}"),
|
||||
(fullscreen, "allowfullscreen"),
|
||||
(seamless, "frameborder='0'"),
|
||||
]
|
||||
|
||||
url_arguments = [
|
||||
(autoplay, "autoplay='{}'"),
|
||||
(muted, "muted='{}'"),
|
||||
(loop, "loop='{}'"),
|
||||
(title_show, "title='{}'"),
|
||||
(privacy_show, "warningTitle='{}'"),
|
||||
(controls_show, "controls='{}'"),
|
||||
(autoplay, "autoplay={}"),
|
||||
(muted, "muted={}"),
|
||||
(loop, "loop={}"),
|
||||
(title_show, "title={}"),
|
||||
(privacy_show, "warningTitle={}"),
|
||||
(controls_show, "controls={}"),
|
||||
]
|
||||
|
||||
for value, format in url_arguments:
|
||||
toggle = 1 if value == True else 0
|
||||
url += (format).format(toggle) if value else ""
|
||||
|
||||
embed_block = f"<iframe src={url} "
|
||||
url += format.format(toggle) if value else ""
|
||||
url.replace("'", "")
|
||||
embed_block = "<iframe src='{}' ".format(url)
|
||||
|
||||
for value, format in iframe_arguments:
|
||||
embed_block += (format + " ").format(value) if value else ""
|
||||
|
Reference in New Issue
Block a user