def expand_db_attributes(attrs, for_editor): """ Given a dict of attributes from the <embed> tag, return the real HTML representation. """ if for_editor: try: return format.embed_to_editor_html(attrs['url']) except EmbedException: # Could be replaced with a nice error message return '' else: return format.embed_to_frontend_html(attrs['url'])
def html(self): return embed_to_frontend_html(self.url)
def __str__(self): return embed_to_frontend_html(self.url)
def get_context(self, parent_context=None): video_url = self.obj['settings'].get('video_url', '') self.obj['settings']['player_html'] = embed_to_frontend_html(video_url) context = super().get_context(parent_context=parent_context) return context
def expand_db_attributes(attrs): """ Given a dict of attributes from the <embed> tag, return the real HTML representation for use on the front-end. """ return format.embed_to_frontend_html(attrs['url'])
def html(self): return embed_to_frontend_html(self.url, self.max_width, self.max_height)
def media_embedtype_handler(attrs): """ Given a dict of attributes from the <embed> tag, return the real HTML representation for use on the front-end. """ return format.embed_to_frontend_html(attrs['url'])