user macro - upload img or video file

Sergio _ December 16, 2022

Hi.

I need to create a macro  to display a video or image in a video player.


Having the following code.

## @param tipe:title=Tipo de recurso|type=enum|enumValues=Imagen,Vídeo|required=true|default=none|desc=Elige un tipo (requerido)
## @param image:title=URL de la imagen|type=string|required=false|desc=Introduce la URL de la imagen (requerido)
## @param video:title=URL del vídeo|type=string|required=false|desc=Introduce la URL del vídeo (requerido en caso de vídeo)
## @param width:title=Width|type=string|required=false|default=45%|desc=Ancho (es recomendable dejar como está y solo ajustar si es necesario)

#set ($attachment = $content.getAttachmentNamed($paramvideo))

#if ($paramtipe && $paramtipe=="Imagen")
<img style="margin:0px auto !important; display:block;" class="teaser"
#if ($paramimage && $paramimage.length()>0) src="$paramimage" #end
#if ($paramwidth && $paramwidth.length()>0) width="$paramwidth" #end
>
#end

#if ($paramtipe && $paramtipe=="Vídeo")
<div style="margin:0px auto !important; display:block; text-align:center !important;">
<video style="margin:0px auto !important; display:block; text-align:center !important;" controls
#if ($paramimage && $paramimage.length()>0) src="$paramvideo" poster="$paramimage" #end
#if ($paramwidth && $paramwidth.length()>0) width="$paramwidth" #end
>
<img style="margin:0px auto !important; display:block;" class="teaser" width="$paramwidth" src="$paramimage">
Si tienes problemas para visualizar el vídeo, haz clic <a target="_blank" href="$paramvideo">aquí</a>.</p>
</video>
</div>
#end

 
Can I use something similar to  the next param to replace the url field for an upload selection?

@param file:title=File|type=Allow Upload|required=false|desc=Select a video do use

 

Regards

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events