torchbox/wagtailmedia

Feature Request: Video Attributes

cesaregarza opened this issue · 1 comments

wagtailmedia has been excellent to use and I'm a huge fan, the only thing I'm yearning for a little bit is the ability to specify attributes. Rather than using gifs, I've been using H264/Webm videos to display animations created with manim. However, the lack of ability to specify loop directly is a minor inconvenience. I figured I'd put this feature request in as it might be helpful to others as well. Thanks for the awesome extension!

@cesaregarza it would be great to get a sense of how you're using it.
The only place we're prescriptive, is in the VideoChooserBlock (

def render_basic(self, value, context=None) -> str:
if not value:
return ""
if value.type != self.media_type:
return ""
return format_video_html(value)
)

You can define your own chooser block that extends VideoChooserBlock and overrides render_basic with whatever your would like.

How do you envision specifying the attributes?