def mediaplayer(properties, autostart="false"): fileurl = determine_asset_url(properties) try: res = mediaplayers.build_proper_viewer(fileurl, autostart=(autostart == "true")) return mark_safe(res) except: logging.error("mediaplayer filter failed", exc_info=True) return mark_safe("<a href=" + fileurl + ">" + fileurl + "</a>")
def mediaplayer(properties, autostart="false"): fileurl = determine_asset_url(properties) title = properties.get("title") if hasattr(properties, "get") else properties # might even be None try: res = mediaplayers.build_proper_viewer(fileurl, title=title, autostart=(autostart == "true")) return mark_safe(res) except: logging.error("mediaplayer filter failed", exc_info=True) return mark_safe("<a href=" + fileurl + ">" + fileurl + "</a>")
def mediaplayer(properties, autostart="false"): fileurl = determine_asset_url(properties) title = properties.get("title") if hasattr( properties, "get") else properties # might even be None try: res = mediaplayers.build_proper_viewer(fileurl, title=title, autostart=(autostart == "true")) return mark_safe(res) except: logging.error("mediaplayer filter failed", exc_info=True) return mark_safe("<a href=" + fileurl + ">" + fileurl + "</a>")
def _determine_asset_url(properties): return determine_asset_url(properties)